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

feat: Dbtp 946 vpc store nat egress ips in parameter store #157

Merged

Conversation

tony-griffin
Copy link
Contributor

@tony-griffin tony-griffin commented Jun 6, 2024

DBTP-946 VPC module - store NAT egress IPs in parameter store

  • Creates an SSM parameter for each VPC that contains a NAT gateway egress EIP public IP address.

  • VALUE: This can then be passed into the IP filter when it needs to allow internal traffic

  • Currently skipping 2 Checkov alerts, discussion to be had as to whether these need a KMS key & SecureString type:

    • CKV_AWS_337: "Ensure SSM parameters are using KMS CMK"
    • CKV2_AWS_34: "AWS SSM Parameter should be Encrypted"
  • SSM params:
    Screenshot 2024-06-06 at 13 55 00

@tony-griffin tony-griffin changed the title Dbtp 946 vpc store nat egress ips in parameter store feat: Dbtp 946 vpc store nat egress ips in parameter store Jun 6, 2024
@tony-griffin tony-griffin marked this pull request as ready for review June 6, 2024 13:04
@tony-griffin tony-griffin requested a review from a team June 6, 2024 13:07
### Test aws_security_group resource ###
assert {
condition = startswith(aws_security_group.vpc-core-sg.arn, "arn:aws:ec2:eu-west-2:852676506468:security-group/sg-") == true
condition = length(regexall("|(arn:aws:ec2:eu-west-2:)[0-9]{12,14}(:security-group/sg-)|", aws_security_group.vpc-core-sg.arn)) > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hard coded account number was causing this test to fail.

vpc/tests/unit.tftest.hcl Outdated Show resolved Hide resolved
# checkov:skip=CKV_AWS_337:Ensure SSM parameters are using KMS CMK. Related ticket: https://uktrade.atlassian.net/browse/DBTP-946
# checkov:skip=CKV2_AWS_34:AWS SSM Parameter should be Encrypted. Related ticket: https://uktrade.atlassian.net/browse/DBTP-946
for_each = toset(var.arg_config.nat_gateways)
name = "/${var.arg_name}/nat-eip-${each.key}/ADDITIONAL_IP_LIST"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ejayesh in the ticket (https://uktrade.atlassian.net/jira/software/c/projects/DBTP/boards/458?quickFilter=882&selectedIssue=DBTP-946) it says to call it /ADDITIONAL_IP_LIST, but also in the ticket it says that we are not to add the parameter to a list.
Any clarification around this please?

@tony-griffin tony-griffin requested a review from a team June 6, 2024 15:16
@tony-griffin tony-griffin merged commit 2a7b595 into main Jun 17, 2024
7 checks passed
@tony-griffin tony-griffin deleted the dbtp-946-vpc-store-NAT-egress-ips-in-parameter-store branch June 17, 2024 13:09
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

Successfully merging this pull request may close these issues.

3 participants