-
Notifications
You must be signed in to change notification settings - Fork 44
Ignore unsigned files (only read and hash files contained in signature manifest) #501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore unsigned files (only read and hash files contained in signature manifest) #501
Conversation
8d3c5e0
to
7577475
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main worry is that we're pushing the concerns all the way to the serialization, whereas this ignore only belongs in verification. Let's still compute the manifest with all the files that exist on disk and only ignore entries during verification.
I thought that's what I was doing by only passing in the |
... I mean it's most efficient to only hash those files that are being asked for rather than hashing all of them first and filtering after. Is this what you would want me to do, filter-out unwanted files just before comparing the manifests? |
Let me open a 2nd PR for this. I think disk access is and hashing is too expensive to filter for later... |
We should probably benchmark this, based on real scenarios. We already have an The most reticence comes from having to add a new flag, which we might not need in the future. We'll need to think more here. |
7577475
to
5258ef0
Compare
In some cases it may be desirable to let the signature drive which files are being hashed rather than the filesystem contents. To use |
5258ef0
to
31b7caa
Compare
31b7caa
to
a8eaa4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving instead of #502.
Will need to resolve conflicts, sorry for the delay that caused them |
a8eaa4f
to
65c541a
Compare
Add support for command line option --ignore-unsigned-files that allows to ignore files that are not part of the signature (= not listed in the manifest). This allows to ignore files that for example were added after a signature was created and those files' presence would make the signature verification fail. Another use case for this is the presence of multiple signatures in the same directory where it is necessary to ignore the files that are not covered by each signature. Add support for this option for all verification methods. If this option is set, then create a list of files_to_hash that is derived from the list of files in the signature manifest. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add test cases covering the cases of a symlink and an additional file created after a signature was created. Test expected failures and passes with and without the new option --ignore_unsigned_files. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
65c541a
to
40f27d3
Compare
Thanks for merging. |
Oh, this is awesome!! |
Summary
This PR adds support for an option --ignore_unsigned_files to ignore files that are not part of the signature manifest. This allows to for example ignore files that were added after a signature was created. Existing test cases are extended to cover additional symlinks and regular files added after signature created and tests for expected passes and failures depending on whether --ignore_unsigned_files is used.
Checklist