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

allow optional / no egress security rule #34

Open
wilkej opened this issue May 10, 2021 · 0 comments
Open

allow optional / no egress security rule #34

wilkej opened this issue May 10, 2021 · 0 comments

Comments

@wilkej
Copy link

wilkej commented May 10, 2021

Describe the Feature

I would like the option to disable the egress security rule deployed by the module

resource "aws_security_group_rule" "egress" {
  count             = module.this.enabled ? 1 : 0
  type              = "egress"
  description       = "Allow all egress traffic"
  from_port         = 0
  to_port           = 0
  protocol          = "-1"
  cidr_blocks       = ["0.0.0.0/0"]
  security_group_id = join("", aws_security_group.default.*.id)
}

Expected Behavior

Allow to disable (optional) to remove the security group. The outbound rule isn't required as security groups are statefull and the document db itself won't open a connection to the outside.

Use Case

Scanning the file with TF_SEC throws an error

Problem 1

  [AWS007][WARNING] Resource 'module.docdb_cluster:aws_security_group_rule.egress' defines a fully open egress security group rule.

      13 |   from_port         = 0
      14 |   to_port           = 0
      15 |   protocol          = "-1"
      16 |   cidr_blocks       = ["0.0.0.0/0"]
      17 |   security_group_id = join("", aws_security_group.default.*.id)
      18 | }
      19 | 

  See https://tfsec.dev/docs/aws/AWS007/ for more information.

  disk i/o             114.710197ms
  parsing HCL          576.897µs
  evaluating values    94.868063ms
  running checks       996.996µs
  files loaded         23

1 potential problems detected.

Describe Ideal Solution

Allow to disable (optional) to remove the security group. The outbound rule isn't required as security groups are statefull and the document db itself won't open a connection to the outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant