Join our Newsletter — 33% off our NHI Course
Home› Guides› AWS IAM Global Condition Keys Reference: Principal, Network,…
Guide Cloud & Workload Identity

AWS IAM Global Condition Keys Reference: Principal, Network, Resource and Request Keys Explained

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 13 min read
On this page

Most AWS IAM policy mistakes that survive review are condition mistakes: a key that is absent for the request you care about, a set operator on the wrong kind of key, or a network condition that silently stops matching when traffic moves to a VPC endpoint. This reference explains the AWS global condition context keys (the aws: prefixed keys available across services) grouped the way AWS groups them: principal, role session, network, resource and request properties. For each group it shows what the key carries, when it is present, and the safe pattern for using it in identity policies, resource policies, service control policies (SCPs) and resource control policies (RCPs). It is written for AWS IAM and platform engineers who already write policies; for policy types and evaluation basics see the AWS IAM Policies and Roles Guide.

This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.

Key takeaways

  • Presence is the first question. Many global keys only exist for some requests (for example aws:SourceVpce only through a VPC endpoint, aws:MultiFactorAuthPresent only with temporary credentials), and a missing key changes how every operator behaves.
  • Network keys depend on the path. aws:SourceIp is not available when a request arrives through a VPC endpoint, so pair private traffic controls on aws:SourceVpce, aws:SourceVpc or aws:VpcSourceIp instead.
  • Service principals need confused deputy keys. Any resource policy that trusts a service principal should be scoped with aws:SourceArn, aws:SourceAccount, aws:SourceOrgID or aws:SourceOrgPaths.
  • Set operators are only for multivalued keys. Use ForAnyValue and ForAllValues with keys such as aws:TagKeys and aws:PrincipalOrgPaths, add a Null check with ForAllValues, and never use them on single-valued keys.
  • The list keeps growing. AWS adds keys regularly (recent additions include aws:ViaAWSMCPService and aws:CalledViaAWSMCP for AWS MCP servers), so re-check the reference before you design a new guardrail.

How condition keys work

A Condition block compares values in the request context against values in your policy using a condition operator. Global keys are populated by AWS for the request; service-specific keys (such as s3:prefix or ec2:InstanceType) are populated by the service. Four evaluation rules decide almost every outcome.

RuleBehaviourPractical consequence
Several operators or several keys in one blockAND: all must be trueEach extra key narrows the statement
Several values for one keyOR: any value may matchList approved VPC endpoints or accounts in one array
Several values under a negated operator (StringNotEquals, ArnNotLike)NOR: true only if none matchThe usual pattern for "deny unless from one of these"
Key absent from the requestMost operators evaluate to false; negated operators evaluate to trueAn absent key can make a Deny with a negated operator fire, or an Allow never match

Two modifiers handle absence explicitly. IfExists (for example StringNotEqualsIfExists) evaluates the key normally when present and treats the condition as true when absent. Null tests presence itself: "Null": {"aws:TokenIssueTime": "false"} requires the key to exist (in this case, temporary credentials). Use string operators for strings and ARN operators (ArnEquals, ArnLike) for ARN keys; StringEquals and StringLike are case sensitive, and only StringLike, StringNotLike and the ARN operators accept the * and ? wildcards.

Single-valued and multivalued keys

Whether a key is multivalued depends on the request, not on how many values your policy lists. aws:TagKeys is multivalued because one request can carry several tag keys; aws:ResourceTag/tag-key is single-valued because each tag key holds one value. Multivalued keys need a set operator:

  • ForAnyValue: true if at least one request value matches a policy value; false if the key is absent.
  • ForAllValues: true if every request value matches a policy value, and also true when the key is absent or empty. AWS warns that this can be overly permissive with Allow, and advises always adding "Null": {"key": "false"}.
  • Single-valued keys: AWS states plainly not to use ForAllValues or ForAnyValue with them, because it can produce overly permissive policies.

Principal keys

Principal keys describe who signed the request. They are the backbone of identity perimeters, attribute-based access control (ABAC) and trust policy hardening.

