Apigee sits in front of your APIs and issues, checks and counts the credentials every client app presents, so its policies, IAM roles and network exposure decide whether a stolen key or a malformed request ever reaches a backend. This guide covers how to harden Apigee on Google Cloud: how app credentials, API products and OAuth tokens work, which Google Cloud IAM roles to grant, how to treat developer apps and proxy service accounts as non-human identities, what to log, the policy baseline every proxy should carry and how Advanced API Security fits. It is written for API platform owners, cloud security engineers and identity teams. For API security as a discipline, see the API Security Guide; this page stays with Apigee's own controls.
This is an independent guide from NHI Mgmt Group, based on Google Cloud's public Apigee documentation and Google's Apigee samples repository as of November 2026. It is not sponsored or reviewed by Google. Product features change, so confirm settings against Google Cloud's current Apigee documentation.
Key takeaways
- The API product is your authorisation boundary. Developer apps receive a client ID and secret tied to one or more API products, and verifying a credential can check whether a given verb and path is allowed by the product's Operations.
- Every proxy needs an authentication policy. Use VerifyAPIKey for identification only, OAuthV2 VerifyAccessToken with scopes for authorisation, and VerifyJWT for tokens issued by your own identity provider.
- Short tokens are a setting, not a default you inherit. The OAuthV2 GenerateAccessToken operation takes an ExpiresIn value in milliseconds; set it deliberately per product.
- Put threat protection and traffic limits in a shared flow. JSONThreatProtection, RegularExpressionProtection, SpikeArrest and Quota applied through one shared flow give every proxy the same floor.
- Advanced API Security watches the whole estate. Risk assessment scores proxies against security profiles, abuse detection raises incidents, and security actions can flag, deny or allow matching traffic once the add-on is enabled.
How identity and access work in Apigee
Apigee has two identity planes, and both need governance.
- Management plane: people and automation that create proxies, products, apps and environments. These are Google Cloud principals (users, groups and service accounts) authorised by IAM roles on the project that hosts the Apigee organisation.
- Runtime plane: client applications calling your APIs. Apigee represents them as developers, developer apps (and AppGroups for team-owned apps) and the credentials attached to those apps. Each credential is linked to API products, which bundle proxies, allowed Operations (verb and path), quotas and OAuth scopes.
Google's API Product Operations sample shows the core runtime check: when a proxy verifies a credential, Apigee can confirm whether the specific verb and path combination is permitted for the calling app under the products it holds. That makes the API product the unit to review, not the proxy. Separate products for read and write operations, and for internal and partner audiences, let you grant less.
| Client pattern | Apigee policy | What it proves | Use when |
|---|---|---|---|
| API key (client ID) | VerifyAPIKey | Which registered app is calling | Low-risk read APIs, usage metering, as a first gate in front of stronger checks |
| OAuth 2.0 client credentials | OAuthV2 GenerateAccessToken, then VerifyAccessToken with Scope | App holds the secret and was granted these scopes | Service-to-service calls where the app is the resource owner |
| JWT access token from your IdP | VerifyJWT (signature, issuer, audience, subject, TimeAllowance) | Token issued by a trusted authorisation server for this audience | You already run an OIDC provider and want Apigee to enforce its tokens |
| Mutual TLS at the load balancer | Load balancer Server TLS Policy, proxy conditions on forwarded TLS headers | Client holds a certificate from your trusted CA | Partner and B2B APIs, high-value internal APIs |
Google's OAuth sample generates a client credentials token with <Operation>GenerateAccessToken</Operation>, <ExpiresIn>180000</ExpiresIn> (three minutes, in milliseconds) and <RFCCompliantRequestResponse>true</RFCCompliantRequestResponse>, then enforces <Scope>read write</Scope> on VerifyAccessToken for each resource. The IdP access token sample validates RFC 9068 JWT access tokens in a shared flow and maps the token's client to an Apigee app, so quotas and analytics still work per app. See the API Keys vs OAuth Tokens Guide.
Admin roles and privileged access
Management access to Apigee is Google Cloud IAM. Google's own samples ask for roles/apigee.apiAdminV2 to deploy proxies, alongside general IAM roles such as roles/iam.serviceAccountCreator when a sample creates a service account. Google Cloud publishes a set of predefined Apigee roles on its Apigee roles page. Check the current role IDs and their permissions there before you build your role map, since role names have changed over time.
- Separate who builds from who deploys to production: API developers need to create and deploy revisions in development environments; production deployment should run through a pipeline identity, not personal accounts.
- Restrict organisation admin: the broadest Apigee admin role should be the rarest grant. Give it to a small platform group, through Google groups, with no standing personal grants (our recommendation).
- Treat app and developer administration as credential issuance: anyone who can create a developer app and attach a product can mint working credentials for that product. Limit it to an onboarding team or the developer portal workflow.
- Use the narrowest viewing roles for support: operations staff who investigate traffic rarely need write access.
- Apply IAM Conditions where environments differ: Google documents adding IAM Conditions to Apigee policies, which lets you scope access by resource such as environment.
See the Google Cloud IAM and Service Accounts Guide.
Integrations, API tokens and service accounts
Apigee creates and consumes several kinds of non-human identity. Each one should have an owner, a scope and an expiry.
| Identity | Where it lives | Customer-side control |
|---|---|---|
| Developer app client ID and secret | Apigee app credentials | Attach the narrowest product; set a credential expiry; rotate by adding a new credential and revoking the old one after cut-over |
| OAuth access tokens issued by Apigee | Apigee token store | Short ExpiresIn per product; scopes enforced on every VerifyAccessToken |
| Proxy service account (Google Authentication) | Google Cloud IAM, attached at deployment | One service account per proxy or proxy family; only the roles the target needs; no downloaded keys |
| Secrets the proxy uses (backend keys, signing keys) | Encrypted key value maps | Read with KeyValueMapOperations at runtime; never hard-code in policy XML or the bundle |
| CI/CD deployment identity | Google Cloud service account | Workload identity federation from your pipeline; deployment role only in target environments |
- Google Authentication for backends: Google's Cloud Logging sample configures the proxy to call Google APIs using the identity of a service account attached at deployment. This removes long-lived keys from the proxy entirely; use it for any Google Cloud target.
- Encrypted key value maps: the JWT sample stores its key pair in an encrypted KVM named
jwt-keysand reads it with KeyValueMapOperations. Keep signing keys and backend secrets there, scoped to the environment. - Credential lifecycle: as our recommendation, give partner app credentials an expiry of 12 months or less, rotate on staff or partner change, and revoke credentials for apps with no traffic in 90 days. See the API Key Management Guide.
- Developer portal sign-up: if self-service is on, require approval for products that reach sensitive data so registration does not equal access.
See the Service Account Security Guide.
Logging and detection
Apigee collects API metrics through Apigee Analytics by default. For per-call security logging, Google's Cloud Logging sample uses the MessageLogging policy in the PostClientFlow, so the log write happens after the response is sent and adds no client latency, and recommends putting the policy in a shared flow for consistency. Management changes are recorded in Cloud Audit Logs for the project, and Shadow API Discovery has its own audit logging. See the Google Cloud Audit Logs and Log Sinks Guide.
| Signal | Source | What to alert on |
|---|---|---|
| IAM change on the Apigee project | Cloud Audit Logs (Admin Activity) | New grants of organisation or API admin roles, grants to personal accounts |
| Proxy deployment | Cloud Audit Logs | Production deployments not made by the pipeline identity |
| New app or credential | Cloud Audit Logs, Apigee management API | Credentials added to sensitive products outside the onboarding workflow |
| Authentication failures | MessageLogging to Cloud Logging | Spikes in invalid key or token errors per client IP or app |
| Abuse incidents | Advanced API Security abuse detection | New incidents from anomaly detection or API scraping rules |
| Risk score drop | Advanced API Security risk assessment | Proxies that fall below your security profile score after a deployment |
Advanced API Security
Advanced API Security is an add-on for Apigee and Apigee hybrid. Its documented components are risk assessment (security scores against built-in or custom security profiles), abuse detection (incidents from detection rules, with drill-down by IP address and API key), security actions, security reports and security alerts, with Shadow API Discovery in API Observation. Google's release notes record that risk assessment v2 became generally available on 17 December 2025 and that monitoring conditions in v2 became generally available on 10 March 2026, and that security actions can combine two condition types, such as IP addresses and ASN numbers, through the API from February 2026. Security actions flag, deny or allow traffic that matches conditions such as detection rule, region or app credential; suspicious traffic is not blocked until you configure an action.
Metrics that show the platform is holding (our suggested set):
- Percentage of production proxies carrying the security shared flow (target 100%).
- Median risk assessment score across production proxies, tracked per release.
- App credentials past expiry or with no traffic in 90 days (target zero).
- Production deployments made by the pipeline identity (target 100%).
- Mean time from abuse incident to a security action or closure.
Hardening baseline
| Area | Policy or setting | Baseline |
|---|---|---|
| Authentication | VerifyAPIKey, OAuthV2 VerifyAccessToken or VerifyJWT | On every proxy's PreFlow; no unauthenticated proxy without a documented exception |
| Authorisation | API product Operations, OAuth scopes | Verb and path allowed per product; scope checked per resource |
| Payload limits | JSONThreatProtection (for example ObjectEntryCount, depth and length limits) | On every JSON API; limits sized to the schema |
| Injection patterns | RegularExpressionProtection | On parameters that reach interpreters, alongside backend validation |
| Contract | OASValidation | Validate requests against the OpenAPI spec where one exists |
| Burst control | SpikeArrest (rate per second or minute, smoothed) | On every proxy, keyed by app or client identifier |
| Consumption | Quota, driven by API product settings | Per app tier; protects business limits |
| Northbound exposure | External load balancer with Private Service Connect; Google Cloud Armor | Only intended environment groups reachable from the internet |
| Client certificates | Load balancer mTLS, strict mode | For partner APIs; lenient mode only with proxy checks and RaiseFault |
| Secrets | Encrypted KVM, KeyValueMapOperations | No secrets in proxy bundles or source control |
| AI traffic | SanitizeUserPrompt and SanitizeModelResponse with Model Armor | For proxies fronting LLMs |
- Network: Google's samples note that Apigee X instances are not exposed to the internet by default; exposure is added through an external HTTP(S) load balancer and a Private Service Connect network endpoint group. Put Google Cloud Armor on that load balancer. See the Google Cloud Armor guide.
- mTLS: strict enforcement rejects invalid connections at the load balancer; lenient enforcement passes them to the proxy, which must check forwarded TLS headers and reject with RaiseFault. Prefer strict. See the mTLS Guide.
- Shared flows: package authentication, threat protection, SpikeArrest and logging as a shared flow and attach it with a flow hook or FlowCallout so new proxies inherit it.
- Updates: for Apigee hybrid, apply Google's runtime updates promptly; follow Google Cloud security bulletins for the components you operate.
See the API Gateway Security Guide and the Rate Limiting and API Abuse Guide.
Common misconfigurations
- API key used as authorisation: VerifyAPIKey identifies the app but does not prove the caller holds a secret. For anything beyond low-risk reads, require an OAuth token or JWT.
- One broad API product: a single product that bundles every proxy and operation means every app credential reaches everything. Split products by audience and verb.
- Scopes issued but not checked: tokens carry scopes, yet VerifyAccessToken has no Scope element on write resources. Check scope per resource.
- Long token lifetimes copied between proxies: an ExpiresIn value chosen for testing ends up in production. Review it per product.
- Secrets in policy XML: backend credentials or signing keys written into AssignMessage or bundle files end up in source control. Move them to encrypted KVMs.
- Lenient mTLS without proxy checks: the load balancer forwards connections with missing certificates and no proxy condition rejects them.
Rolling out the baseline
- Inventory: list proxies, products, apps, credentials and IAM grants; turn on Shadow API Discovery where licensed to find APIs outside Apigee.
- Fix management access: move grants to groups, remove personal production deployment rights and set up a pipeline identity.
- Build the security shared flow: test it in a non-production environment with representative traffic, tuning threat protection limits to your schemas.
- Attach in rings: internal APIs first, then partner, then public. Roll back by detaching the flow hook or redeploying the previous revision.
- Tighten products and tokens: split broad products, add scope checks and shorten ExpiresIn.
- Enable monitoring: MessageLogging to Cloud Logging, audit log alerts, and Advanced API Security risk assessment and abuse detection; add security actions in flag mode before deny.
Framework mapping
| Apigee control | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | OWASP API Security Top 10 2023 |
|---|---|---|---|
| VerifyAccessToken, VerifyJWT, mTLS | IA-2, IA-5, IA-8 | PR.AA-01 | API2:2023 Broken Authentication |
| Product Operations, scope checks | AC-6 | PR.AA-05 | API5:2023 Broken Function Level Authorization |
| SpikeArrest, Quota | SC-5 | PR.PS-01 | API4:2023 Unrestricted Resource Consumption |
| Threat protection, OASValidation | SI-10 | PR.PS-01 | API8:2023 Security Misconfiguration |
| Shadow API Discovery, inventory | CM-8 | ID.AM-02 | API9:2023 Improper Inventory Management |
| Audit logs, MessageLogging, abuse detection | AU-2, AU-6 | DE.CM-01 | Supports detection across all |
ATT&CK techniques these controls reduce include T1190 Exploit Public-Facing Application and T1528 Steal Application Access Token.
Practitioner checklist
- Map every Apigee IAM grant to a group and remove personal production deployment rights.
- Require an authentication policy on every proxy and document any exception.
- Split API products by audience and verb, and check OAuth scopes per resource.
- Set OAuthV2 ExpiresIn deliberately per product and keep access tokens short.
- Move backend secrets and signing keys into encrypted KVMs and use Google Authentication for Google Cloud targets.
- Attach a shared flow with threat protection, SpikeArrest, Quota and MessageLogging to all proxies.
- Expose only intended environment groups through the load balancer, with Cloud Armor and strict mTLS for partner APIs.
- Give app credentials an expiry and revoke unused ones every quarter.
- Enable Advanced API Security risk assessment and abuse detection, and start security actions in flag mode.
- Alert on IAM changes, out-of-pipeline deployments and new credentials on sensitive products.
Standards and references
- Google Cloud: Apigee Advanced API Security documentation
- Google Cloud: Apigee Advanced API Security release notes
- Google Cloud (GitHub): Apigee sample, client credentials with OAuth scopes
- Google Cloud (GitHub): Apigee sample, API product operations
- Google Cloud (GitHub): Apigee sample, threat protection
- Google Cloud (GitHub): Apigee sample, mutual TLS northbound
- Google Cloud (GitHub): Apigee sample, Cloud Logging
- OWASP: API Security Top 10 2023
Related NHI Mgmt Group resources: API Security Guide · API Gateway Security Guide · API Key Management Guide · Google Cloud IAM and Service Accounts Guide