Reset mtime of source private keys to default creation time #6270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Ready for review
Description of Changes
We set the GPG key creation time to 2013-05-14 to hide when they
were created, revealing when a source started using SecureDrop. However
this information was being leaked via the file modification time of the
private key material in the $keydir/private-keys-v1.d/ folder.
We set the GPG key creation time to 2013-05-14 to hide when they
were created, revealing when a source started using SecureDrop. However
this information was being leaked via the file modification time of the
private key material in the $keydir/private-keys-v1.d/ folder.
While we can easily change a file's mtime to a past date, faking the
ctime really isn't possible. So instead we touch each private key when
the source app starts to mask the real creation time. Because of the
nightly restarts, this will be updated within 24 hours of source
creation.
Fixes https://github.com/freedomofpress/securedrop-security/issues/71.
Testing
/var/lib/securedrop/keys/private-keys-v1.d
, wait a minute, make a whitespace-only change tosource_app/__init__.py
so the auto reloader restarts the app. Look at mtime+ctime of private keys, they should be different.Deployment
Any special considerations for deployment? Not really.
Checklist
make lint
) and tests (make test
) pass in the development container