Overview
VCN Flow Logs in Oracle Cloud Infrastructure (OCI) provide deep visibility into network traffic within your Virtual Cloud Network (VCN).
They capture details about all traffic that passes through your Virtual Network Interface Cards (VNICs) — including both accepted and rejected connections.
For DBAs and Cloud Admins, flow logs are an essential tool for troubleshooting connectivity, verifying security rules, and analyzing performance or security anomalies between OCI compute instances, databases, and external services.
What Are VCN Flow Logs?
A VCN Flow Log records network traffic flow metadata between source and destination endpoints within your OCI environment.
It helps you answer questions like:
-
Why is my database or application server not reachable?
-
Which ports or protocols are being blocked by security rules?
-
Is there any unusual outbound traffic from my subnet?
Each record represents a flow and includes:
-
Source and destination IPs
-
Ports and protocol
-
Packets sent and received
-
Action (ACCEPT or REJECT)
-
Timestamps
-
Traffic direction (Ingress/Egress)
Where Are Flow Logs Stored?
Flow logs are exported to OCI Logging service, where you can view, filter, and analyze them.
You can also configure Log Groups to automatically stream these logs to:
-
OCI Object Storage
-
OCI Logging Analytics
-
External SIEM solutions (like Splunk or Elastic)
-
OCI Service Connector Hub
This makes it easy to retain, search, and visualize flow data for audit or compliance purposes.
How to Enable VCN Flow Logs
You can enable flow logs either per subnet or per VNIC.
✅ Steps to Enable Flow Logs via OCI Console
-
Login to OCI Console
-
Navigate to Networking → Virtual Cloud Networks.
-
-
Select your target VCN.
-
Click on the Subnet or VNIC for which you want to enable flow logs.
-
Under the Resources section, select Flow Logs.
-
Click Enable Flow Logs.
-
Choose the Log Group and Log Name (create new if required).
-
Click Create Flow Log Configuration.
After a few minutes, logs will start appearing in the chosen Log Group.
Understanding Flow Log Record Fields
Each log entry contains several fields that describe the flow. Example log snippet:
πΉ Action – Shows whether the packet was accepted or rejected based on network security rules.
πΉ Direction – Indicates if it’s inbound (INGRESS) or outbound (EGRESS) traffic.
πΉ Protocol – Uses the IANA protocol number (e.g., 6 = TCP, 17 = UDP).
πΉ Source/Destination Ports – Helps confirm if database/application ports are reachable.
Practical Use Cases for DBAs and Cloud Engineers
-
Database Connectivity Troubleshooting
Check if TCP port 1521 (Oracle Listener) or 5432 (PostgreSQL) is reachable between app and DB subnets. -
Network Security Validation
Confirm that security lists or NSGs are not blocking legitimate database connections. -
Audit and Compliance
Maintain traffic logs to meet data protection or security audit requirements. -
Performance Diagnostics
Identify latency or packet drops due to rejected or delayed flows.
Pro Tip: Query Flow Logs in Logging Analytics
Use OCI Logging Analytics for advanced searching:
This helps pinpoint which ports are most frequently blocked — useful for tuning your network security rules.
Important Notes
-
Flow logs record metadata, not packet payloads — so they are secure and lightweight.
-
Flow logs do not capture traffic to/from OCI-managed services (like Object Storage endpoints).
-
It can take up to 10 minutes for new flow logs to start appearing after enabling.
Best Practices
✅ Enable flow logs for critical subnets (DB, App, and Bastion).
✅ Use short retention (e.g., 30 days) to save cost if not required for audit.
✅ Automate log archival to Object Storage for long-term retention.
✅ Regularly review “REJECT” entries to identify misconfigured security rules.