API resource reference for SecurityPolicy, an Envoy Gateway extension resource. To create or change one, see Changing resources; to inspect, see Reading resources.
Identity
Overview
ASecurityPolicy applies security controls to a Gateway or to a route served by it. It is an Envoy Gateway extension to the Gateway API standard, defined by the Envoy Gateway API, attached to a target resource through a policy reference rather than being embedded in the Gateway itself.
Use it when you want to enforce authentication, authorization, or browser access rules on traffic entering your Project — for example requiring JWT or OIDC login, checking API keys or HTTP Basic credentials, delegating to an external authorization service, or configuring Cross-Origin Resource Sharing (CORS). A single policy attaches to one or more Gateways (or specific listeners/routes) and must live in the same Project as the resources it targets.
Spec fields
Each of the security features below is optional; set the ones you want to enforce.targetRefs selects what the policy applies to.