pegleg/pegleg/engine
HUGHES, ALEXANDER (ah8742) a8620cfd8d Implement default umask for 640 file permissions
Some secrets are being created with undesirable permissions. Upon
inspection it was noticed that in general Pegleg is creating files,
then changing permissions after the fact. This leads to a small
window where the permissions on a file are overly permissive.

This patchset:
1. Sets default umask of 0o027 (640 permissions for files)
2. Explicitly adds the open flag ('r', 'w' etc.) to all open() calls.
3. Replaces sys.stdout.write calls with click.echo() calls to be more
   in line with the rest of the project.
4. Re-orders methods that write so that data is always first, and the
   path is always second.
5. Updates unit tests.
6. Adds unit tests for testing directory and file permissions.
7. Minor style changes.

Change-Id: I0c154aa311ea371940fd24b0aabf58fffaf1d231
2019-06-29 17:56:55 +00:00
..
catalog Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
catalogs Support b64 encoding of passphrase catalog 2019-05-14 08:11:11 -05:00
common pki: Port Promenade's PKI catalog into Pegleg 2019-01-15 13:29:21 -06:00
generators Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
util Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
__init__.py Pegleg encryption of site secrets 2018-10-30 16:53:51 +00:00
bundle.py Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
errorcodes.py Add nosec to Bandit False Positives 2019-05-09 15:29:26 +00:00
exceptions.py Make -u required in CLI when required by repo 2019-05-15 18:38:38 +00:00
lint.py Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
repository.py Make -u required in CLI when required by repo 2019-05-15 18:38:38 +00:00
secrets.py Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
site.py Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00
type.py Implement default umask for 640 file permissions 2019-06-29 17:56:55 +00:00