12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- # SG Summary - Server
- # Ingress:
- # 22 - sync from other security centers
- # 443 - User access
- # Egress:
- # 25 - smtp
- # 443 - updates
- # tcp/1243 - "Communicating with Log Correlation Engine" (unneeded in xdr)
- # tcp/8834-8835 - Communicating With Nessus - to vpc-scanners
- resource "aws_security_group" "nessus_scanner" {
- name_prefix = "nessus_scanner"
- tags = merge(local.standard_tags, var.tags, { Name = "nessus_scanner" })
- vpc_id = var.vpc_id
- description = "Nessus Security Scanner"
- }
- #-----------------------------------------------------------------
- # Ingress
- #-----------------------------------------------------------------
- resource "aws_security_group_rule" "nessus_scanner_inbound_icmp" {
- security_group_id = aws_security_group.nessus_scanner.id
- type = "ingress"
- description = "Inbound pings"
- cidr_blocks = ["10.0.0.0/8"]
- from_port = -1
- to_port = -1
- protocol = "ICMP"
- }
- resource "aws_security_group_rule" "nessus_scanner_inbound_22" {
- security_group_id = aws_security_group.nessus_scanner.id
- type = "ingress"
- description = "SSH - Inbound (from access)"
- cidr_blocks = toset(concat(local.cidr_map["vpc-access"], local.cidr_map["vpc-private-services"]))
- from_port = 22
- to_port = 22
- protocol = "tcp"
- }
- resource "aws_security_group_rule" "nessus_scanner_inbound_3022" {
- security_group_id = aws_security_group.nessus_scanner.id
- type = "ingress"
- description = "Inbound teleport (from access)"
- cidr_blocks = local.cidr_map["vpc-access"]
- from_port = 3022
- to_port = 3022
- protocol = "tcp"
- }
- resource "aws_security_group_rule" "nessus_scanner_inbound_443" {
- security_group_id = aws_security_group.nessus_scanner.id
- type = "ingress"
- description = "443 - Inbound (from access)"
- cidr_blocks = toset(concat(local.cidr_map["vpc-access"], local.cidr_map["vpc-private-services"]))
- from_port = 443
- to_port = 443
- protocol = "tcp"
- }
- resource "aws_security_group_rule" "nessus_scanner_inbound_nessus" {
- security_group_id = aws_security_group.nessus_scanner.id
- type = "ingress"
- description = "Inbound Nessus"
- cidr_blocks = toset(concat(local.cidr_map["vpc-access"], local.cidr_map["vpc-private-services"]))
- from_port = 8834
- to_port = 8835
- protocol = "tcp"
- }
- resource "aws_security_group_rule" "nessus_scanner_inbound_scan_ourselves" {
- security_group_id = aws_security_group.nessus_scanner.id
- source_security_group_id = aws_security_group.nessus_scanner.id
- type = "ingress"
- from_port = -1
- to_port = -1
- protocol = "all"
- description = "Inbound Scanning of Ourselves"
- }
- #-----------------------------------------------------------------
- # Egress
- #-----------------------------------------------------------------
- resource "aws_security_group_rule" "nessus_scanner_outbound_all_ports" {
- security_group_id = aws_security_group.nessus_scanner.id
- type = "egress"
- description = "Outbound to All Ports"
- cidr_blocks = ["0.0.0.0/0"] # tfsec:ignore:aws-vpc-no-public-egress-sgr
- from_port = -1
- to_port = -1
- protocol = "all"
- }
|