Git Product home page Git Product logo

Comments (4)

eerkunt avatar eerkunt commented on June 4, 2024

Hi @vrbcntrl,

In case encryption_property does not have what you want for using encryption is enabled step, you can also drill down the resource with @when(u'it contain {something:ANY}') and @then(u'it must {condition:ANY} have {proto:ANY} protocol and port {port} for {cidr:ANY}') steps.

As a similar example for aws_elb ;

Scenario: TLS enforcement on ELB resources
    Given I have AWS ELB resource defined
    When it contains listener
    Then it must contain ssl_certificate_id

I also added

"aws_elasticache_replication_group": "at_rest_encryption_enabled"

to terraform-compliance 1.0.0 which will be released soon.

For the CHANGELOG, you can have a peek on https://github.com/eerkunt/terraform-compliance/blob/feature/1.0.0/CHANGELOG.md

from cli.

vrbcntrl avatar vrbcntrl commented on June 4, 2024

Hi @eerkunt , thanks for your prompt response.

My test case is as follows:

encryption_at_rest.feature

Scenario: AWS Elastic Cache
Given I have AWS Elastic Cache defined
Then encryption must be enabled

encryption_in_flight.feature

Scenario: AWS Elastic Cache
Given I have AWS Elastic Cache defined
Then encryption must be enabled

when I run the above 2 scenarios, separately, the first one i.e at_rest scenario works as expected, however the in_flight scenario always PASSED regardless of the transit_encryption_enabled value (true|false), but if I comment the at_rest_encryption_enabled property as shown below, the in_flight scenario works as expected.
encryption_property = {
"aws_elasticache_replication_group": "transit_encryption_enabled",

"aws_elasticache_replication_group": "at_rest_encryption_enabled"

}

So, I hope this helps to understand the issue.

from cli.

eerkunt avatar eerkunt commented on June 4, 2024

Hi @vrbcntrl,

That is quite normal, because you are running the same test against a same resource. You need to change one of your tests to cover both in-flight and at-rest encryption tests.

Currently, at_rest_encryption_enabled will be used for

Then encryption must be enabled

scenarios for aws_elasticache_replication_group

from cli.

vrbcntrl avatar vrbcntrl commented on June 4, 2024

Hi @eerkunt ,
I am able to cover both the encryption properties in a single test using Scenario Outline show below
` Scenario Outline: AWS Elastic Cache Replication Group
Given I have aws_elasticache_replication_group defined
Then it must contain

Examples:
| encryption |
| at_rest_encryption_enabled |
| transit_encryption_enabled |`

please let me know if there is any other better way...i am trying avoid the need for creating a new step :)

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.