Skip to content

Commit

Permalink
Allow the cyhy and bod bastions egress over HTTPS
Browse files Browse the repository at this point in the history
This adds two security group rules, each of which allows a respective
bastion egress over HTTPS to anywhere. This will allow the bastions to
perform automatic security updates as well as correctly push logs into
AWS CloudWatch.
  • Loading branch information
mcdonnnj committed Aug 14, 2023
1 parent 13b5bfa commit 77d165d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ terraform apply -var-file=<your_workspace>.tfvars
| [aws_security_group_rule.bod_bastion_egress_all_icmp_to_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.bod_bastion_egress_all_tcp_to_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.bod_bastion_egress_all_udp_to_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.bod_bastion_https_egress_to_anywhere](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.bod_bastion_ingress_all_icmp_from_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.bod_bastion_ingress_all_tcp_from_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.bod_bastion_ingress_all_udp_from_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
Expand All @@ -495,6 +496,7 @@ terraform apply -var-file=<your_workspace>.tfvars
| [aws_security_group_rule.cyhy_bastion_egress_all_icmp_to_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.cyhy_bastion_egress_all_tcp_to_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.cyhy_bastion_egress_all_udp_to_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.cyhy_bastion_https_egress_to_anywhere](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.cyhy_bastion_ingress_all_icmp_from_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.cyhy_bastion_ingress_all_tcp_from_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.cyhy_bastion_ingress_all_udp_from_mgmt_vulnscan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
Expand Down
10 changes: 10 additions & 0 deletions terraform/bod_bastion_security_group_rules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ resource "aws_security_group_rule" "bastion_self_ssh" {
to_port = 22
}

# Allow HTTPS egress anywhere
resource "aws_security_group_rule" "bod_bastion_https_egress_to_anywhere" {
security_group_id = aws_security_group.bod_bastion_sg.id
type = "egress"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
from_port = 443
to_port = 443
}

# Allow ssh egress to the docker security group
resource "aws_security_group_rule" "bastion_ssh_to_docker" {
security_group_id = aws_security_group.bod_bastion_sg.id
Expand Down
10 changes: 10 additions & 0 deletions terraform/cyhy_bastion_security_group_rules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ resource "aws_security_group_rule" "bastion_self_egress" {
to_port = 22
}

# Allow HTTPS egress anywhere
resource "aws_security_group_rule" "cyhy_bastion_https_egress_to_anywhere" {
security_group_id = aws_security_group.cyhy_bastion_sg.id
type = "egress"
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
from_port = 443
to_port = 443
}

# Allow egress via ssh to the private security group
resource "aws_security_group_rule" "bastion_egress_to_private_sg_via_ssh" {
security_group_id = aws_security_group.cyhy_bastion_sg.id
Expand Down

0 comments on commit 77d165d

Please sign in to comment.