Back to Blog
Securing Your OCI Network: Practical Best Practices for Every Deployment

Securing Your OCI Network: Practical Best Practices for Every Deployment

   Mariusz Antonik    Networking    3 min read    470 views

1. Introduction

In this guide, I’ll show you how to secure your Oracle Cloud network with the same approach I use in production customer environments. OCI offers enterprise-grade networking features—if configured properly.

Security starts with the network. And in OCI, that means controlling access with VCNs, subnets, security lists, NSGs, IAM, gateways, and monitoring.


2. What Problem This Solves

Most tenants are exposed because:

  • 0.0.0.0/0 is allowed everywhere

  • Unnecessary public IPs

  • No segmentation between app and DB layers

  • No egress control

  • No flow logs or monitoring enabled

  • IAM policies too broad

This guide eliminates those risks.


3. Step-by-Step Guide

Step 1 — Lock Down SSH

Never allow:

 
source: 0.0.0.0/0 port: 22

Instead use:

  • your office IP

  • VPN

  • Bastion service


Step 2 — Replace Security Lists with NSGs

Network Security Groups allow instance-level control, not subnet-level.

Create NSG:

 
oci network nsg create \ --compartment-id <comp> \ --vcn-id <vcn> \ --display-name web-nsg

Add ingress rule:

 
oci network nsg rules add \ --network-security-group-id <nsg> \ --ingress-rules '[{"protocol":"6","source":"0.0.0.0/0","tcpOptions":{"destinationPortRange":{"min":443,"max":443}}}]'

Step 3 — Use Private Subnets Everywhere

Public subnet = only for:

  • Load balancers

  • Bastion host (if not using OCI Bastion)

App and DB should ALWAYS be private.


Step 4 — Enable VCN Flow Logs

 
oci logging log create \ --display-name vcn-flow \ --log-group-id <group> \ --source-service "flowlogs"

Use for:

  • blocked traffic troubleshooting

  • security audits


Step 5 — Configure IAM the Right Way

Never assign Administrators group to developers.

Follow least privilege:

  • network admins → manage virtual-network-family

  • db admins → manage database-family

  • devs → manage instance-family

Example policy:

 
Allow group DevOps to manage instance-family in compartment Dev

4. Architecture Diagram

 
Internet │ ┌───────────────────────┐ │ Public LB (NSG:443) │ └───────────────────────┘ │ ─────────────────┼────────────────────── Private App Subnet ┌─────────────────────────┐ │ App Servers (NSG:80) │ └─────────────────────────┘ │ ─────────────────┼────────────────────── Private DB Subnet ┌────────────────────────┐ │ MySQL / ATP (Port 3306)│ └────────────────────────┘ │ Service Gateway

5. Best Practices

  • Use NSGs per tier: web, app, db

  • Use Vault for secrets, not environment variables

  • Disable unused protocols (ICMP, UDP)

  • Use IPSec VPN or FastConnect for enterprise workloads

  • Add alarms (port scans, unusual traffic)


6. Common Errors / Troubleshooting

Problem Cause Resolution
App can't reach DB NSG blocking Add DB port in NSG
Slow traffic Wrong MTU Set MTU 1500 or test jumbo frames
Outbound internet blocked Missing NAT route Fix route table
Policy denied Wrong IAM Update group policy

7. Summary

Security is not a feature—it’s a discipline. By applying OCI’s VCN, NSG, IAM, and logging tools correctly, you build a hardened cloud environment that minimizes attack surface and maximizes reliability.

👉 Download your free guide:
7 OCI Networking Mistakes to Avoid

https://dmcloudarchitect.com/c/7_oci_mistakes_to_avoid.html

About the Author
Mariusz Antonik

Oracle Cloud Infrastructure expert and consultant specializing in database management and automation.

All Tags
#Advanced #Bash #bash monitoring #bash scripting #Beginner #Best Practices #Capacity Planning #cpu bottleneck #CPU Monitoring #cpu monitoring linux #cpu trends #cpu usage trends linux #cron jobs #database monitoring #database performance #detect slow queries mysql #disk capacity planning server #disk forecasting linux #Disk Monitoring #disk usage #disk usage script linux #disk usage trends #Early Detection #easy infrastructure monitoring #free-tier #Guide #Health Reporting #historical server monitoring #infrastructure #infrastructure health #infrastructure health dashboard #infrastructure health reporting #infrastructure monitoring #infrastructure monitoring report #infrastructure trends monitoring #lightweight monitoring #linux cpu usage #linux disk capacity planning #linux disk usage #Linux monitoring #linux monitoring tools #linux performance #linux performance monitoring #linux server #linux server monitoring #linux servers #linux tools #low maintenance monitoring #monitor cpu usage over time linux #monitor server trends #MySQL #mysql health reporting #MySQL monitoring #mysql optimization #MySQL Performance #mysql performance monitoring #mysql query performance issues #mysql server monitoring #mysql slow query analysis #mysql slow query monitoring #mysql trends #networking #OCI #oracle-cloud #Performance Degradation #performance monitoring #performance trend monitoring #plan disk growth server #practical server monitoring #predict disk usage growth #query optimization #Security #server health #server health reporting #server health weekly report #server monitoring #server trend analysis #server-trends #simple monitoring system #simple ops monitoring #slow queries #slow query reporting mysql #small business infrastructure #small business IT #small infrastructure monitoring #small server monitoring #storage capacity planning linux #storage monitoring #subnets #system health reporting #Trend Monitoring #Tutorial #vcn