KeyTypePresent whenTypical use
aws:PrincipalArnARN, singleAll signed requestsExempt a break-glass or pipeline role from a Deny; use ArnLike
aws:PrincipalAccountString, singleAll requests (value anonymous for unsigned)Restrict a resource policy to named accounts
aws:PrincipalOrgIDString, singlePrincipal's account is in an organizationIdentity perimeter: only principals from your organization
aws:PrincipalOrgPathsString, multivaluedPrincipal's account is in an organizationScope to an OU path with ForAnyValue:StringLike
aws:PrincipalTag/tag-keyString, singlePrincipal or session has that tagABAC, for example match ${aws:PrincipalTag/team} to a resource tag
aws:PrincipalIsAWSServiceBool, singleAll signed requestsExclude direct service principal calls from network and perimeter Deny statements
aws:PrincipalServiceName / aws:PrincipalServiceNamesListString single / multivaluedDirect service principal calls onlyAllow or deny a specific service principal
aws:PrincipalType, aws:userid, aws:usernameString, singleaws:username only for IAM usersPer-user resource paths; prefer roles and tags for workloads

Role session keys sit alongside these and exist only for temporary or federated credentials: aws:MultiFactorAuthPresent, aws:MultiFactorAuthAge, aws:TokenIssueTime, aws:SourceIdentity (set once at AssumeRole and carried through role chaining), aws:FederatedProvider, and aws:Ec2InstanceSourceVpc with aws:Ec2InstanceSourcePrivateIPv4 for instance role credentials. These last two are a useful machine identity control: they let you deny use of an EC2 role's credentials from outside the VPC the instance runs in. For the wider role model see the AWS STS and AssumeRole Guide.

MFA caveat: aws:MultiFactorAuthPresent is not present for requests signed with long-term access keys or for federated identities. AWS's recommended Deny uses "BoolIfExists": {"aws:MultiFactorAuthPresent": "false"}, which blocks non-MFA sessions and access key calls; a plain Bool false check is not reliable.

Network keys

Network keys describe where the request came from. The single most important fact: aws:SourceIp is not available when the request comes through a VPC endpoint, and it only applies to public IP ranges. A policy that allows only your office or NAT egress range by aws:SourceIp stops matching the moment a workload switches to a gateway or interface endpoint.

KeyPresent whenUse it forWatch for
aws:SourceIpRequests over the public endpointRestricting console or API use to known public egress rangesAbsent via VPC endpoints; a calling service (for example CloudFormation) presents its own IP
aws:SourceVpceRequests through a VPC endpointPinning a bucket or key to named endpoints (vpce-...)Sensitive key: AWS states wildcards have no valid use case
aws:SourceVpc / aws:SourceVpcArnRequests through a VPC endpointAllowing any endpoint in a given VPCAWS recommends aws:SourceVpcArn where the service supports it
aws:VpcSourceIpRequests through a VPC endpointPrivate IP ranges (IPv4 and IPv6)Always pair with a VPC or endpoint key, because private CIDRs overlap across VPCs
aws:VpceAccount, aws:VpceOrgID, aws:VpceOrgPathsThrough an endpoint owned by your account or organization, for listed services"Any endpoint we own" without listing endpoint IDsLimited service support; aws:VpceOrgPaths is multivalued

aws:SourceVpce or aws:SourceIp

  • Private workloads in a VPC: use aws:SourceVpce (strictest), aws:SourceVpcArn/aws:SourceVpc, or aws:VpceOrgID when you run many endpoints.
  • People and on-premises systems on the internet path: use aws:SourceIp with your public egress ranges.
  • Both paths in use: write the Deny so the request must satisfy one or the other, using IfExists variants, and test both paths.
  • Calls AWS makes for you: forward access sessions (FAS), where a service such as CloudFormation or Athena calls another service with your credentials, do not preserve the original VPC or IP. AWS's pattern adds "Bool": {"aws:ViaAWSService": "false"} so those calls are exempt, and "BoolIfExists": {"aws:PrincipalIsAWSService": "false"} so direct service principal calls are not blocked by redacted network context.

