Ensure that your Oracle Cloud Infrastructure (OCI) IAM policies controlling access to Functions applications include network source conditions to restrict function invocation and management operations to specific IP addresses or network sources. Network sources are sets of defined IP addresses (public IP ranges or VCN subnet IP ranges) that can be used in IAM policy conditions to enforce network-based access controls. By configuring IAM policies with network source conditions (such as where request.networkSource.name='corpnet'), you can ensure that function invocation and management operations are only allowed from approved IP address ranges defined in the network source. This prevents unauthorized function execution from arbitrary internet locations and reduces the risk of credential theft, unauthorized access, and lateral movement attacks. Network source restrictions should be applied to policies granting use fn-invocation, manage fn-function, and manage fn-app permissions to ensure that both invocation and management operations are subject to network-based access controls.
Restricting Oracle Cloud Infrastructure (OCI) Functions access by network source provides a critical additional layer of defense-in-depth security by ensuring that function invocation and management operations can only be performed from trusted network locations. Even if user credentials are compromised, network source restrictions prevent attackers from invoking or managing functions from unauthorized networks, significantly reducing the risk of credential-based attacks and lateral movement. This is particularly important for serverless functions that may process sensitive data, trigger business-critical workflows, or have access to backend resources such as databases and object storage. Network source restrictions enforce the principle that access to cloud resources should be limited not only by identity (who you are) but also by network location (where you are). By defining approved IP address ranges in network sources and referencing them in IAM policy conditions, organizations can ensure that function access is only permitted from corporate networks, VPN connections, or approved cloud environments, while blocking access attempts from public internet locations or unauthorized networks. This approach aligns with zero trust security principles, supports compliance requirements for network segmentation and access control, and provides clear audit trails showing the network origin of function access requests.
Audit
To determine if your OCI Functions access policies include network source restrictions, perform the following operations:
Remediation / Resolution
To implement network source restrictions for your Oracle Cloud Infrastructure (OCI) Functions access policies, you must create network sources defining approved IP address ranges and update your IAM policies to include network source conditions by performing the following operations:
Important considerations before implementing network source restrictions:- Create network sources first: Before updating IAM policies, you must create network sources that define the approved IP address ranges from which function access should be allowed. Network sources can include public IP addresses (e.g., corporate office IP ranges) or VCN subnet IP ranges.
- Identify approved IP ranges: Work with your network team to identify all legitimate IP address ranges that should be permitted to access OCI Functions. This includes corporate office networks, VPN endpoints, bastion hosts, approved cloud environments, and CI/CD pipeline IP addresses.
- Test in non-production first: Network source restrictions can immediately block access from unauthorized networks. Test the network source definitions and policy changes in a development or test compartment before applying to production environments.
- Plan for remote access scenarios: Ensure that VPN or other remote access solutions are in place for users who need to access functions from outside the corporate network.
- Document approved IP ranges: Maintain clear documentation of which IP ranges are included in each network source and the business justification for each range.
- Coordinate with users: Notify affected users before implementing network source restrictions, as this will prevent function access from unauthorized networks (including home networks or public Wi-Fi).
- Monitor for access denials: After implementing network source restrictions, monitor audit logs for access denials that might indicate legitimate users attempting access from unapproved networks.
- Network sources are tenancy-wide: Network sources can only be created in the tenancy's home region but are available for use in policies across all compartments.
References
- Oracle Cloud Infrastructure Documentation
- Controlling Access to Invoke and Manage Functions
- Managing Network Sources
- Controlling Access
- Getting Started with Policies
- Details for IAM without Identity Domains
- Policy Syntax
- Oracle Cloud Infrastructure CLI Documentation
- compartment list
- network-sources list
- network-sources create
- policy list
- policy get
- policy update