feat(arn): refactor arn for unknown resources #5712
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes changes to various AWS service checks to ensure that the
resource_arn
is correctly set when certain conditions are met. Additionally, corresponding test cases have been updated to reflect these changes.Changes to AWS service checks:
prowler/providers/aws/services/accessanalyzer/accessanalyzer_enabled/accessanalyzer_enabled.py
: Added logic to setresource_arn
when the analyzer status is "NOT_AVAILABLE".prowler/providers/aws/services/bedrock/bedrock_model_invocation_logging_enabled/bedrock_model_invocation_logging_enabled.py
: Updatedresource_arn
assignment logic based on logging status.prowler/providers/aws/services/bedrock/bedrock_model_invocation_logs_encryption_enabled/bedrock_model_invocation_logs_encryption_enabled.py
: Addedresource_arn
assignment in multiple conditions where encryption is not enabled.prowler/providers/aws/services/guardduty/guardduty_is_enabled/guardduty_is_enabled.py
: Setresource_arn
when GuardDuty is not enabled or configured.prowler/providers/aws/services/iam/iam_check_saml_providers_sts/iam_check_saml_providers_sts.py
: Addedresource_arn
assignment when no SAML Providers are found.prowler/providers/aws/services/organizations/organizations_account_part_of_organizations/organizations_account_part_of_organizations.py
: Updatedresource_arn
assignment logic based on organization status.prowler/providers/aws/services/organizations/organizations_opt_out_ai_services_policy/organizations_opt_out_ai_services_policy.py
: Addedresource_arn
assignment in multiple conditions. [1] [2]prowler/providers/aws/services/organizations/organizations_scp_check_deny_regions/organizations_scp_check_deny_regions.py
: Updatedresource_arn
assignment logic based on policy status. [1] [2] [3]prowler/providers/aws/services/organizations/organizations_tags_policies_enabled_and_attached/organizations_tags_policies_enabled_and_attached.py
: Addedresource_arn
assignment when tag policies are enabled but not attached. [1] [2]prowler/providers/aws/services/securityhub/securityhub_enabled/securityhub_enabled.py
: Setresource_arn
when Security Hub is not enabled or configured.Updates to test cases:
tests/providers/aws/services/accessanalyzer/accessanalyzer_enabled/accessanalyzer_enabled_test.py
: Addedaudited_partition
andaudited_account
to mock client and updated assertions forresource_arn
. [1] [2] [3] [4] [5]tests/providers/aws/services/bedrock/bedrock_model_invocation_logging_enabled/bedrock_model_invocation_logging_enabled_test.py
: Updated assertions forresource_arn
.tests/providers/aws/services/bedrock/bedrock_model_invocation_logs_encryption_enabled/bedrock_model_invocation_logs_encryption_enabled_test.py
: Updated assertions forresource_arn
. [1] [2] [3]Checklist
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.