Network keys are the network leg of a data perimeter; see the AWS Resource Control Policies and Data Perimeter Guide and VPC Endpoints vs NAT Gateways.

Resource keys

KeyTypeUseNotes
aws:ResourceAccountString, singleDeny access to resources outside named accountsUse in Deny statements; not supported for some actions (all Amazon EBS actions and selected EC2, Route 53, EventBridge and other actions)
aws:ResourceOrgIDString, singleResource perimeter in SCPs and VPC endpoint policies: only resources in your organizationCan be compared with ${aws:PrincipalOrgID}; same unsupported action list
aws:ResourceOrgPathsString, multivaluedResources in specific OUsForAnyValue:StringLike for OU wildcards
aws:ResourceTag/tag-keyString, singleABAC on existing resourcesOnly for services with tag-based authorisation; tag keys are case-insensitive, values case-sensitive

Resource perimeters stop data being copied to an attacker-owned bucket by a valid principal, a pattern that identity controls alone miss. Because several actions do not populate aws:ResourceAccount and aws:ResourceOrgID, AWS uses aws:CalledVia and aws:ViaAWSService for controlled exceptions; test the SCP against your real workloads before attaching it to production OUs. See the AWS Organizations and SCPs Guide.

Request keys

KeyTypeUseNotes
aws:SecureTransportBoolDeny requests not using TLS (common on S3 bucket policies)Always present
aws:RequestedRegionStringRegion guardrails in SCPsGlobal services such as IAM call us-east-1, so exempt them with NotAction; the key controls the endpoint, not cross-Region effects such as S3 replication
aws:RequestTag/tag-keyString, singleRequire tags on createOne key per tag pair
aws:TagKeysString, multivaluedAllow only approved tag keysForAllValues plus a Null false check
aws:CalledVia, aws:CalledViaFirst, aws:CalledViaLastMultivalued / singleAllow an action only when a named service makes it with the principal's credentialsAbsent for service roles and direct calls; order cannot be enforced with aws:CalledVia
aws:ViaAWSServiceBoolExempt FAS calls from network rulesAlways present
aws:CurrentTime, aws:EpochTimeDateTime-boxed access, expiry of temporary grantsISO 8601 or epoch values
aws:ViaAWSMCPService, aws:CalledViaAWSMCPBool / StringRestrict what AWS MCP servers do on a principal's behalf, for example deny s3:DeleteBucket via MCPNewer keys: confirm service support
aws:referer, aws:UserAgentStringContent hot-link protection, client hintsClient-supplied and spoofable: AWS warns not to use them as security controls

Confused deputy keys

When a resource policy trusts a service principal (for example cloudtrail.amazonaws.com on a log bucket) with no condition, the service is authorised for any configuration, including one set up in another customer's account. AWS's guidance is to add one of these keys wherever a service principal is granted access:

  • aws:SourceArn: the specific resource the service acts for (a trail, a topic, a fleet). Use ARN operators.
  • aws:SourceAccount: the account the service acts for, when the resource ARN is not known in advance.
  • aws:SourceOrgID / aws:SourceOrgPaths: any resource in your organization or OU; aws:SourceOrgPaths is multivalued.

These keys are only present for service principal calls, so central RCPs pair them with "Null": {"aws:SourceAccount": "false"} and aws:PrincipalIsAWSService so ordinary calls are unaffected. The cross-account form of the problem, a third party assuming a role for many customers, is solved with sts:ExternalId in the role trust policy rather than a global key; see How to review AWS cross-account trust policies for confused deputy and the Confused Deputy in AI Agents Guide.

Choosing where to put the condition

GoalKeysPolicy type
Only my organization's principals reach my resourcesaws:PrincipalOrgID (with aws:PrincipalIsAWSService exception)RCP, VPC endpoint policy, resource policy
My principals only reach my organization's resourcesaws:ResourceOrgIDSCP, VPC endpoint policy
Access only from expected networksaws:SourceIp, aws:SourceVpc, aws:SourceVpceSCP, with RCP as defence in depth
Services act only for my accountsaws:SourceAccount, aws:SourceOrgIDRCP or resource policy
Team-scoped access without per-team policiesaws:PrincipalTag, aws:ResourceTag, aws:RequestTag, aws:TagKeysIdentity policy, permissions boundary

