[pass] [RFC][PATCH] create a default .gitignore for pass if not exists

Justus justus.seifert at cloudandheat.com
Mon Aug 25 13:54:50 CEST 2014


Hello pass devs,
I noticed that some users accidentally commit plain text passwords to
shared repositories, because they sometimes use editors and gpg without
invoking pass.  to remedy this problem, which leads to security
problems, I propose this patch that would prevent accidental commit of
unencrypted files in the password store

---
 src/password-store.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/password-store.sh b/src/password-store.sh
index 2287a46..b7d82b6 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -569,6 +569,11 @@ cmd_git() {
                git_add_file .gitattributes "Configure git repository
for gpg file diff."
                git config --local diff.gpg.binary true
                git config --local diff.gpg.textconv "$GPG -d
${GPG_OPTS[*]}"
+               if [[ ! -e "$PREFIX/.gitignore" ]]; then
+                       echo '*
+                       !*.gpg
+                       !.gpg-id' > "$PREFIX/.gitignore"
+               fi
        elif [[ -d $GIT_DIR ]]; then
                tmpdir nowarn #Defines $SECURE_TMPDIR. We don't warn,
because at most, this only copies encrypted files.
                export TMPDIR="$SECURE_TMPDIR"
-- 
2.1.0

-- 
Kind regards
Justus Seifert

Operator | IT-Operations

CLOUD&HEAT
The Cloud that heats homes worldwide

Firmen- und Rechnungsanschrift:
CLOUD & HEAT Technologies GmbH

Zeitenströmung
Königsbrücker Str. 96 - Halle 15
01099 Dresden, Germany

Lieferanschrift Produktion:
CLOUD & HEAT Technologies GmbH

Zeitenströmung
Königsbrücker Str. 96 - Halle 16a
01099 Dresden, Germany

Tel: +49 351 479 3670-0
Fax: +49 351 479 3670-110

E-Mail: justus.seifert at cloudandheat.com
Web: https://www.cloudandheat.com

Handelsregister: Amtsgericht Dresden
Registernummer: HRB 30549
USt.-Ident.-Nr.: DE281093504
Geschäftsführer: René Marcel Schretzmann
Gemeinsam mit uns nachhaltig sein!
Nicht jede E-Mail muss gedruckt werden.

Hinweis: Diese E-Mail und / oder die Anhänge ist / sind
vertraulich und ausschließlich für den bezeichneten Adressaten
bestimmt. Die Weitergabe oder Kopieren dieser E-Mail ist
strengstens verboten. Wenn Sie diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte unverzüglich den Absender und
vernichten Sie die Nachricht und alle Anhänge. Vielen Dank.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140825/f9399dde/attachment.asc>


More information about the Password-Store mailing list