Skip to content
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

Specifying CIDR as regex for security group #265

Closed
pontinjx opened this issue May 11, 2020 · 4 comments
Closed

Specifying CIDR as regex for security group #265

pontinjx opened this issue May 11, 2020 · 4 comments
Assignees
Labels
bug waiting for confirmation Workaround/Fix applied, waiting for confirmation

Comments

@pontinjx
Copy link

Hi,

I'm trying to write a rule that will fail a security group if it has an ingress rule with prefix less than /8 except on ports 443 or 80. I've tried the following but get an TerraformComplianceInvalidData: is not a valid CIDR error. I'm not sure if this is the right way to go about it or if this is even possible?

Feature: FNoPublicPorts A security group should not have less than /8 for a port other than 80 or 443   
    Scenario Outline: FNoPublicPorts A security group not have less than /8 for a port other than 80 or 443  
        Given I have aws_security_group defined
        When it contains ingress
        Then it must not have <proto> protocol and port <portRange> for "([0-9]{1,3}\.){3}[0-9]{1,3}\/[0-7]$"

        Examples:
            |proto|portRange|
            |tcp|0-79|
            |tcp|81-442|
            |tcp|444-65535|

Thanks very much

@eerkunt
Copy link
Member

eerkunt commented May 12, 2020

Thanks for reporting this @pontinjx. Just released 1.2.0 and it hasn't has this fix. Will have a look on this after finishing some bug fixes waiting for a long time :)

@eerkunt eerkunt added the bug label May 12, 2020
@eerkunt eerkunt self-assigned this May 12, 2020
@eerkunt
Copy link
Member

eerkunt commented May 24, 2020

Fixed in 1.2.2 release, could you please have a try ?

Thanks 🎉

@eerkunt eerkunt added the waiting for confirmation Workaround/Fix applied, waiting for confirmation label May 24, 2020
@pontinjx
Copy link
Author

Thank you, that's working now 🎉

@ghost
Copy link

ghost commented May 26, 2020

This issue's conversation is now locked. If you want to continue this discussion please open a new issue.

@ghost ghost locked and limited conversation to collaborators May 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug waiting for confirmation Workaround/Fix applied, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants