-
Notifications
You must be signed in to change notification settings - Fork 117
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
[opensuse] Add FileMetadataCheck check. #600
[opensuse] Add FileMetadataCheck check. #600
Conversation
14fc918
to
0fa76e4
Compare
cf15d15
to
a7f460d
Compare
0fa76e4
to
ffbae91
Compare
6cea459
to
b02a935
Compare
May I please ping this @mgerstner? |
Sure ... I first wanted to add the tests for the other check but didn't find time yet. I can prioritize this review here instead. |
@marxin where can one get current rpmlint2 builds in OBS these days? |
Well this check does not do at all yet what we (security team) intended. This check only triggers when a whitelisting entry exists, but it needs to trigger for any packaged file that matches certain criteria. So currently we have Similar to the file digest check we need to tie whitelisting entries to package names. |
b02a935
to
ca87b64
Compare
I see.
Can we do these 2 checks in one? I mean what about listing package files that are either a device (block or character) or have a writable file. For these, we should find a whitelisting entry that will list all the files and their metadata match? Am I right that you expect a different set of flags of a file for each of the 2 checks you have?
Yep, we pretty much know how to define a configuration for it. |
I am not quite sure yet what you mean. Is your question whether we should keep a single whitelist for both, device files and world writable files? I don't think this is so important. Currently in rpmlint1 we have two differently configured checks and thus two separate whitelists. I don't think it is easy to come up with a generic metadata checker that catches both cases. What I currently do in rpmlint-checks is already a bit unclean but I managed to reuse the same checker code with different initialization data for device restrictions and for world-writable restrictions. It would be good to be able to easily reuse the code to e.g. also implement the setuid-root binary restrictions and so on. But I believe still each type of restriction needs to have its own checker instantiation.
Well for the device file we naturally need the minor and major IDs otherwise the settings can be shared. |
ca87b64
to
2ce5a64
Compare
All right, I implemented the 2 checks. It's tested very lightly, feel free to add more tests, please. |
This pull request introduces 1 alert when merging 2ce5a64 into 1f8b499 - view on LGTM.com new alerts:
|
2ce5a64
to
56c7891
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.
The device file check looks good. The world writable check requires some tuning but after that should also work out.
With this fix the basic check should work as expected. I can then add more tests and the description in a follow-up PR. |
Great, thanks. |
Second check separated from #594.