Skip to content
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

chore(cis): add CIS output class #4400

Conversation

sergargar
Copy link
Member

Description

Generate the CIS Compliance output object from a list of findings

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 75.91623% with 46 lines in your changes missing coverage. Please review.

Project coverage is 87.71%. Comparing base (f319884) to head (7536258).
Report is 506 commits behind head on master.

Files with missing lines Patch % Lines
prowler/__main__.py 0.00% 29 Missing ⚠️
prowler/lib/outputs/file_descriptors.py 0.00% 6 Missing ⚠️
prowler/lib/outputs/compliance/cis/cis_aws.py 92.00% 2 Missing ⚠️
prowler/lib/outputs/compliance/cis/cis_azure.py 92.00% 2 Missing ⚠️
prowler/lib/outputs/compliance/cis/cis_gcp.py 92.00% 2 Missing ⚠️
...owler/lib/outputs/compliance/cis/cis_kubernetes.py 92.00% 2 Missing ⚠️
prowler/lib/check/compliance_models.py 50.00% 1 Missing ⚠️
prowler/lib/outputs/compliance/compliance.py 50.00% 1 Missing ⚠️
...rowler/lib/outputs/compliance/compliance_output.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4400      +/-   ##
==========================================
+ Coverage   87.62%   87.71%   +0.08%     
==========================================
  Files         851      853       +2     
  Lines       26596    26624      +28     
==========================================
+ Hits        23306    23353      +47     
+ Misses       3290     3271      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergargar sergargar marked this pull request as ready for review July 8, 2024 21:31
@sergargar sergargar requested review from a team July 8, 2024 21:31
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a great piece of work @sergargar please review my comments when you get a chance, we are closer to the finish line 🏁

prowler/lib/outputs/compliance/models.py Outdated Show resolved Hide resolved
prowler/lib/outputs/compliance/models.py Outdated Show resolved Hide resolved
prowler/lib/outputs/compliance/models.py Outdated Show resolved Hide resolved
prowler/lib/outputs/compliance/models.py Outdated Show resolved Hide resolved
prowler/lib/outputs/compliance/models.py Outdated Show resolved Hide resolved
Comment on lines 31 to 32
content = content.removeprefix("\r\n")
content = content.removesuffix("\r\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
content = content.removeprefix("\r\n")
content = content.removesuffix("\r\n")

content = mock_file.read()
content = content.removeprefix("\r\n")
content = content.removesuffix("\r\n")
assert CIS_1_4_AWS.Description in content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to check all the fields within the output. Check the CSV tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments from tests/lib/outputs/compliance/cis_aws_test.py applies here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments from tests/lib/outputs/compliance/cis_aws_test.py applies here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments from tests/lib/outputs/compliance/cis_aws_test.py applies here.

@github-actions github-actions bot added the provider/kubernetes Issues/PRs related with the Kubernetes provider label Jul 9, 2024
@sergargar sergargar requested a review from jfagoagas July 9, 2024 13:17
@sergargar
Copy link
Member Author

All comments solved, thanks for the review @jfagoagas !

@sergargar sergargar requested a review from jfagoagas July 9, 2024 17:15
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @sergargar 👏

@sergargar sergargar merged commit a5a8c2a into master Jul 10, 2024
10 of 11 checks passed
@sergargar sergargar deleted the PRWLR-3949-generate-the-generic-compliance-output-object-from-a-list-of-findings branch July 10, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/kubernetes Issues/PRs related with the Kubernetes provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants