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

Block 20 ACL #1609

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ jobs:
TF_VAR_customer_whitelist_source_ip_ranges_set_arn: ((customer_whitelist_source_ip_ranges_set_arn))
TF_VAR_internal_vpc_cidrs_set_arn: ((internal_vpc_cidrs_set_arn))
TF_VAR_cg_egress_ip_set_arn: ((cg_egress_ip_set_arn))
TF_VAR_block_range_20: ((block_range_20))
- *notify-slack

- name: bootstrap-development
Expand Down Expand Up @@ -683,6 +684,7 @@ jobs:
TF_VAR_customer_whitelist_source_ip_ranges_set_arn: ((customer_whitelist_source_ip_ranges_set_arn))
TF_VAR_internal_vpc_cidrs_set_arn: ((internal_vpc_cidrs_set_arn))
TF_VAR_cg_egress_ip_set_arn: ((cg_egress_ip_set_arn))
TF_VAR_block_range_20: ((block_range_20))
- *notify-slack

- name: bootstrap-staging
Expand Down Expand Up @@ -841,6 +843,8 @@ jobs:
TF_VAR_customer_whitelist_source_ip_ranges_set_arn: ((customer_whitelist_source_ip_ranges_set_arn))
TF_VAR_internal_vpc_cidrs_set_arn: ((internal_vpc_cidrs_set_arn))
TF_VAR_cg_egress_ip_set_arn: ((cg_egress_ip_set_arn))
TF_VAR_block_range_20: ((block_range_20))

- *notify-slack

- name: bootstrap-production
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/bosh_vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ variable "bosh_default_ssh_public_key" {
variable "s3_gateway_policy_accounts" {
type = list(string)
default = []
}

#Placeholder for real value, passed as a secret
variable "block_range_20" {
default = "192.168.0.0/32"
}
27 changes: 27 additions & 0 deletions terraform/modules/bosh_vpc/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,30 @@ resource "aws_flow_log" "main_vpc_flow_log" {
traffic_type = "ALL"
}

data "aws_network_acls" "default" {
vpc_id = aws_vpc.main_vpc.id
}

resource "aws_network_acl_rule" "deny_rule_ingress_rule_20" {
count = length(data.aws_network_acls.default.ids)
rule_number = 20
network_acl_id = data.aws_network_acls.default.ids[count.index]
rule_action = "deny"
protocol = "-1"
cidr_block = var.block_range_20
from_port = 0
to_port = 0
egress = false
}

resource "aws_network_acl_rule" "deny_rule_egress_rule_20" {
count = length(data.aws_network_acls.default.ids)
rule_number = 20
network_acl_id = data.aws_network_acls.default.ids[count.index]
rule_action = "deny"
protocol = "-1"
cidr_block = var.block_range_20
from_port = 0
to_port = 0
egress = true
}
1 change: 1 addition & 0 deletions terraform/modules/stack/base/base.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module "vpc" {
concourse_security_group_cidrs = var.target_concourse_security_group_cidrs
bosh_default_ssh_public_key = var.bosh_default_ssh_public_key
s3_gateway_policy_accounts = var.s3_gateway_policy_accounts
block_range_20 = var.block_range_20
}

module "rds_network" {
Expand Down
6 changes: 6 additions & 0 deletions terraform/modules/stack/base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,9 @@ variable "s3_gateway_policy_accounts" {
type = list(string)
default = []
}


#Placeholder for real value, passed as a secret
variable "block_range_20" {
default = "192.168.0.0/32"
}
1 change: 1 addition & 0 deletions terraform/modules/stack/spoke/spoke.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module "base" {
restricted_ingress_web_ipv6_cidrs = var.restricted_ingress_web_ipv6_cidrs
bosh_default_ssh_public_key = var.bosh_default_ssh_public_key
s3_gateway_policy_accounts = var.s3_gateway_policy_accounts
block_range_20 = var.block_range_20

rds_security_groups = [
module.base.bosh_security_group,
Expand Down
6 changes: 6 additions & 0 deletions terraform/modules/stack/spoke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,9 @@ variable "s3_gateway_policy_accounts" {
type = list(string)
default = []
}


#Placeholder for real value, passed as a secret
variable "block_range_20" {
default = "192.168.0.0/32"
}
3 changes: 2 additions & 1 deletion terraform/stacks/main/stack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ module "stack" {
target_account_id = data.aws_caller_identity.tooling.account_id
bosh_default_ssh_public_key = var.bosh_default_ssh_public_key
s3_gateway_policy_accounts = var.s3_gateway_policy_accounts
block_range_20 = var.block_range_20

target_vpc_id = data.terraform_remote_state.target_vpc.outputs.vpc_id
target_vpc_cidr = data.terraform_remote_state.target_vpc.outputs.production_concourse_subnet_cidr
Expand Down Expand Up @@ -424,4 +425,4 @@ module "cloudwatch" {
stack_description = var.stack_description
sns_arn = data.aws_sns_topic.cg_notifications.arn
load_balancer_dns = module.cf.lb_arn_suffix
}
}
5 changes: 5 additions & 0 deletions terraform/stacks/main/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,8 @@ variable "cg_egress_ip_set_arn" {
type = string
description = "ARN of IP set identifying egress IP CIDR ranges for cloud.gov"
}

#Placeholder for real value, passed as a secret
variable "block_range_20" {
default = "192.168.0.0/32"
}
Loading