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

feat(securityhub): add tags securityhub_enabled #5231

Conversation

puchy22
Copy link
Member

@puchy22 puchy22 commented Sep 27, 2024

Context

Add missing tags to securityhub_enabled report.

Description

  • Add tags to SecurityHubHub.
  • Add new method to list tags.
  • Test new attributes and methods.
  • Add tags to reports to securityhub_enabled.
  • Add tags to checks tests affected.

Checklist

License

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

@puchy22 puchy22 requested review from a team as code owners September 27, 2024 15:10
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Sep 27, 2024
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.15%. Comparing base (c047b29) to head (68bc390).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...rs/aws/services/securityhub/securityhub_service.py 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5231      +/-   ##
==========================================
+ Coverage   89.09%   89.15%   +0.06%     
==========================================
  Files         987      988       +1     
  Lines       30335    30374      +39     
==========================================
+ Hits        27028    27081      +53     
+ Misses       3307     3293      -14     

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

@@ -85,6 +87,18 @@ def _describe_hub(self, regional_client):
f"{regional_client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)

def _list_tags(self, resource: any):
Copy link
Member

Choose a reason for hiding this comment

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

Please, check here not to do it for Hub with NOT_AVAILABLE status.

Copy link
Member

Choose a reason for hiding this comment

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

Since the ARN would be an account ARN and therefore, not valid.

Copy link
Member Author

Choose a reason for hiding this comment

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

Solved!

@sergargar sergargar self-requested a review September 30, 2024 14:12
@sergargar sergargar merged commit a1b9b21 into master Sep 30, 2024
10 of 11 checks passed
@sergargar sergargar deleted the PRWLR-4905-add-missing-resource-tags-to-report-for-security-hub-checks branch September 30, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants