-
Notifications
You must be signed in to change notification settings - Fork 150
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
Custom Scenarion in encryption at rest feature throws AttributeError #90
Comments
Thank you @eerkunt for the response. I'll wait for the update from you then :) |
This should be fixed in |
Hi @eerkunt , I have again tested this use case with 1.0.4, unfortunately it still throws me a different error now
Please find my tf template, out file and the results in the attachments. |
Thanks for trying it again. #101 introduces a fix and enhancement on these kind of conditions. Now we support heredoc json strings. Please have a try with |
Thanks @eerkunt for fixing the issue. The new version 1.0.5 works fine if I wanted to test a single encryption property i.e so I tried to test them using the same technique used for #93 , however it didn't work :( ` Scenario Ouline: AWS EMR Encryption at Rest Examples: I got the below error: `Error Oracle says: @step(r"Then it must contain ") so, if you could let me know how to test the 2 or 3 related properties in the same resource, that would be really helpful...thanks in advance! |
There are multiple problems here.
Scenario Outline: AWS EMR Encryption at Rest and In-Flight
Given I have aws_emr_security_configuration defined
When it contains configuration
Then it must contain <encryption>
Then its value must match the "<value>" regex
Examples:
| encryption | value |
| EnableInTransitEncryption | true |
| EnableAtRestEncryption | true |
Could you please try with |
Hi,
I wrote a custom Scenario shown below to test aws_emr_security_configuration encryption at rest
`Feature: Resources should use encryption at rest while they are created
In order to improve security
As engineers
We'll enforce encryption at rest
Scenario: AWS EMR Encryption at Rest
Given I have AWS EMR Security Configuration instance defined
When it contains configuration
Then encryption must be enabled`
main.tf
`resource "aws_emr_security_configuration" "foo" {
name = "emrsc_other"
configuration = <<EOF
{
"EncryptionConfiguration": {
"AtRestEncryptionConfiguration": {
"S3EncryptionConfiguration": {
"EncryptionMode": "SSE-S3"
},
"LocalDiskEncryptionConfiguration": {
"EncryptionKeyProviderType": "AwsKms",
"AwsKmsKey": "arn:aws:kms:us-west-2:187416307283:alias/tf_emr_test_key"
}
},
"EnableInTransitEncryption": false,
"EnableAtRestEncryption": true
}
}
EOF
}
when I run my test against the above template with my feature, I get AttributeError: 'str' object has no attribute 'keys' console output
Running tests.Feature: Resources should use encryption at rest while they are created # C:\Training\AWS\Cloud-CustomRules\Terraform-Compliance\rules\encryption_at_rest.feature
In order to improve security
As engineers
We'll enforce encryption at rest
1 features (0 passed, 1 failed)
1 scenarios (0 passed, 1 failed)
3 steps (2 passed, 1 failed)
Run 1556667708 finished within a moment
Cleaning up.`
Not sure what is wrong here, i guess may be I am not reading the EnableAtRestEncryption property correctly?
any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: