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

fix(asff): handle empty Recommendation Url #2496

Conversation

sergargar
Copy link
Member

Description

Handle empty Recommendation Url since Security Hub does not accept them empty.

License

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

@sergargar sergargar requested a review from a team as a code owner June 15, 2023 08:21
@@ -78,6 +78,9 @@ def fill_json_asff(finding_output, audit_info, finding, output_options):
AssociatedStandards=associated_standards,
RelatedRequirements=compliance_summary,
)
# Fill Recommendation Url if it is blank
if not finding.check_metadata.Remediation.Recommendation.Url:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you create a test for this case please?

Copy link
Member Author

@sergargar sergargar Jun 15, 2023

Choose a reason for hiding this comment

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

We cannot create it since moto does not cover this call and we cannot mock the call twice.

Copy link
Member

Choose a reason for hiding this comment

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

This has nothing to do with Moto, is just a test for the fill_asff_json. I'm finishing it and I'll push it later today.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks 😄

@jfagoagas jfagoagas force-pushed the 2492-bug-unable-to-push-findings-to-security-hub-when-recommendation-url-is-blank branch from 058bf25 to c328c48 Compare June 15, 2023 15:01
@sergargar sergargar requested a review from n4ch04 June 15, 2023 21:48
@jfagoagas jfagoagas self-requested a review June 16, 2023 10:07
@sergargar sergargar requested review from n4ch04 and jfagoagas and removed request for jfagoagas and n4ch04 June 16, 2023 10:14
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.

🚀

@sergargar sergargar merged commit 0d81bd4 into master Jun 16, 2023
4 checks passed
@sergargar sergargar deleted the 2492-bug-unable-to-push-findings-to-security-hub-when-recommendation-url-is-blank branch June 16, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to push findings to Security Hub when Recommendation Url is blank.
3 participants