-
Notifications
You must be signed in to change notification settings - Fork 711
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
Show most used rules of component #12001
Show most used rules of component #12001
Conversation
Skipping CI for Draft Pull Request. |
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
86c2a03
to
1631c8f
Compare
I wonder how the counts are computed. If I run your tool I for example see that
|
build-scripts/profile_tool.py
Outdated
"--used-rules", | ||
default=False, | ||
action="store_true", | ||
help="Show used rules of component.", |
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.
We need a better help text:
For every component, show usage of each rule in profiles in the given product.
18c4e0b
to
3abbcd6
Compare
Now the output of the scripts seems to correspond to the results that we can get by searching in resolved profiles. I'm thinking now that we should remove the "default" profile from the statistics. The "default" profile is a trash bin for rules that aren't present in any real profile but need to be kept in the data streams for backward compatibility reason. But, for the purpose of giving us a knowledge about usage of components in security profiles, the "default" profile is totally uninteresting. Do you agree? |
8915b86
to
95be94a
Compare
Code Climate has analyzed commit 95be94a and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 59.4% (0.0% change). View more on Code Climate. |
/packit rebuild-failed |
@jan-cerny I removed the default profile. |
/packit build |
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.
I have generated the output for RHEL 8 content, I have checked the output and I have checked some random rules if the reported number is the same as count of occurrences in the built profiles (build/rhel8/profiles). The results were OK.
Description:
This PR adds the
--used-rules
flag to themost-used-components
command of theprofile_tool.py
file, which adds a list of used component's rules with the number of profiles where the rule is used.Review Hints:
To get a list of the most used components with used rules for product RHEL9 you can run this command: