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"]
+}