feat: add support for awscc provider secrets check #6647
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.
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
The PR intends to extend the CKV_AWS_41 to have an AWSCC variant to the support the provider. Since the IDs have to be unique, I have currently kept it to be CKV_AWSCC_41 with the assumption that the rules are based on the provider and not the target platform. Ideally this can be handled as an extension to CKV_AWS_41, but the tests and any additional resourced based rules would need AWS CC based resources which have a different resource attribute structure in many cases.
Though this PR doesn't fix #6410, the intention is to start contributing rules targeting AWSCC provider.
New/Edited policies (Delete if not relevant)
Description
The rule maps back to the way a provider is configured to work with AWS.
Fix
How does someone fix the issue in code and/or in runtime?
Checklist:
Generated description
Dear maintainer, below is a concise technical summary of the changes proposed in this PR:
Introduce a new security check
CKV_AWSCC_41
to ensure no hard-coded AWS access keys and secret keys exist in the AWSCC provider configuration. This involves creating a new classAWSCCCredentials
incredentials.py
under theawscc
provider directory. The class extendsBaseProviderCheck
and implements thescan_provider_conf
method to detect hard-coded credentials using regex patterns. Additionally, the__init__.py
files are updated to include the new provider and its checks. Corresponding unit tests are added intest_credentials.py
to validate the functionality of the new check.Modified files (2)
Latest Contributors(0)
Modified files (2)
Latest Contributors(2)