Small estates with one or two accounts can put conditions directly in bucket and key policies. Larger organizations should express perimeters once in SCPs and RCPs, keep resource policies for resource-specific grants, and treat exceptions (break-glass roles, deployment pipelines) as a short list of aws:PrincipalArn values that is reviewed.

Testing and monitoring

  1. Model first: write the condition, then run representative requests through the IAM policy simulator, including requests via a VPC endpoint, via a service using FAS, and with long-term keys.
  2. Validate: use IAM Access Analyzer policy validation and its external access findings to catch overly broad resource policies; see the IAM Access Analyzer Guide.
  3. Pilot: attach new SCPs or RCPs to a test OU first and watch CloudTrail for AccessDenied errors on expected workloads for at least one business cycle.
  4. Roll back: keep the previous policy version; detaching or reverting an SCP is the fastest recovery when a network condition blocks production.

Useful measures: the share of resource policies trusting a service principal that carry a confused deputy key (target 100 percent); the count of ForAllValues statements without a Null check (target zero); the number of approved Deny exceptions by aws:PrincipalArn; and AccessDenied events attributed to perimeter policies after each change.

Common mistakes

  • IP allow-lists that break or leak through endpoints: relying on aws:SourceIp for workloads that use VPC endpoints, where the key is absent.
  • ForAllValues without Null: an Allow on ForAllValues:StringEquals for aws:TagKeys matches a request that sends no tags at all.
  • Set operators on single-valued keys: ForAnyValue:StringEquals on aws:SourceVpce or aws:PrincipalTag produces unintended matches.
  • Unscoped service principals: bucket, topic or queue policies trusting a service principal without aws:SourceArn or aws:SourceAccount.
  • MFA checks that skip access keys: using Bool instead of BoolIfExists on aws:MultiFactorAuthPresent.
  • Trusting spoofable headers: aws:referer or aws:UserAgent used as an access control. For the wider list see Top 10 AWS IAM Mistakes.

Framework mapping

FrameworkReferenceHow condition keys support it
NIST SP 800-53 Rev. 5AC-3 Access Enforcement; AC-6 Least PrivilegeConditions narrow when an allowed action can actually be used
NIST SP 800-53 Rev. 5AC-4 Information Flow Enforcement; AC-16 Security and Privacy AttributesNetwork and resource perimeters; tag-based ABAC
NIST CSF 2.0PR.AA-05Access permissions defined in policy and enforced with least privilege
MITRE ATT&CKT1078.004 Cloud AccountsNetwork and organization conditions limit where stolen cloud credentials work

Practitioner checklist

  • Inventory every resource policy that trusts a service principal and add aws:SourceArn or aws:SourceAccount.
  • Replace aws:SourceIp rules for VPC workloads with aws:SourceVpce, aws:SourceVpcArn or aws:VpceOrgID.
  • Add aws:ViaAWSService and aws:PrincipalIsAWSService exceptions to network Deny statements, and test FAS paths.
  • Search policies for ForAllValues without a Null false check and for set operators on single-valued keys.
  • Enforce MFA with BoolIfExists on aws:MultiFactorAuthPresent.
  • Deploy identity and resource perimeters with aws:PrincipalOrgID and aws:ResourceOrgID in RCPs and SCPs, piloted on a test OU.
  • Bind EC2 role credentials to their VPC with aws:Ec2InstanceSourceVpc where workloads allow.
  • Review the global condition keys reference each quarter for new keys, including the MCP-related keys.

Standards and references

Related NHI Mgmt Group resources: AWS IAM Policies and Roles Guide · AWS Resource Control Policies and Data Perimeter Guide · AWS IAM Permissions Boundaries Guide · Top 10 AWS IAM Mistakes

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.