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 |
| "--used-rules", | ||
| default=False, | ||
| action="store_true", | ||
| help="Show used rules of component.", |
There was a problem hiding this comment.
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 |
jan-cerny
left a comment
There was a problem hiding this comment.
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-rulesflag to themost-used-componentscommand of theprofile_tool.pyfile, 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: