Modify configuration to be aligned with new structure - #649
Conversation
|
This pull request does not have a backport label. Could you fix it @uri-weisman? 🙏
|
Cloudbeat CI 🤖Allure Report: http://csp-allure-reports.s3.amazonaws.com/allure_reports/cloudbeat/prs/649/index.html |
|
|
||
| type BenchmarkConfig struct { | ||
| ID string `config:"benchmark"` | ||
| AWSConfig aws.ConfigAWS `config:"aws.credentials"` |
There was a problem hiding this comment.
I don't see why AWSConfig should be a part of BenchmarkConfig.
For example, vulnerability management is not a benchmark but we will want to reuse the AWS authentication logic there.
There was a problem hiding this comment.
I see.
We can keep this structure and rename BenchmarkConfig to something more general to include vulnerability management.
There was a problem hiding this comment.
Besides the integration already sending the AWS credentials as part of the benchmark config, is there a real reason to enforce that coupling? In the future we will have also GCPConfig and AzureConfig are they all going to be part of an object that also contains the benchmark details?
I think we should have a CloudConfig object, that for now holds only aws credentials, while benchmark config should be a separate object.
| benchmark: cis_aws | ||
| aws: | ||
| credentials: | ||
| access_key_id: ${AWS_ACCESS_KEY_ID:no_access_key_was_set} |
There was a problem hiding this comment.
Why do we have these values instead of nil or empty values that will omitempty the keys in unmarshal flow?
no_access_key_was_set
no_secret_was_set
I think this creates a more complex flow where we populate fields with mock values just to fail later on.
I would expect the behavior to be different where we do not populate the fields and just fail on validation that the fields were non-existent or continue the flow without keys in case of anonymous access (which this change blocks since it mocks something invalid).
Obviously, this would require changes to the config.go and potentially changes to the validator in case we do not want to rely on config.go, but as of today all of our validations happen in the config.go layer.
There was a problem hiding this comment.
No real reason just wanted to be aligned with the EKS config file.
I'll revert it to an empty string.
This reverts commit bbf88c6.
…into cis_aws_e2e
gurevichdmitry
left a comment
There was a problem hiding this comment.
@uri-weisman, deploy dir files approved. Please also update cloudbeat-eks-pytest.yaml in tests dir.
| aws: | ||
| credentials: | ||
| access_key_id: ${AWS_ACCESS_KEY_ID:no_access_key_was_set} | ||
| secret_access_key: ${AWS_SECRET_ACCESS_KEY:no_secret_was_set} |
There was a problem hiding this comment.
@uri-weisman, the file tests/deploy/cloudbeat-eks-pytest.yaml should be also updated with the code above.
gurevichdmitry
left a comment
There was a problem hiding this comment.
@uri-weisman, deploy files approved.
What does this PR do?
Related Issues
Checklist