Add Security Group settings
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Sat, 24 Jan 2026 16:16:21 +0000 (13:16 -0300)
committerCássio Gabriel <cassiogabrielcontato@gmail.com>
Sat, 24 Jan 2026 20:52:09 +0000 (17:52 -0300)
assessment/terraform/main.tf

index 16ad0ea05b2772f91d924bb78604edf5fac86c7a..611645180e761b85e1bb56fafe91857ca6042f14 100644 (file)
@@ -102,3 +102,25 @@ resource "aws_route_table_association" "private" {
   route_table_id = aws_route_table.private.id
 }
 
+# -------------------------------------------------------
+
+# Security group for the Wahzuh instance
+resource "aws_security_group" "wazuh_ec2" {
+  name        = "wazuh-ec2-sg"
+  description = "Minimal access security group for Wazuh EC2"
+  vpc_id      = aws_vpc.this.id
+
+  tags = {
+    Name = "wazuh-ec2-sg"
+  }
+}
+
+# Inbound rules for the Wahzuh security group
+resource "aws_security_group" "egress_all" {
+  type              = "egress"
+  security_group_id = aws_security_group.wazuh_ec2.id
+  from_port         = 0
+  to_port           = 0
+  protocol          = "-1" # All protocols
+  cidr_blocks       = ["0.0.0.0/0"]
+}