Security considerations for record visibility configurations
AWS Agent Registry evaluates a record visibility configuration exactly as you write it. Whether the result protects your records depends on who can set the attributes that the configuration compares. Treat every attribute that a configuration tests as an entitlement, and control who can write it. This topic describes who controls each attribute, how to restrict those controls, and which read paths a record visibility configuration doesn’t filter.
Who controls each attribute
Each field in a record visibility configuration reads a value that someone controls. The following table lists where each value comes from, who can change it, and the control that restricts them.
| Field | Where the value comes from | Who can change it | Control |
|---|---|---|---|
|
|
The caller’s authenticated identity. For a role session, |
No caller can set these values. Anyone who can assume a role takes on that role’s identity. |
The role’s trust policy, and who can edit it with |
|
|
The caller account’s membership in AWS Organizations. |
Administrators of the organization. |
Restrict who can administer the organization. |
|
|
Tags on the caller’s AWS Identity and Access Management (IAM) role or IAM user. |
Principals with |
Restrict these actions for the entitlement tag key. |
|
|
Session tags passed to |
The principal that assumes the role, when the role’s trust policy allows |
Conditions on |
|
|
Session tags that an IAM user passes when it calls |
The IAM user, when its own identity-based policy allows |
The IAM user’s identity-based policy, which must restrict |
|
|
Session tags that the identity provider (IdP) includes in a SAML assertion or web identity token, passed through |
Administrators of the IdP, and any user who can edit the IdP attributes that map to these tags. |
The IdP’s attribute mapping, and |
|
|
The claims in a JSON Web Token (JWT) that the registry’s JWT authorizer validates. |
Administrators of the IdP, users who can edit profile attributes that become claims, and any code that customizes tokens. |
The IdP’s configuration. See Base JWT grants on claims your IdP administrators control. |
|
|
The record’s approved revision. |
Publishers propose values when they create or update a record. Approvers, or auto-approval, publish them. |
IAM permissions for the record actions, and the registry’s approval configuration. See Control who can label and approve records. |
In a shared registry, administrators of each receiving account control the tags on that account’s principals. If you trust tag values only from some accounts, test iam:accountId or iam:organizationId in the same statement as the tag.
Prevent callers from setting their own principal tags
On an IAM registry, a configuration that tests iam:principalTag/<key> reads the caller’s effective principal tags, including session tags. AWS Security Token Service (AWS STS) adds the following behavior:
-
A session tag overrides a role or user tag with the same key, and the key comparison ignores case. For example, a role has the tag
Department=finance, and its session hasdepartment=engineering. The configuration readsengineering, whether it namesiam:principalTag/departmentoriam:principalTag/DEPARTMENT. -
A caller can pass session tags only when
sts:TagSessionis allowed. ForAssumeRole, the role’s trust policy must allow it. ForGetFederationToken, the IAM user’s own policy must allow it. Withoutaws:TagKeysoraws:RequestTagconditions, a caller with that permission can choose any tag key and value. -
Session tags don’t change after AWS STS creates the session. A changed tag takes effect only in a new session.
For more information, see Pass session tags in AWS STS in the IAM User Guide. For tag-based controls on roles and users, see Controlling access to and for IAM users and roles using tags.
Use a dedicated tag key for discovery entitlements, such as registry-department. Keep it separate from cost allocation tags and other tags that many people can edit. Your configuration then tests iam:principalTag/registry-department, and you restrict who can set that key. Tag keys are case-insensitive in IAM, but StringEquals compares strings case-sensitively. In each guard on aws:TagKeys, use ForAnyValue:StringEqualsIgnoreCase. Otherwise, a caller can pass the key Registry-Department, slip past a guard on registry-department, and still override the tag.
The following examples are standard IAM patterns. Test each one in your own accounts before you rely on it, including attempts that use mixed-case spellings of the tag key. To check a policy for errors, use IAM Access Analyzer policy validation.
With the following role trust policy, principals in account 111122223333 can assume the role and pass session tags, except tags with the registry-department key. If callers don’t need session tags, omit sts:TagSession from the trust policy instead.
Example – Role trust policy that blocks session tags with the entitlement key
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowAssumeRoleAndSessionTags", "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::111122223333:root"}, "Action": [ "sts:AssumeRole", "sts:TagSession" ] }, { "Sid": "DenyEntitlementSessionTag", "Effect": "Deny", "Principal": {"AWS": "arn:aws:iam::111122223333:root"}, "Action": "sts:TagSession", "Condition": { "ForAnyValue:StringEqualsIgnoreCase": { "aws:TagKeys": "registry-department" } } } ] }
If a trusted principal, such as an identity broker, must set the key, exclude that principal from the Deny statement. Then limit the values it can pass with an aws:RequestTag/registry-department condition.
The following statement denies adding, changing, or removing the registry-department key on IAM roles and users, including at creation. Only the IdentityAdministrator role can change the key. Use the statement in a service control policy (SCP) in AWS Organizations, or in a permissions boundary.
Example – SCP or permissions boundary statement that protects the entitlement tag key
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DenyEntitlementTagChanges", "Effect": "Deny", "Action": [ "iam:TagRole", "iam:UntagRole", "iam:TagUser", "iam:UntagUser", "iam:CreateRole", "iam:CreateUser" ], "Resource": "*", "Condition": { "ForAnyValue:StringEqualsIgnoreCase": { "aws:TagKeys": "registry-department" }, "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/IdentityAdministrator" } } } ] }
The trust policy in the first example protects the key only while callers can’t edit that trust policy. The following statement denies trust policy changes on roles under the /discovery/ path, except by the IdentityAdministrator role. Use it in an SCP or a permissions boundary.
Example – SCP or permissions boundary statement that protects discovery role trust policies
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DenyTrustPolicyChangesOnDiscoveryRoles", "Effect": "Deny", "Action": "iam:UpdateAssumeRolePolicy", "Resource": "arn:aws:iam::*:role/discovery/*", "Condition": { "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/IdentityAdministrator" } } } ] }
If you use a permissions boundary instead of an SCP, also stop callers from replacing or removing it. Deny iam:PutRolePermissionsBoundary, iam:DeleteRolePermissionsBoundary, iam:PutUserPermissionsBoundary, and iam:DeleteUserPermissionsBoundary to everyone except your identity administrators. For more information, see Permissions boundaries for IAM entities in the IAM User Guide. For SCPs, see Service control policies (SCPs) in the
AWS Organizations User Guide.
Base JWT grants on claims your IdP administrators control
On a JWT registry, a record visibility configuration reads only the claims in a token that the registry’s JWT authorizer validates. A valid signature doesn’t prove that an administrator set a claim. Anyone who can influence a token’s content controls what its holder can discover. Follow these practices:
-
Base grants on groups or roles that IdP administrators assign, not on profile attributes that users can edit. Review any code that adds or changes claims before your IdP issues a token.
-
Treat scopes in
jwt:scopesas capabilities of the client application, not entitlements of the user, unless your IdP ties scopes to users. -
Test a claim that can arrive as an array, even a one-element array, with a set operator such as ForAnyValue:StringEquals. A scalar test,
StringEqualsorStringNotEquals, never matches a usable array. As a result, anAllowstops granting and aDenystops hiding. For each claim shape, see Supported caller values. -
Put requirements that every caller must meet in the JWT authorizer: allowed clients, audiences, scopes, and custom claims. The authorizer rejects a token before the record visibility configuration runs. For more information, see Set up a JWT manually with your own identity provider.
Control who can label and approve records
Custom metadata values decide which statements match a record. Whoever can create or update a record proposes its labels, and approval publishes them for discovery. To keep labels trustworthy, follow these practices:
-
Review label changes as visibility changes. A new label takes effect for discovery only after its revision is approved, so check a revision’s custom metadata as carefully as its content. For more information, see Record lifecycle.
-
Use auto-approval with care. With auto-approval (
APPROVE_ALL), a submitted record is approved without review, so anyone who can publish can label a record into a broader audience. -
Grant the record write actions narrowly:
CreateRegistryRecord,UpdateRegistryRecord,SubmitRegistryRecordForApproval, andUpdateRegistryRecordStatus. For publishers in other accounts, use theagent-registry:RecordCreatorAccountandagent-registry:RecordSourceAccountcondition keys to limit which records a principal can update, submit, or approve. For more information, see Condition keys for fine-grained record access. -
Pin individual records by
recordId, not byname. One name can match several records, and a new record can reuse a deleted record’s name. AWS Agent Registry assigns record IDs, and no one can change them.
Restrict the read paths that a record visibility configuration doesn’t filter
A record visibility configuration filters only the registry’s discovery APIs (Search, List, and BatchGet) and their MCP tools. Other permissions and public search can still expose records, so restrict them as follows:
-
Control-plane reads –
GetRegistryRecordandListRegistryRecordsreturn the latest revision of each record under IAM permissions alone. That revision can be a draft or pending approval. Don’t grant these actions to callers that a record visibility configuration restricts. -
Managed permissions in AWS Resource Access Manager (AWS RAM) –
AWSRAMPermissionAgentRegistryForConsumergrants discovery only.AWSRAMDefaultPermissionAgentRegistryReadOnly,AWSRAMPermissionAgentRegistryForPublisher, andAWSRAMPermissionAgentRegistryForAdminalso grant control-plane record reads. The configuration doesn’t filter these reads. ReadOnly is the default when you don’t choose a permission. For audiences that a configuration restricts, share with the Consumer permission. For more information, see Choosing a managed permission. -
Public search – Through
SearchPublicRecords, any AWS-authenticated caller can discover each record that isAPPROVEDand has an approved Publisher association. Public search ranks the records that match each query. A record visibility configuration doesn’t filter public search. Promote only records that you want every AWS-authenticated caller to be able to discover. To remove a record from public search, disassociate its Publisher. For more information, see Search publicly discoverable records and Remove a record from public discovery. -
The resource behind a record – Discovering a record doesn’t grant access to the agent, MCP server, or other resource that it describes. Secure each resource with its own authorization.
Delegate configuration management deliberately
Anyone who can change a record visibility configuration controls what every caller discovers. Grant that ability as narrowly as other administrative permissions:
-
Every configuration write needs
agent-registry:PutRecordVisibilityConfiguration, in addition toCreateRegistryorUpdateRegistry. The check runs whenever a request includesrecordVisibilityConfiguration, including aputthat changes nothing and adeletewhen no configuration exists. -
PutRecordVisibilityConfigurationis a permission only, with no API of its own. OnCreateRegistry, the registry doesn’t exist yet, so the service checks the action onregistry/*, with each tag in the request asaws:ResourceTag/key-name. A grant scoped to an individual registry ARN can’t authorize a create, so scope create permissions with theaws:ResourceTagcondition key. OnUpdateRegistry, the service checks the action on the registry’s ARN, with the registry’s existing tags. -
On
UpdateRegistry, the registry’s resource-based policy applies to bothUpdateRegistryandPutRecordVisibilityConfigurationfor a request that includesrecordVisibilityConfiguration, even one that changes nothing. If the resource-based policy denies either action, the request returnsAccessDeniedException, even when the caller’s identity-based policy and the registry’s tags allow it. -
If you scope by tag, restrict
agent-registry:TagResourceandagent-registry:UntagResourcefor that tag key. Otherwise, a delegate can tag another registry into its own scope. If delegates can create registries, also restrict the tags they apply at creation withaws:RequestTagandaws:TagKeysconditions. -
To let an administrator change other registry settings but not the configuration, grant
UpdateRegistrywithoutPutRecordVisibilityConfiguration. An update that omitsrecordVisibilityConfiguration, such as a description change, doesn’t needPutRecordVisibilityConfiguration. -
Use revision preconditions so that one administrator doesn’t overwrite another’s concurrent change. For more information, see Avoid overwriting concurrent changes.
-
Audit configuration changes in AWS CloudTrail. In
CreateRegistryandUpdateRegistryevents, the configuration document appears asHIDDEN_DUE_TO_SECURITY_REASONS. For more information, see Record visibility configuration fields in management events.
With the following identity-based policy, you can delegate record visibility configuration management for registries tagged record-visibility-owner=platform-team. The policy also stops the delegate from adding, changing, or removing the record-visibility-owner tag on any registry.
Example – Identity-based policy that delegates record visibility configuration management by registry tag
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ManageRecordVisibilityConfigurationsOnTaggedRegistries", "Effect": "Allow", "Action": [ "agent-registry:GetRegistry", "agent-registry:UpdateRegistry", "agent-registry:PutRecordVisibilityConfiguration" ], "Resource": "arn:aws:agent-registry:us-east-1:111122223333:registry/*", "Condition": { "StringEquals": { "aws:ResourceTag/record-visibility-owner": "platform-team" } } }, { "Sid": "DenyDelegationTagChanges", "Effect": "Deny", "Action": [ "agent-registry:TagResource", "agent-registry:UntagResource" ], "Resource": "*", "Condition": { "ForAnyValue:StringEqualsIgnoreCase": { "aws:TagKeys": "record-visibility-owner" } } } ] }