Package: gopass-chrome-importer
gopass-chrome-importerA simple tool to import Chrome passwords intogopass.How it worksgopass-chrome-importerparses the.csvfile that can be exported from chrome
and loops over each entry in the list which providesaname(of the entry)theurltheusernamethepasswordDetermining the secret file pathSince not only passwords for websites are stored in chrome all entries are divided into categories
which are later used as subfolders when creating the actual secrets in gopass.Next the url is simplified based on the category to provide a human readable name for the secret.To improve usability with the gopass chrome and firefox plugin the username is used as the file name of the secret.websitethe url is stripped down to only contain the domain (and all subdomains) f.ex.import/website/smile.amazon.com/your@mail.comipsince saved passwords of IPs can be duplicates based on the network you are in
these passwords are sorted into their own category and the url is stripped to only contain the IP (v4)IPv6 is currently not detected and would be handled as a websiteandroidthe url is stripped down to only contain the package of the app f.ex.import/android/com.paypal.android.p2pmobile/your@mail.comSecret file contentThe first line of a secret is always supposed to be a password
with additional info added below separated by a---divider.
When a username is available it will be added to the additional info section
which can then be used by the chrome and firefox plugin:mypassword1234
---
user: myuserIf no user is available just the password is written to the file:mypassword1234Creating the secretSincegopassdoes not provide a non-interactive way to create or modify secrets the fact that
secrets can not only be edited but also created using thegopass editcommand is used to work around this
(security related) limitation. When executinggopass edit /some/secretgopasscreates a temporary decrypted
file inside/dev/shmfor this secret which is then passed to$EDITOR.gopass-chrome-importeruses this to
its advantage and writes itself into that env variable to process the temporarily decrypted file.
First of all the existing file is checked to prevent overwriting of existing secret data.
If those checks succeed the secret is written to the file in the form described above.
After thatgopassencrypts the temporary file with the selected recipients and (if a remote is available)
pushes it to the server.InstallingNow that you hopefully have a good understanding of how this tool works lets actually try it out!Since this package is not completely without dependencies it is recommended to install it inside avirtualenv:python3-mvenv~/path/to/new/virtual/environmentsource~/path/to/new/virtual/environment/bin/activate
pip3installgopass-chrome-importerUsageFor basic usage theimportcommand should be all you ever need.gopass-chrome-importerhas a couple of parameters to customize the import result
and you should take a look what they offer before actually importing anything.
For a quick overview call:gopass-chrome-importerimport--helpDry RunTo test things out before actually importing passwords intogopass(and possibly
pushing them to origin) you can use the-dor--dry-runoption. This will only output
secret paths and contents where passwords are masked as asterisks to give you an idea of what would
happen.An example output would look similar to this:Would import: /import/ip/127.0.0.1/joe
******
---
user: joe

Would import: /import/ip/192.168.0.1/admin
********************
---
user: adminFor safetyallexamples on this page will include this option.Set the path to the chrome password export .csvTo set the path to theexport.csvfile just use the-por--pathoption:gopass-chrome-importerimport--path"~/Downloads/Chrome Passwords.csv"--dry-runChanging the base import pathBy defaultgopass-chrome-importerwill import secrets into animport/folder. To change this simply
use the-gbor--gopass-basepathoption:gopass-chrome-importerimport--path"~/Downloads/Chrome Passwords.csv"--gopass-basepath/test/--dry-run--yesBy defaultgopasswill ask you some questions when creating a secret like which recipients to use for this secret.
For large lists of passwords this can be quite a hassle.gopasshas a built in--yesoption to circumvent this
by always using "Y" or the default (ifyesis not an option). This parameter can also be used (in addition to-y)
ingopass-chrome-importerand will just pass it on togopass.gopass-chrome-importerimport--path"~/Downloads/Chrome Passwords.csv"--gopass-basepath/test/--yes--dry-runOverwrite existing passwords/file contentsWhengopass-chrome-importertries to save a password in a file that
already exists and that file isnotempty it will (by default)not change the file contentsto prevent accidentally overwriting of existing passwords.You can forcegopass-chrome-importerto ignore this check by using the-for--forceoption.Although your existing passwords are backed up in a git and (hopefully) synced to a
server side backendbe careful and think twice before using this option.gopass-chrome-importerimport--path"~/Downloads/Chrome Passwords.csv"--gopass-basepath/test/--yes--force--dry-runContributingGitHub is for social coding: if you want to write code, I encourage contributions through pull requests from forks
of this repository. Create GitHub tickets for bugs and new features and comment on the ones that you are interested in.LicenseMIT License

Copyright (c) 2018 Markus Ressel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.