From 32ea963243b2566531b0a1dd0122fbf23a7eca0b Mon Sep 17 00:00:00 2001 From: Guilherme Silva Date: Tue, 1 Sep 2026 18:45:27 -0300 Subject: [PATCH] Minor Improvemnts --- fss_server.tf | 1 + nsg-sei-fss.tf | 65 ++++++++++++++++++++++++++++++++++++++++++ nsg-sei-servers-nsg.tf | 60 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100755 nsg-sei-fss.tf diff --git a/fss_server.tf b/fss_server.tf index 24e8151..0f167aa 100644 --- a/fss_server.tf +++ b/fss_server.tf @@ -12,6 +12,7 @@ resource "oci_file_storage_mount_target" "mount-target-sei" { display_name = "mount-target-sei-${var.environment}" requested_throughput = "1" hostname_label = "sei-fss-${var.environment}" + nsg_ids = [ oci_core_network_security_group.fss-servers-nsg.id ] } resource "oci_file_storage_export_set" "dados" { diff --git a/nsg-sei-fss.tf b/nsg-sei-fss.tf new file mode 100755 index 0000000..4ff32b4 --- /dev/null +++ b/nsg-sei-fss.tf @@ -0,0 +1,65 @@ +resource "oci_core_network_security_group" "fss-servers-nsg" { + compartment_id = var.ocid_compartment_networking + display_name = "fss-nsg" + vcn_id = var.ocid_vcn_3_tier +} +#-------------------------------------------------------------------------------------------------------------------------------------------- +resource "oci_core_network_security_group_security_rule" "sei_servers_security_ingress_rule_01" { + network_security_group_id = oci_core_network_security_group.fss-servers-nsg.id + description = "Ingress fss from app-vcn." + source = var.cidr_subnet_app + source_type = "CIDR_BLOCK" + direction = "INGRESS" + protocol = "6" + tcp_options { + destination_port_range { + max = 111 + min = 111 + } + } +} + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_ingress_rule_02" { + network_security_group_id = oci_core_network_security_group.fss-servers-nsg.id + description = "Ingress fss from app-vcn." + source = var.cidr_subnet_app + source_type = "CIDR_BLOCK" + direction = "INGRESS" + protocol = "6" + tcp_options { + destination_port_range { + max = 2050 + min = 2048 + } + } +} + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_ingress_rule_03" { + network_security_group_id = oci_core_network_security_group.fss-servers-nsg.id + description = "Ingress fss from app-vcn." + source = var.cidr_subnet_app + source_type = "CIDR_BLOCK" + direction = "INGRESS" + protocol = "17" + udp_options { + destination_port_range { + max = 111 + min = 111 + } + } +} + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_ingress_rule_04" { + network_security_group_id = oci_core_network_security_group.fss-servers-nsg.id + description = "Ingress fss from app-vcn." + source = var.cidr_subnet_app + source_type = "CIDR_BLOCK" + direction = "INGRESS" + protocol = "17" + udp_options { + destination_port_range { + max = 2048 + min = 2050 + } + } +} \ No newline at end of file diff --git a/nsg-sei-servers-nsg.tf b/nsg-sei-servers-nsg.tf index 453bc11..51ccbd7 100755 --- a/nsg-sei-servers-nsg.tf +++ b/nsg-sei-servers-nsg.tf @@ -154,4 +154,64 @@ resource "oci_core_network_security_group_security_rule" "sei_servers_security_e } } } + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_egress_rule_08" { + network_security_group_id = oci_core_network_security_group.sei-servers-nsg.id + description = "Egress FSS to sn-app" + destination = var.cidr_subnet_app + destination_type = "CIDR_BLOCK" + direction = "EGRESS" + protocol = "6" + tcp_options { + destination_port_range { + max = 111 + min = 111 + } + } +} + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_egress_rule_09" { + network_security_group_id = oci_core_network_security_group.sei-servers-nsg.id + description = "Egress FSS to sn-app" + destination = var.cidr_subnet_app + destination_type = "CIDR_BLOCK" + direction = "EGRESS" + protocol = "6" + tcp_options { + destination_port_range { + max = 2050 + min = 2048 + } + } +} + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_egress_rule_10" { + network_security_group_id = oci_core_network_security_group.sei-servers-nsg.id + description = "Egress FSS to sn-app" + destination = var.cidr_subnet_app + destination_type = "CIDR_BLOCK" + direction = "EGRESS" + protocol = "17" + udp_options { + destination_port_range { + max = 111 + min = 111 + } + } +} + +resource "oci_core_network_security_group_security_rule" "sei_servers_security_egress_rule_11" { + network_security_group_id = oci_core_network_security_group.sei-servers-nsg.id + description = "Egress FSS to sn-app" + destination = var.cidr_subnet_app + destination_type = "CIDR_BLOCK" + direction = "EGRESS" + protocol = "17" + udp_options { + destination_port_range { + max = 2050 + min = 2048 + } + } +} #-------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file