Ensure that your Oracle Cloud Infrastructure (OCI) Functions applications are deployed in private subnets instead of public subnets, to minimize the attack surface and limit direct exposure to the public internet. While deploying functions in private subnets does not prevent access to the function invoke endpoints (which requires IAM policies for access control), it is a foundational network security control that supports private communication with other OCI resources such as databases, storage, and compute instances within your Virtual Cloud Network (VCN). Private subnets require a service gateway in the VCN to enable functions to access Oracle services (such as Oracle Cloud Infrastructure Registry) without internet exposure.
Deploying Oracle Cloud Infrastructure (OCI) Functions applications in private subnets provides several security benefits by reducing the attack surface and enforcing network segmentation. Private subnet deployment ensures that functions communicate with other cloud resources over Oracle's private network fabric rather than traversing the public internet, which reduces the risk of data interception and unauthorized access. When combined with service gateways, functions in private subnets can securely access Oracle services such as Object Storage and Container Registry without requiring internet gateways or NAT gateways, maintaining a fully private network architecture. This approach aligns with defense-in-depth security practices and helps organizations meet compliance requirements that mandate restricted network access for sensitive workloads.
Note that deploying a Functions application in a private subnet does not automatically prevent internet-based access to the function invoke endpoints. Access control to invoke endpoints must be implemented through IAM policies that restrict which users and services can invoke functions.
Audit
To determine if your OCI Functions applications are deployed in private subnets, perform the following operations:
Remediation / Resolution
To migrate your existing Oracle Cloud Infrastructure (OCI) Functions applications to private subnets, you must update the subnet configuration for each application by performing the following operations:
Important considerations before migrating to private subnets:- Ensure that a service gateway exists in your VCN and is properly configured to allow access to Oracle Services Network. The service gateway enables functions in private subnets to access services such as Oracle Cloud Infrastructure Registry and Object Storage without requiring internet access.
- Verify that your VCN route tables include a route rule that directs traffic destined for Oracle services to the service gateway.
- Update security lists to allow egress traffic to Oracle Services Network (use the service CIDR label for your region).
- If your functions need to access resources on the internet (such as third-party APIs), you will need to configure a NAT gateway in the VCN and update route tables accordingly.
- Changing the subnet configuration may cause a brief interruption in function execution during the update.
References
- Oracle Cloud Infrastructure Documentation
- OCI Functions Support for Private Network Access
- Controlling Access
- Access to Oracle Services: Service Gateway
- Creating Applications
- Overview of VCNs and Subnets
- Creating the VCN and Subnets to Use with OCI Functions, if they don't exist already
- Oracle Cloud Infrastructure CLI Documentation
- compartment list
- application list
- application get
- application update
- subnet get
- subnet list