|
@@ -46,16 +46,16 @@ module "aws_endpoints_sg" {
|
|
|
# vuln_scanner_sgs = [ "${module.vuln_scanners_sg.this_security_group_id}" ]
|
|
|
#}
|
|
|
|
|
|
-
|
|
|
-module "allow_all_sg" {
|
|
|
+# "Allow
|
|
|
+module "allow_all_from_trusted_sg" {
|
|
|
use_name_prefix = false
|
|
|
source = "terraform-aws-modules/security-group/aws"
|
|
|
version = "~> 3"
|
|
|
- name = "allow-all"
|
|
|
+ name = "allow-all-from-trusted"
|
|
|
tags = merge(var.standard_tags, var.tags)
|
|
|
vpc_id = module.vpc.vpc_id
|
|
|
|
|
|
- ingress_cidr_blocks = [ "0.0.0.0/0" ]
|
|
|
+ ingress_cidr_blocks = concat(var.trusted_ips, [ "10.0.0.0/8" ])
|
|
|
egress_cidr_blocks = [ "0.0.0.0/0" ]
|
|
|
ingress_rules = [ "all-all" ]
|
|
|
egress_rules = [ "all-all" ]
|
|
@@ -97,3 +97,12 @@ module "typical_host_security_group" {
|
|
|
aws_region = var.aws_region
|
|
|
aws_partition = var.aws_partition
|
|
|
}
|
|
|
+
|
|
|
+# CIS 4.3 - Default security group should restrict all traffic
|
|
|
+#
|
|
|
+# This resource is special, and clears out existing rules. See:
|
|
|
+# See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_security_group
|
|
|
+resource "aws_default_security_group" "default" {
|
|
|
+ vpc_id = module.vpc.vpc_id
|
|
|
+ tags = merge(var.standard_tags, var.tags)
|
|
|
+}
|