mirror of
https://github.com/floci-io/floci.git
synced 2026-12-06 03:28:18 -05:00
e80ec187ff87bb951f001e155bf0f78122de4e4e
300
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
17e615ef36 |
fix(iam): check Amazon Lightsail requests on the resources they name (#10236)
Lightsail was one of the namespaces the request-resources table left unread ("a later batch"), so every request of
it was checked on *: a grant scoped to an instance's ARN never matched, a deny scoped to one never held, and an
aws:ResourceTag condition read nothing. lightsail joins the table now, so each request is checked on the resources
the Service Reference gives its action, read from the request.
A Lightsail ARN carries an id the service mints (Instance/${Id}), while a request names the resource by its name, so
the table asks the service to find it. LightsailStoredResourceArns answers the caller's instance, disk, static IP or
key pair of the name a request gives (instanceName, diskName, staticIpName, keyPairName) in the request's Region, as
the ARN Lightsail stores for it (LightsailService.findArn), and the tags Lightsail keeps on the resource an ARN names,
read in the account and Region the ARN names without moving it and matched on the whole ARN
(LightsailService.storedTags), which an aws:ResourceTag condition reads.
Both read the store in place, a resource stored before keys carried the account included: findArn through
AccountAwareStorageBackend.readInAccount, and storedTags through readAllInAccount, a new scanning counterpart of
readInAccount that also finds the default account's pre-multi-account entries, each read where it is. DMS's
storedArn, which carried the same scan inline, uses it too.
A tag call is checked on its resourceArn; one naming the resource by its resourceName alone, the reads (GetInstance,
GetDisk and the like) and the creates are checked on *, as the generated table reads them.
IamRequestResourceEnforcementIntegrationTest checks that a grant on one instance's ARN reboots the instance a
request names by its name and refuses another, and that an aws:ResourceTag condition reads the tags of the instance a
stop names. LightsailStoredResourcesTest checks each lookup against another Region, type, name and a type Floci keeps
none of, and the stored tags of an instance and a key pair against another account, Region, type, service, id or no
ARN, and that both find an instance stored before accounts without moving it. AccountAwareStorageBackendTest checks
readAllInAccount.
|
||
|
|
6190f6d154 |
fix(iam): check AWS WAF v2 requests on the resources they name (#10214)
WAF v2 was one of the namespaces the request-resources table left unread ("a later batch"), so every request of it
was checked on *: a grant scoped to a web ACL's ARN never matched, a deny scoped to one never held, and an
aws:ResourceTag condition read nothing. wafv2 joins the table now, so each request is checked on the resources the
Service Reference gives its action, read from the request.
A request giving an ARN member (ARN, ResourceARN, ResourceArn, WebACLArn) is checked on the resource it names, as
regional/<type>/<name>/<id> or global/..., the ARNs WAF v2 mints. UpdateWebACL and UpdateRuleGroup name their
resource by a lock token, which the table reads through LockToken: WafV2StoredResourceArns answers the caller's web
ACL, IP set, regex pattern set or rule group whose current token it is, of either scope the request's Region reaches,
the one the handler checks the token against (WafV2Service.lockHolder). WafV2Resource declares the getLockToken each
model already has. It answers the tags WAF v2 keeps on the resource an ARN names, read in the account, Region and
scope the ARN names without moving it and matched on the whole ARN (WafV2Service.storedTags), which an
aws:ResourceTag condition reads.
A request naming a resource by its Name, Scope and Id alone, and CreateIPSet and CreateRegexPatternSet, are checked
on <Scope>/<type>/*/*, the scope as the request spells it (REGIONAL or CLOUDFRONT) while WAF v2 mints regional/ and
global/, and CreateWebACL and CreateRuleGroup on *, as the generated table reads them.
IamRequestResourceEnforcementIntegrationTest checks that a grant on one web ACL's ARN lets an update giving its lock
token through and refuses the update of another, and that an aws:ResourceTag condition reads the tags of the web ACL
a tag call names. WafV2StoredResourcesTest checks the stored tags of a regional web ACL and a global IP set against
another account, Region, kind, service or no ARN, and the lock holder of either scope against another Region's
regional resource, another account's token and a replaced one.
|
||
|
|
0a8aaf9a19 |
fix(iam): check AWS Organizations requests on the resources they name (#10208)
Organizations was one of the namespaces the request-resources table left unread ("a later batch"), so every request
of it was checked on *: a grant scoped to an account's or an OU's ARN never matched, a deny scoped to one never held,
and an aws:ResourceTag condition read nothing. organizations joins the table now, so each request is checked on the
resources the Service Reference gives its action, read from the request.
An Organizations ARN carries the organization's id beside the id a request gives
(account/o-<organization>/<account id>), so the table fills one variable of it and asks the service for the rest.
OrganizationsStoredResourceArns finds the account, OU, root or policy a request names by its id alone in the caller's
organization, as the caller's handler finds it, and a handshake where the caller sent it or receives it: the account
it invites, any account for an invitation by email naming none, which may claim it, and each member for one enabling
all features, as AcceptHandshake lets them act on it. It answers the tags Organizations keeps on an account,
root, OU, policy or resource policy, matched on the whole ARN without moving it, which an aws:ResourceTag condition
reads. The lookups of an OU or a policy by its id in an organization move into organizationalUnitIn and policyIn,
beside accountIn, which DescribeOrganizationalUnit's and DescribePolicy's handlers and the new lookups share.
An organization's resources belong to its management account, so a member's request on one is judged across
accounts, the organization's resource policy deciding beside the member's own policies, as the existing
OrganizationsResourcePolicyProvider already supplies it. A handshake's recipient acts on it on its own policies: an
invitee belongs to no organization, and AcceptHandshake and DeclineHandshake are no actions a delegation policy grants
(the Organizations User Guide's supported delegation policy actions). So a handshake the caller receives is reached in
the management account (reachedInItsAccount), as a RAM invitation is, and the provider supplies no delegation policy
for it.
TagResource, UntagResource and ListTagsForResource, and the calls naming a parent or a target by its id (ListChildren,
ListPoliciesForTarget), are checked on *, and AttachPolicy and DetachPolicy on the policy alone, as the generated table
reads them.
IamRequestResourceEnforcementIntegrationTest checks, in an organization of its own, that a grant on one account's ARN
reads it by its id and refuses another, that an aws:ResourceTag condition reads the tags of an OU, that a member's
read of an OU is refused on its own grant alone and allowed where the organization's resource policy grants it too,
and that the account the organization invites reads the handshake on its own policy naming the handshake's ARN, with
that resource policy in place, and is refused on another. OrganizationsServiceTest checks each lookup for a member,
the management account, an outsider, an invitee, a claimant of an invitation by email and the members receiving a
handshake enabling all features, and the stored tags of each kind, the resource policy among them, against another
management account, organization, kind or service.
|
||
|
|
933e8523e6 |
fix(iam): check AWS Network Firewall requests on the resources they name (#10200)
Network Firewall was one of the namespaces the request-resources table left unread ("a later batch"), so every request
of it was checked on *: a grant scoped to a firewall's ARN never matched, a deny scoped to one never held, and an
aws:ResourceTag condition read nothing. network-firewall joins the table now, so each request is checked on the
resources the Service Reference gives its action, read from the request: a firewall or a firewall policy by its ARN
or by the name its ARN ends in (firewall/<name>, firewall-policy/<name>, as Floci mints them), a rule group by its ARN,
and a tag call on its ResourceArn. A rule group named by its name and type alone is checked on *, and CreateRuleGroup
on the rule group its SourceMetadata.SourceArn names or else on *, as the generated table reads them.
The generator stopped on network-firewall. with_through reads CreateFirewall's VpcId as naming a firewall, as the
model's VpcEndpointAssociation structure holds a VpcId beside a FirewallArn, and with_made then marked that through
row made, a key the table's own check refuses on a through row. A resource a create names through another member
exists already, as one it names by its ARN does, so with_made no longer marks a through row; no other namespace's rows
change. The VpcId row stands as generated: Network Firewall answers no through lookup, so it adds no resource.
NetworkFirewallStoredResourceArns answers the tags Network Firewall keeps on the firewall, firewall policy or rule
group an ARN names, read in the ARN's account without moving it, which an aws:ResourceTag condition reads. It finds
nothing: the table builds a firewall's or a policy's ARN from its name, the ARN Floci mints.
IamRequestResourceEnforcementIntegrationTest checks that with no grant a firewall's read is refused, that a grant on
one firewall's ARN reads it by its name and by its ARN and refuses another, that a deny on one refuses it beside an
allow on every resource, and that an aws:ResourceTag condition reads the tags of a firewall and of a firewall policy a
tag call names. It also checks that a grant on one rule group's ARN reads it and refuses another, and the same rule
group named by its name and type, and that CreateFirewall is refused on a grant on every firewall alone and runs with
one on the firewall policy it names beside it. NetworkFirewallStoredTagsTest checks the stored tags of each kind, in
another account too.
|
||
|
|
de0b1dc485 |
feat(elasticache): emit the OpenTelemetry bandwidth limit of a node (#10193)
The ElastiCache metrics reference gives system.network.bandwidth.limit as a vended Gauge in By/s: "The baseline network bandwidth for the node's instance type. The limit is the same in each direction and applies to each direction separately." regen_elasticache_otel_metrics.py now also reads the user guide's "Supported node types" page. It copies the baseline bandwidth in Gbps of each node type its "Current Generation (Valkey)" tables list into the vendored file. Only that section is read: the Memcached section gives cache.r5.12xlarge 20 Gbps where the Valkey and Redis OSS sections give 12. The table converts each baseline to bytes a second, at 125000000 per Gbps. A node emits the baseline of its group's node type, with no attribute but valkey.role. A node type the page does not list for Valkey emits none. Closes #7030 |
||
|
|
7007b5f7fc |
fix(cloudwatch): check cloudwatch:ResourceArn on the resource metrics configuration operations (#10188)
The Service Reference gives Create, Get, Update and DeleteResourceMetricsConfiguration the condition key cloudwatch:ResourceArn, which Floci never put in the request context, so an Allow scoping them with ArnLike on it allowed nothing and a Deny conditioned on it denied nothing. regen_request_condition_keys.py opts cloudwatch in, reading the key from the ResourceArn member each request carries, as it reads redshift:DbUser from DbUser, and request-condition-keys.json is regenerated. botocore models CloudWatch in smithy-rpc-v2-cbor, which the request condition reader did not read; it now reads such a namespace's request in the protocol it arrives in, a Query form, or a JSON or CBOR body, as CloudWatch takes all three. |
||
|
|
bcd1317202 |
fix(cloudformation): check the list sizes and unique items a resource schema declares (#10187)
A resource handler's model validation checks a list's minItems, maxItems and uniqueItems as it checks a string's length and pattern, so AWS fails an AWS::CloudWatch::ResourceMetricsConfiguration with two MetricSelections before anything is configured. Floci vendored only the string constraints, so such a template reached the service, and the OTelEnrichment provisioner checked uniqueItems by hand. regen_cfn_property_types.py now vendors minItems, maxItems and uniqueItems on every list, with --check anchors for the CloudWatch lists, and cfn-property-types.json is regenerated (no other drift). CfnPropertyTypes.HandlerReader checks them with the schema validator's messages and order: too few, too many, then two the same, ahead of the list's items. "Model validation failed (#/MetricSelections: expected maximum item count: 1, found: 2)". Items are compared once intrinsic functions are resolved and values converted. The ECS handler, which already takes members the schema does not declare, checks none of them. The OTelEnrichment provisioner's own uniqueness check is removed. Items are keyed by their JSON with sorted members, not held in a set of nodes, which slows to comparing each item with every colliding one when a template makes their hashes collide. S3CfnProvisioner's uniqueness check now shares this one. |
||
|
|
bf7af5ca50 |
fix(iam): check Amazon DLM by its generated routes, resources, passed roles and tags (#10183)
Under enforcement a REST route no vendored model names runs unchecked, and DLM was among them: any caller could
create, read, update or delete a lifecycle policy and read or change its tags with no permission at all. DLM's model is
vendored now (regen_rest_routes.MODELS: dlm), so each request is checked as its operation's action, and dlm joins the
generated tables of request resources, passed roles and tags on create: the tag routes on the policy their path's ARN
names, the role CreateLifecyclePolicy and UpdateLifecyclePolicy pass in ExecutionRoleArn, and the tags a create
carries, which need dlm:TagResource.
The routes naming a policy by its PolicyId (GetLifecyclePolicy, UpdateLifecyclePolicy, DeleteLifecyclePolicy) are
checked on *, as the generated table reads them: a policy's ARN is policy/${ResourceName}, a name variable, which the
rule's compatible() keeps an id member from filling. CreateLifecyclePolicy's tags are checked on the policy the table
fills from DefaultPolicy, and on * when the request leaves it out.
DlmStoredResourceArns answers the tags DLM holds on the policy an ARN names, read in the ARN's account and Region by
the id it ends in without moving it and matched on the whole ARN, which an aws:ResourceTag condition reads. A namespace
the table reads is served on its tag routes only at the ARN its path encodes, so DlmIntegrationTest sends the ARN
encoded, as the SDKs do, and docs/services/dlm.md says so.
IamRestRouteEnforcementIntegrationTest checks that with no grant a policy's tags are refused, that a grant on one
policy's ARN reads them and refuses another's, that a deny on one policy's ARN refuses it and leaves another, that an
aws:ResourceTag condition reads a policy's tags, that GetLifecyclePolicy is checked on *, and that a create needs
iam:PassRole on its execution role and dlm:TagResource for the tags it carries.
|
||
|
|
cf50025eaa |
fix(iam): check Amazon MQ by its generated routes, resources and tags (#10172)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MQ was among them: any caller could
list, create, describe, reboot or delete a broker with no permission at all. MQ's model is vendored now
(regen_rest_routes.MODELS: mq), so each request is checked as its operation's action, and mq joins the generated
tables of request resources, passed roles and tags on create: a broker by the id its path gives, a configuration by
its id, and the tags a create carries, which need mq:CreateTags on the broker of the name it gives. The Service
Reference passes a role to mq.amazonaws.com on CreateBroker and UpdateBroker, which the rule reads from
LdapServerMetadata's roleName and userRoleName by their names. AWS gives LDAP metadata to ActiveMQ brokers alone, which
Floci does not create, and Floci serves no UpdateBroker, so the reading reaches no request Floci serves.
A broker's ARN is broker:${BrokerName}:${BrokerId}, and MQ's requests name a broker by its id alone, so the table
fills only BrokerId, and the reader asks the namespace's service for the resource of the one variable a request fills,
as it does for any type. AmazonMqStoredResourceArns answers it with the caller's broker of the id in the Region, so the
request is checked on the broker's whole ARN rather than broker:*:<id>, which no policy naming a broker matches. It also
answers the tags MQ holds on the broker an ARN names, read in the ARN's account and Region by the id it ends in and
matched on the whole ARN, neither read moving a stored broker.
The table also takes the Service Reference's change to SES since main's sync: TagResource, UntagResource and
ListTagsForResource now act on a multi-region-endpoint too, which the drift check of a change to the table requires.
IamRestRouteEnforcementIntegrationTest checks that with no grant a broker's read is refused, that a grant on one
broker's ARN reads it and refuses another, that a deny on one broker's ARN refuses it and leaves another, that an
aws:ResourceTag condition reads a broker's tags, and that a create carrying tags needs mq:CreateTags on the broker of
its name.
|
||
|
|
bea07871fb |
feat(elasticache): emit Valkey replication groups' OpenTelemetry metrics to CloudWatch (#10173)
Node-based Valkey replication groups emit the OpenTelemetry metrics of the ElastiCache user guide's metrics reference to CloudWatch, where PromQL reads them: the vended metrics every 60 seconds, and those a resource metrics configuration selects every 15 seconds as detailed. Each node's INFO is read straight from its server, as the backend's administrator once a user group has turned the default user off, and each command's type and category come from COMMAND INFO and COMMAND DOCS. The metric table is vendored from the reference page by regen_elasticache_otel_metrics.py, checked by aws-data-check and the drift workflow. VendedOtlpMetrics stores the export requests for the account and Region. Emission is off by default behind FLOCI_SERVICES_ELASTICACHE_OTEL_METRICS_ENABLED, since each node adds about 8 KB to the OTLP store every minute. Part of #7030. |
||
|
|
e04990a9bb |
feat(cloudformation): provision CloudWatch resource metrics configurations (#10171)
AWS::CloudWatch::ResourceMetricsConfiguration creates the detailed monitoring configuration of its ResourceArn and deletes it with the stack. Ref returns the ARN, and CreatedAt and UpdatedAt return the configuration's timestamps to the millisecond, as the API answers them. MetricSelections updates in place, and a dropped list removes the filter. The resolved selections are compared with the stored ones, so a selection reading a replaced resource takes its new value. A new ResourceArn replaces the configuration, and the old one is deleted once the update completes. A failed update puts the previous selections back, with the timestamps of that write, and a create for a configured ARN fails with AlreadyExists. CreatedAt and UpdatedAt are read-only and refused in the template. A configuration already gone is taken as deleted. CfnExceptions.alreadyExists builds the resource handler's AlreadyExists answer and CfnExceptions.refuseReadOnly the read-only refusal, for the provisioners that spelled them out, and the OTel enrichment snapshot moves to a __Floci key in CfnRollback, as every other provisioner's does. Part of #7030. |
||
|
|
1f5c7abaaf |
feat(cloudformation): provision CloudWatch OTel enrichment and resource tags for telemetry (#10157)
AWS::ObservabilityAdmin::TelemetryEnrichment starts resource tags for telemetry in the stack's Region and stops it on delete. Scope must be ACCOUNT; Ref returns it and Status is RUNNING. AWS::CloudWatch::OTelEnrichment starts OTel enrichment with its filters, updates them in place as UpdateOTelEnrichment does (a dropped list is cleared), and stops it on delete. An update writes the filters when the template changes them or when they resolve to other values than the running ones, as a Ref to a resource the update replaces does. Ref and AccountId are the account, Status is RUNNING, and a failed stack update puts the previous filters back. Both are singletons: a create while the feature already runs fails with AlreadyExists, as the CloudFormation handler contract requires, and the check and the start hold one lock. Properties go through template validation, then the schema's model validation, with the two types added to the vendored property types. The vendored schema data is regenerated from AWS's current archive, which adds AvailabilityZoneId to AWS::EC2::Instance (recorded as a writable gap, since the instance provisioner does not read it) and an EBS Throughput, and drops ElasticGpuSpecifications and ElasticInferenceAccelerators, whose gap rows go. |
||
|
|
ebdb9c6615 |
fix(iam): check Bedrock AgentCore by its generated routes, resources, passed roles and tags (#10153)
Under enforcement a REST route no vendored model names runs unchecked, and Bedrock AgentCore was among them: any caller
could create, read, update or delete its runtimes, runtime endpoints, gateways, gateway targets and rules, memories,
harnesses, browsers, code interpreters, workload identities and credential providers, put a resource policy, write and
read memory events and invoke a runtime, with no permission at all. AgentCore's two models are vendored now
(regen_rest_routes.MODELS: bedrock-agentcore and bedrock-agentcore-control, both signed bedrock-agentcore), so each
request is checked as its operation's action, and bedrock-agentcore joins the generated tables of request resources,
passed roles and tags on create: a resource by the id its path gives, the role each create or update passes, and the
tags a create carries.
The Service Reference passes CreateCapacityProvider's roles to bedrock-agentcore and ec2 without saying which member's
goes where. fetch_bedrock_agentcore_roles.py vendors what AWS says of each into
tools/aws/sources/bedrock-agentcore-roles.json, a ROLE_SOURCES entry as Batch's is: the operator role is "the IAM role
that AgentCore assumes to manage the capacity provider" (Control API reference), which AgentCore's capacity provider
sample says must trust bedrock-agentcore.amazonaws.com, and launchParameters.instanceProfileArn is "the IAM instance
profile to associate with launched instances", whose role the IAM User Guide's trust policy for an EC2 instance's role
gives to ec2.amazonaws.com. That member names an instance profile, which the rule does not read by its name, so the
source lists it in roleMembers, and the check that every vendored role is read now counts such members as the table
does.
BedrockAgentCoreStoredResourceArns answers the tags AgentCore holds on the resource an ARN reaches, in its account and
Region, which an aws:ResourceTag condition reads: a runtime, a runtime endpoint, a gateway, a memory or a harness as
the tag routes read the same ARN (a qualified runtime ARN answers the runtime's), and a custom browser, a custom code
interpreter or a browser profile from the tool. The table asks for a consent portal, a code interpreter by its name or
a configuration bundle to be found, which Floci does not serve, and for the memory an event is in, which the path of
GetEvent and DeleteEvent already names. A runtime endpoint's routes are checked on its runtime and a credential
provider's on *, as the generated table reads them: their ARNs end in a ${Name} beside another variable, which no
reading fills.
The tag routes no longer take the agent/<uuid> and agentEndpoint/<uuid> forms Floci wrote before #8088. They name no
AWS resource, so IAM could only check them as named, past a deny on the runtime or endpoint they reached; they now get
a ValidationException, and a legacy agent/ ARN names no runtime on invoke. A CloudFormation stack that holds an
agentEndpoint/<uuid> physical id still updates and deletes that endpoint.
A namespace the table reads is served on its tag routes only at the ARN its path encodes, as Connect's, MSK's and
MWAA's are, so AgentCore's and CloudFormation's AgentCore tests send the ARN encoded, as the SDKs do, and
docs/services/bedrock-agentcore.md says so.
IamRestRouteEnforcementIntegrationTest checks that with no grant a gateway's read is refused, that a grant on one
gateway reads it and refuses another, and that an aws:ResourceTag condition reads its tags; that a gateway create needs
iam:PassRole on its role and bedrock-agentcore:TagResource for the tags it carries; that a data plane event write is
checked on the memory its path names; that an aws:ResourceTag grant reads a browser's tags; and that a deny on a
runtime's tags holds for its ARN and its qualified ARN while the legacy endpoint form is refused.
|
||
|
|
15bcb53828 |
feat(cloudwatch): republish vended metrics for PromQL through OTel enrichment (#10151)
While OTel enrichment runs in an account's Region, each datapoint Floci vends there is republished as an OpenTelemetry data point that PromQL reads, when the CloudWatch user guide's "Supported resources and metrics" page lists its metric for the resource it measures with exactly its dimension names, and the enrichment's filters keep it: include first, then the exclude match set subtracted, empty lists permissive, names matched exactly. The classic datapoint is stored as before. The page's tables are vendored as aws/cloudwatch-otel-enrichment.json by tools/aws/regen_cloudwatch_otel_enrichment.py, which copies each namespace's scope and, per resource, whether its ARN and tags are added and each metric's instrument type and dimension sets, and refuses a reworded page. make cloudwatch-otel-enrichment-check reads the file's shape offline, in aws-data-check; -verify compares it with the live page, in iam-data-verify and the weekly drift run. A republished series carries the guide's labels: the dimensions as data point attributes, cloud.resource_id, provider, Region and account on the resource, the namespace's scope with cloudwatch.source and cloudwatch.solution, and the resource's tags as @aws.tag.<key> with resource tag enrichment while resource tags for telemetry run. Only a request enrichment wrote maps tag.* to @aws.tag; one a client sends keeps @resource.tag.*. A Sum is a delta sum of the datapoint's sum; a Histogram is a delta one-bucket histogram of its sample count, sum, minimum and maximum, as CloudWatch does not document that conversion. SQS queues pass their ARN and tags, and so do paused Aurora Serverless v2 instances and clusters and Redshift clusters; of those the page lists every AWS/SQS metric and the paused instance's ACUUtilization and CPUUtilization. A failed republication is logged and never reaches the classic publication. Part of #7030. |
||
|
|
7064800c45 |
chore(deps): bump botocore to 1.44.18 (#10128)
Bumps botocore from 1.44.17 to 1.44.18 with its regenerated data. 1.44.18 adds RDS data groups and DB cluster groups, whose operations the IAM tables now read from the model rather than marking them as missing from the pinned botocore. The Service Reference lists two tagging actions for rds:CreateDataGroup, rds:AddTagsToDataGroup and rds:AddTagsToResource, without saying whether the tags a create carries need one or both, so the tag-on-create generator stopped on it. The Aurora User Guide's prerequisites for data groups answer it: "To add tags when you create a data group, grant rds:AddTagsToResource and rds:AddTagsToDataGroup on *". fetch_rds_tag_actions.py vendors that page into tools/aws/sources/rds-tag-actions.json, and the generator, granted it for RDS alone (TAG_ACTION_SOURCES), lists both actions for the operation when they are the ones the reference lists. --verify reads the page again. That sentence grants both actions "on *", where the guide grants adding tags to a data group that exists "on data-group:*", so the fetcher copies that resource too and the table marks the operation anyResource: Floci checks the create's tagging actions on *, not on the DB cluster the create itself is checked on. The tag-on-create table and TagOnCreate now carry each operation's tagging actions as a list, and the enforcement filter, RequestChecks and STS's trust policy check every action an operation's tags need. An operation with one tagging action is checked as before. verify_role_sources' body becomes verify_vendored_sources, which both generators use to verify their vendored sources. The guide's IAM page for database cluster groups authorizes rds:CreateDBClusterGroup against "* (the group doesn't exist yet)", where the Service Reference lists cluster-group for it and a group's ARN holds a resource ID the request does not carry. fetch_rds_cluster_group_permissions.py vendors that page's table as RDS's permission source, and the request resources generator checks an action its row authorizes against * alone there. fetch_dms_arn_formats.py refreshes its botocore examples at the new pin, and the authorized-actions table takes the Service Reference's new mapping of budgets:DescribeBudgetSpendForPrincipal to budgets:ViewBudget. |
||
|
|
a0a382b59a |
fix(iam): check Amazon Connect by its generated routes, resources and tags (#10125)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon Connect was among them: any caller could create, describe, update or delete an instance, its attributes or its storage configs. Connect's model routes are vendored (regen_rest_routes.MODELS, signed connect), so each request is checked as its operation's action, and connect joins the generated tables of request resources and tags on create: an instance by the id its path gives, each of Connect's other resources by the members its request names, and the tags a create carries. ConnectStoredResourceArns answers the tags Connect holds on an instance, read in place in the ARN's account and Region, which an aws:ResourceTag condition reads. The table asks for a traffic distribution group or a data table to be found, which Floci does not serve, so there is nothing to find. The table's integer variables now include Connect's customer-managed-view-version ViewVersion, which test_regen_iam_request_resources pins. A namespace the table reads is served on its tag routes only at the ARN its path encodes, so ConnectIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw. IamRestRouteEnforcementIntegrationTest checks that with no grant an instance's read is refused, that a grant on one instance reads it and refuses another, and that an aws:ResourceTag condition reads its tags. ConnectService named an instance by any ARN, reading the text after its first slash, so an ARN of another shape (arn:aws:connect:us-east-1::other/<id>) reached an instance IAM had not checked the request on, past a deny on it. It now takes an instance's own ARN alone, the one IAM checks, refuses an ARN of any other shape, and looks one of another account or Region up as given, which finds nothing; storedTags answers an instance's own ARN alone, so another partition's gets no tags. ConnectStoredResourceArnsTest covers both, IamRestRouteEnforcementIntegrationTest checks that an instance deny holds for each form the path gives it and that a tagged CreateInstance needs connect:TagResource, and docs/services/connect.md says which ARNs are taken. |
||
|
|
ae99b5a874 |
feat(observabilityadmin): serve resource tags for telemetry with its Resource Explorer managed view (#10075)
CloudWatch's OTel enrichment reads resource tags through ObservabilityAdmin's resource tags for telemetry feature, which has to be running before StartOTelEnrichment enables tag enrichment. Add the ObservabilityAdmin service with StartTelemetryEnrichment, StopTelemetryEnrichment and GetTelemetryEnrichmentStatus, one feature per account and Region. Starting the feature has Resource Explorer create a LOCAL index when the Region has none and a managed view that includes tags, as the CloudWatch user guide describes. GetManagedView and ListManagedViews now answer the views Floci's services create. A status read before the first start is the modeled ResourceNotFoundException, and a stop of a stopped or never-started feature changes nothing. The passed-roles table now reads ObservabilityAdmin. A vendored source, written from the CloudWatch user guide and the Observability Admin API reference, gives a dataset integration's role to CloudWatch Logs, whose trust policy it names, and gives where a telemetry pipeline's YAML configuration names its roles: its source's and its Secrets Manager extension's, each going to the service its source type's role trusts, and to CloudWatch Logs as well with a lookup processor or a conditional route. Part of #7030. |
||
|
|
ed36acd1d9 |
chore(deps): bump botocore to 1.44.17 (#10117)
Bumps botocore from 1.44.14 to 1.44.17 with its regenerated data. 1.44.18 waits: it adds RDS data groups, and the
Service Reference lists two tagging actions for CreateDataGroup, rds:AddTagsToDataGroup and rds:AddTagsToResource,
while no AWS page says which one the tags a create carries need, so the tag-on-create generator stops on it.
botocore 1.44.17 moves Athena to REST-JSON ("The AWS SDKs for Athena now use the REST-JSON format"), and Floci serves
Athena as JSON 1.1 under the AmazonAthena target prefix. regen_rpcv2_cbor_shapes reads Athena's model under that prefix
as a JSON facade, as it reads API Gateway V2's, so Athena's shapes there are unchanged but for GetQueryResultStream.
The request-resources table now locates Athena's members in its REST paths (WorkGroup in /workgroups/{WorkGroup}),
and a member is read from a request's path only when the request came over REST: a JSON, CBOR or Query request carries
every member in its body or form, so RequestResources locates none for it. Without that, a JSON 1.1 Athena request lost
the WorkGroup its body names and was checked on the primary workgroup. RequestResourceMembersTest sends a request whose
members its path carries as REST, and RequestResourcesTest sends Athena's StartSession as JSON 1.1.
The other changes follow the models and the Service Reference: IAM's workload identity operations are read now that
botocore has them, its five new paged lists join regen_iam_shapes' operations so their requests are held to the model as
every paged list's is (Floci does not serve them, so IamListPaginationIntegrationTest pages the lists it serves, those
that do not answer UnsupportedOperation), and its condition keys carry their tagging actions (twenty now, with the
workload identity providers and templates); SageMaker, Redshift Serverless, EKS, Bedrock and ECR rows, the service
namespaces and the DynamoDB and S3 Control condition keys follow theirs, and fetch_dms_arn_formats refreshes its
botocore examples at the new pin.
|
||
|
|
2d977bc48c |
fix(iam): check Amazon AppIntegrations by its generated routes, resources and tags (#10108)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon AppIntegrations was among them: any caller could create, read, update, delete or tag an event integration or a data integration. AppIntegrations' model routes are vendored (regen_rest_routes.MODELS, signed app-integrations), so each request is checked as its operation's action, and app-integrations joins the generated tables of request resources and tags on create: an event integration by the name its path or body gives, a data integration by its id, and the tags a create carries. AppIntegrationsStoredResourceArns finds the data integration CreateDataIntegration names by its name, as the table asks (findByMembers), its ARN carrying the id AppIntegrations mints. It finds nothing by the value an ARN is filled with (find), so a request naming a data integration by its id is checked on that id, as its handler reads it, never on another integration whose name is that id. It answers the tags AppIntegrations holds on an event or data integration, read in place in the ARN's account and Region, for the integration's own ARN alone, as the tag routes find it, which an aws:ResourceTag condition reads. Floci serves no applications, so there is no application to find. StoredResourceArns names it. A namespace the table reads is served on its tag routes only at the ARN its path encodes, so AppIntegrationsIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw. IamRestRouteEnforcementIntegrationTest checks that with no grant an event integration's read is refused, that a grant on one reads it and refuses another, that an aws:ResourceTag condition reads its tags, that a CreateEventIntegration carrying tags needs app-integrations:TagResource on the event integration it makes, that CreateDataIntegration is checked on the data integration of the name it gives, and that GetDataIntegration by an id is checked on that integration, not on another named like the id. AppIntegrationsServiceTest checks that another partition's ARN reads no tags. |
||
|
|
dfffb8b32b |
fix(iam): check CloudWatch RUM by its generated routes, resources and passed roles (#10093)
Under enforcement a REST route no vendored model names runs unchecked, and CloudWatch RUM was among them: any caller could create, read, update, delete or list app monitors with no permission at all. RUM's model routes are vendored (regen_rest_routes.MODELS, signed rum), so each request is checked as its operation's action, and rum joins the generated tables of request resources, passed roles and tags on create: an app monitor by the name its path gives, the tags a create carries, and PutRumMetricsDestination's IamRoleArn passed to rum, which applies once Floci serves that operation, as it serves only the app monitor routes today. RumStoredResourceArns answers the tags RUM holds on an app monitor, read in place in the ARN's account and Region, which an aws:ResourceTag condition reads. PutRumEvents names its monitor by an id, which the table asks to be found; Floci does not serve it, so there is nothing to find. IamRestRouteEnforcementIntegrationTest checks that with no grant a monitor's read is refused, that a grant on one monitor reads it and refuses another, that an aws:ResourceTag condition reads a monitor's tags, that a create granted on the monitor its Name makes passes with a guest role in its configuration, whose IAM role ARN is not taken for a monitor, and that a create carrying tags is refused until rum:TagResource is granted on the monitor it makes. |
||
|
|
dfab0019cd |
fix(iam): check Amazon Detective by its generated routes and resources (#10082)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon Detective was among them: any caller could enable an organization admin account, list a behavior graph's members or change its organization configuration with no permission at all. Detective's model routes are vendored (regen_rest_routes.MODELS, signed detective), so each request is checked as its operation's action, and detective joins the generated tables of request resources and tags on create: a behavior graph by the ARN its body gives, and an operation the Service Reference gives no resource type on *. Detective passes no role. Floci keeps no tags on a graph, so an aws:ResourceTag condition on one reads none, as before. IamRestRouteEnforcementIntegrationTest checks that with no grant, or a grant on another graph, listing a graph's members is refused, and that a grant on the graph lets the request through; and that listing the organization's administrator accounts, an operation the Service Reference gives no resource type, is refused until its action is granted on *. AWS added rds:CreateDataGroup to the Service Reference with two tagging actions, rds:AddTagsToDataGroup and rds:AddTagsToResource, and regen_iam_tag_on_create asked for a hand entry for it before reading its request, though the pinned botocore does not have the operation yet. It now asks only when the request carries tags, as which tagging action checks them is a question only for those, so the operation takes the derived verdict, not in botocore, and a model bump bringing it in asks again. The regenerated tag-on-create table takes AWS's other new actions too: ec2:CreateSecondaryNetworkAclAssociation and rds:RestoreDBClusterGroupToPointInTime. |
||
|
|
f895b21f52 |
fix(iam): check Amazon MWAA by its generated routes, resources and passed roles (#10017)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MWAA was among them: any caller could create, read, update or delete an environment, get its CLI or web login token, and pass an execution role with no iam:PassRole. MWAA's model routes are vendored (regen_rest_routes.MODELS, signed airflow), so each request is checked as its operation's action, and airflow joins the generated tables of request resources, passed roles and tags on create: an environment by the name its path gives or the ARN its body does, CreateEnvironment's and UpdateEnvironment's ExecutionRoleArn passed to airflow, and the tags a create carries. MwaaStoredResourceArns answers the tags MWAA holds on an environment, read in place in the ARN's account and Region, a pre-multi-account entry under its bare name included, which an aws:ResourceTag condition reads. StoredResourceArns names it, and now says MSK answers the tags of a cluster alone, as #9973 left MSK. A namespace the table reads is served on its tag routes only at the ARN its path encodes, so MwaaIntegrationTest's tag calls send the ARN encoded, as the SDKs do; IamActionRegistryTest's example of a route Floci does not check on a resource it reads becomes IoT's DescribeThing. IamRestRouteEnforcementIntegrationTest checks that with no grant an environment's read is refused, that a grant on one environment reads it and refuses another, and that an aws:ResourceTag condition reads an environment's tags. IamPassRoleEnforcementIntegrationTest checks that CreateEnvironment and UpdateEnvironment need iam:PassRole on the execution role they name, passed to airflow.amazonaws.com, which a grant for EC2 does not cover. An ARN names the account that owns the resource, so a request on another account's resource is cross-account whether or not its service holds a policy on it. Before, a resource with no supplied policy had no owner, so the caller's own policies alone decided a call on another account's MWAA environment, and an aws:ResourceTag condition answered on that environment's tags. ResourcePolicyProviders.ownerAccount now answers the first supplied policy's owner, or else the ARN's account, and IamEnforcementFilter and RoleResourceAccessAuthorizer judge the request as IAM's cross-account evaluation logic does: "AWS allows the request only if both account policy evaluations allow the request". An ARN naming no account, as an S3 bucket's, is judged within the caller's account as before. So every service that holds a resource-based policy supplies it, read in the account the ARN names: Backup vault access policies, Bedrock guardrails and guardrail profiles, Bedrock AgentCore, CloudHSM backups, CloudWatch Logs destinations, DynamoDB tables, ECR repositories and the registry policy, the Glue Data Catalog (for its Data Catalog resources alone, never a job or crawler), Lambda web functions, Marketplace entities, OAM sinks, Organizations, Payment Cryptography keys, S3 Tables buckets and tables, S3 Vectors buckets, Secrets Manager secrets, SES identity policies, SSM parameters and WAF rule groups. An OpenSearch domain's access policy is not among them: AWS applies it to the domain's subresources only, "not the domain itself", and "accessing the configuration API requires an identity-based policy", while Floci checks the configuration API alone. Nor is an EFS file system policy, which AWS uses "to control file system data access" by NFS clients, which Floci does not serve. Nor are the resource policies CloudWatch Logs' PutResourcePolicy sets, which AWS enforces only for AWS service principals, "not IAM users, roles, or cross-account principals". Nor is a Redshift cluster's or Serverless namespace's resource policy, which AWS describes as "resource policies that work with zero-ETL integrations", whose actions Floci does not check. CloudHSM reported every backup ARN in 000000000000; it now names the caller's account, so the ARN DescribeBackups gives is the caller's own. A resource with no policy that its service acts on in the account its ARN names (StoredResourceArns.reachedInItsAccount: a RAM invitation sent to the caller or a share another account owns, an SSM document another account owns, a Redshift snapshot named by its owner) is judged within the caller's account, its handler answering whether the owner's share lets the caller use it, as that contract already says. So accepting a RAM invitation, associating a shared SSM document and restoring a shared Redshift snapshot work as before. ResourcePolicyProvidersIntegrationTest checks that each provider supplies its policy, owned by the ARN's account, and nothing for the same ARN in another account, and that the Glue Data Catalog policy is not supplied for a job. IamRestRouteEnforcementIntegrationTest checks that another account's MWAA environment is refused whatever its tags and the caller's policies, and that EKS tagging of a foreign ARN is refused; IamRequestResourceEnforcementIntegrationTest checks that a repository in another registry is refused while its policy grants another account and reaches ECR once it grants the caller's; LogsArnTagAuthorizationIntegrationTest checks that a foreign log group ARN is refused. AWS added 24 RDS actions to the Service Reference at 18:02Z on 2026-12-02 (branches, data groups and DB cluster groups, and ResyncIntegration), which the online verify gate reads from AWS's current copy, so the generated tables take them. AWS's Service Reference stopped listing iam:PassRole for kinesisanalytics:AddApplicationReferenceDataSource at 05:02Z on 2026-12-03, so the regenerated passed-roles table drops it, and the request-resources table, generated beside it, is regenerated with it. |
||
|
|
7efb8cef00 |
fix(iam): check Amazon MSK by its generated routes, resources and passed roles (#9973)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MSK was among them: any caller could
create, describe, update or delete a cluster or a configuration. MSK's model routes are vendored
(regen_rest_routes.MODELS), so each request is checked as its operation's action, and kafka joins the generated tables
of request resources, passed roles and tags on create: a cluster, configuration, replicator, VPC connection or topic by
the ARN its path or body gives, CreateReplicator's and CreateChannel's service execution roles passed to kafka, and the
tags a create carries.
A JSON request carries a body member by its botocore locationName where one renames it, as MSK's do (Name is name on the
wire, ConfigurationInfo.Arn is configurationInfo.arn), and MSK's handler reads that name, so regen_iam_request_resources
names each body member path it reads as the request carries it (wire_named): a create is checked on the configuration or
cluster of the name MSK makes, and a body naming another under the botocore spelling too is checked on the one MSK
reads. GuardDuty's CreateFilter name and UpdatePublishingDestination destinationProperties, and API Gateway v2's portal
members, are read as their requests carry them too.
CreateClusterV2 names the configuration its brokers start from two structures deep (provisioned.configurationInfo.arn),
of a type the Service Reference lists for it, and the table read ARN members at most one structure deep, so
regen_iam_request_resources._nested_arns now reads too the members ending in Arn or Arns, holding a string, of a
top-level structure's structures, from botocore alone. 107 operations of other namespaces gain such a row; each ARN is
checked as one of the operation's types where it fits one and dropped where it does not, as one level deep already is,
so most (a KMS key, a role or a bucket naming no type of the action) change nothing. Those that do: Glue's CreateCatalog
and UpdateCatalog on their target catalog, EC2's RunInstances on the resource group a capacity reservation target names,
and Amazon Managed Service for Prometheus' CreateScraper on its workspace and EKS cluster and UpdateScraper on its
workspace. A create checks the tags it carries on what it makes alone, which the table marks by the type its name gives
past its verb; CreateClusterV2's subject, ClusterV2, names no type, so with_made now reads a subject named with a
version that names none without it, and CreateClusterV2 makes a cluster as CreateCluster does: a tagged create needs
kafka:TagResource on the new cluster, not on the configuration it names. A resource the request names by its ARN, or the
service's default a row stands for, exists already, so with_made never counts it as one the create makes, as no such row
of the table was: Glue's tagged CreateCatalog needs glue:TagResource on the catalog it makes, not on the Redshift
catalog it targets. That marks the created row of 95 creates across 38 namespaces; where the created row does not
resolve, the tag check still falls back to every resource the request names, so only a create naming an existing
resource of one of its types by ARN checks its tags on less.
MskStoredResourceArns answers the tags MSK holds on a cluster, read in place in the ARN's account, which an
aws:ResourceTag condition reads where the Service Reference gives the key (a cluster, not a configuration); a tag MSK
keeps with no value is read as an empty one, so it never fails the check.
AWS tags no MSK configuration: CreateConfiguration takes no tags, AWS::MSK::Configuration has none, the Service
Authorization Reference gives a configuration no aws:ResourceTag key and TagResource only assessment, cluster and
vpc-connection, and AWS's evaluation suite notes that TagResource rejects a configuration ARN ("Invalid input resource
arn"). Floci tagged them since #2366, so TagResource, UntagResource and ListTagsForResource now refuse a configuration's
ARN with that BadRequestException, as AWS does, and floci.services.msk.configuration-tags
(FLOCI_SERVICES_MSK_CONFIGURATION_TAGS, off by default) keeps the earlier tagging for state or scripts relying on it;
IAM checks those calls on '*', as no type of the action fits a configuration.
A namespace the table reads is served on its tag routes only at the ARN its path encodes, as Backup's and the others'
are, so MskControllerIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw.
The tables also take the RDS cluster group types (cluster-group, cluster-group-snapshot, cluster-group-auto-backup) AWS
added to the Service Reference on 2026-12-02, on its tagging and restore actions, which the online verify gate reads.
IamRestRouteEnforcementIntegrationTest checks that with no grant a configuration's read is refused, that a grant on one
configuration reads it and refuses another, that an aws:ResourceTag condition reads a cluster's tags, that a cluster
holding a tag with no value is refused rather than answered with a 500, and that CreateConfiguration is checked on the
configuration of the name MSK reads, a body naming another under the botocore spelling too included; that a deny on the
configuration CreateClusterV2 names refuses the create, and that a tagged one needs kafka:TagResource on its new cluster
alone; MskServiceTest and MskControllerIntegrationTest check that a configuration's tag calls are refused unless
configuration-tags is on; IamRequestResourceEnforcementIntegrationTest checks that a deny on the catalog Glue's
CreateCatalog targets refuses it and a deny on tagging that catalog does not refuse a tagged one;
test_regen_iam_request_resources checks the wire names a JSON body path is read by the path read two structures deep,
the type a create named with a version makes, and that no resource named by ARN is made.
|
||
|
|
e0254217be |
feat(cloudwatch): serve PromQL series and label discovery (#9984)
Part 1 of #7030. GetSeries (/api/v1/series) and GetLabels (/api/v1/labels, /api/v1/label/<name>/values) answer over the metrics the OTLP endpoint ingests, with the labels, selector syntax, limits and Prometheus envelope the CloudWatch user guide's PromQL pages give. Regular expressions are RE2's, as Prometheus's are. The guide's "IAM permissions for PromQL" table is vendored by a new fetcher and read by the authorized-actions generator, so the operations are checked as cloudwatch:ListMetrics, and QueryMetrics carries cloudwatch:ListMetrics as a companion every request needs, which the enforcement filter checks. @IamOperation can name a method's operation. The OTLP 40 KB metadata limit counts the resource and scope schema URLs, which PromQL reads as labels of the series. |
||
|
|
03e1a53d2e |
fix(iam): read the passed roles and creation tags of REST services Floci already routes (#9962)
regen_iam_passed_roles.py left Access Analyzer, Bedrock, CloudFront, FIS, GuardDuty and Macie out as "REST routes no rule maps yet", and regen_iam_tag_on_create.py Inspector2 the same, but the request-resources table has read their vendored REST routes since Floci began routing their requests by operation, so the reason no longer held: a request passing a role to one of them needed no iam:PassRole, and an Inspector2 create's tags needed no inspector2:TagResource. They move into each generator's NAMESPACES, and the generic rules read them with no correction: 23 role-passing operations (Bedrock's model customization, evaluation, import and invocation jobs, agents, flows and knowledge bases; FIS's experiment templates; GuardDuty's malware protection plans and scans; CloudFront's realtime log configs, from the RoleARN of each endpoint in the XML body; Access Analyzer's policy generation and Macie's reveal configuration) and five Inspector2 creates. Each operation is read whether or not Floci serves it, so one Floci adds is checked from the start. No entry moves. Floci's CloudFront parser took the first EndPoints anywhere in a realtime log config's body, and every child of it as an endpoint, while the role is read from the request's own EndPoints, at the <member> botocore serializes each as, so an <EndPoint>, or an EndPoints nested in another element ahead of the request's own, passed a role unchecked; the parser now reads the <member> elements of the request's own EndPoints alone, as AWS's deserializer reads no other. IAM reads the role of every KinesisStreamConfig's every RoleARN and none from a body where one holds elements, so an endpoint holding more than one KinesisStreamConfig, or a config more than one RoleARN or StreamARN, or an ARN holding elements, is refused with InvalidArgument rather than saved from one the check did not read. The request-resources table, which leaves a passed role's member out of the resources a request names, is regenerated with the new passed roles: Bedrock's evaluation, customization and invocation jobs, agents, flows and knowledge bases and FIS's experiment templates no longer take their role's ARN as one of their resources. OpenSearch stays out: AssociatePackage's role is AssociationConfiguration.KeyStoreAccessOption.KeyAccessRoleArn of the opensearch client's request, while the Service Reference lists only the es client for it, so the generic rule finds no role member; its reason now says so. The Service Reference now also lists operations pinned botocore 1.44.14 does not model yet (SageMaker's model monitor configs, IAM's workload identity creates); both tables are synced with them unread, as the generators record such an operation. IamPassRoleEnforcementIntegrationTest checks that creating and updating an FIS experiment template, a GuardDuty malware protection plan and a CloudFront realtime log config each needs iam:PassRole on its role for the service it is passed to, and that a realtime log endpoint under another element than <member>, or in an EndPoints nested ahead of the request's own, saves no role, that a RoleARN holding an element, or doubled ahead of one, is refused, and that a body in another charset than the UTF-8 both the check and the handler read saves no role. |
||
|
|
6b0f628760 |
fix(iam): read the tags of IAM's resource types beyond roles and users (#9946)
The request-resources table gives aws:ResourceTag keys to eight IAM resource types and Floci stores the tags of all
eight, but IAM's tag reader answered for roles and users alone, and regen_iam_condition_keys.py listed every resource
tag pair no RoleName or UserName names as notRead ("no member names a stored role or user whose resource tags can be
read"), which IamConditionKeys strips from the request's context. A condition on aws:ResourceTag for a customer managed
policy, an instance profile, an OpenID Connect or SAML provider, a server certificate or a virtual MFA device was
dropped.
The condition-key generator now puts such a pair in a new fromResourceTags section when iam-request-resources.json
resolves the action's request to a resource of one of the pair's types that it gives the key's prefix (resourceTagKeys):
the condition resolver reads it through its generic resource tag reading, from what IAM holds on the resource the
request names. A create the generated tag-on-create table lists (iam-tag-on-create.json) acts on a resource that does
not exist yet and stays notRead, with the reason a role's or a user's create has. 59 pairs move; none keeps the old
reason. --check re-derives the section from the two tables, and the IAM data drift gate checks the condition keys when
either changes.
IamService.heldTags reads a policy's, instance profile's, OpenID Connect provider's, server certificate's or virtual MFA
device's tags, and SAMLProviderService.heldTags a SAML provider's, each read in place in the ARN's account, a
pre-multi-account entry of the default account included; an instance profile or a server certificate, stored by its
name, only when its ARN, path included, is the one named. IamStoredResourceArns answers them.
The Service Reference now lists IAM's workload identity actions, which pinned botocore 1.44.14 does not model yet, and
the generator stopped on their tagging actions' request tags. Like classify's "no SDK operation of this name",
request_tag_context now skips an action botocore does not model, which no request Floci receives names; the table is
synced with their pairs in notRead.
IamResourceScopedPolicyEnforcementIntegrationTest checks that a caller allowed the read of each of five types only on
resources tagged team=blue reads the blue one and is refused the red one, and
ServerCertificateIamEnforcementIntegrationTest the same of certificates; IamStoredResourceArnsTest the reads and an
instance profile named by another path; test_regen_iam_condition_keys.py the new routing, the create kept unread and the
skipped tagging action.
|
||
|
|
fe03f90e5e |
fix(iam): read the bucket tag keys S3, S3 Tables and S3 Vectors name after a type (#9937)
The Service Reference gives S3's bucket and object s3:BucketTag/${TagKey}, which "Filters access by the tags associated
with the bucket", S3 Tables' table bucket and table s3tables:TableBucketTag/${TagKey}, S3 Vectors' vector bucket and
index s3vectors:VectorBucketTag/${TagKey}, and S3's access point s3:AccessPointTag/${TagKey}. The generator read
resource-tag keys only as <namespace>:ResourceTag/ and RDS's <namespace>:<type>-tag/, so none of them was read and a
condition on one never matched.
A key named after its own type, <namespace>:<Type>Tag/ (condition key names are not case-sensitive), now joins that
type's resourceTagKeys as RDS's do: the bucket's s3:BucketTag/. One named after another type whose resource path the
type's continues goes into a new containerTagKeys section, with that type's format in the type's variables
(parent_format, as tagParents builds a parent's): an S3 object's s3:BucketTag/ reads its bucket's tags, an S3 Tables
table's s3tables:TableBucketTag/ its table bucket's and an S3 Vectors index's s3vectors:VectorBucketTag/ its vector
bucket's, while their aws:ResourceTag/ keeps the table's and the index's own. The S3 User Guide says so of each: the S3
Tables key "acts on the tags applied to the table bucket that contains that table", the S3 Vectors key "references tags
associated with the vector bucket containing that index, while the aws:ResourceTag/tag-key will reference the tags of
the index itself", and s3:BucketTag is "applicable only after ABAC is enabled on your bucket", which S3's reader already
holds to. s3:BucketTag on an access point's object, whose ARN names no bucket, is not read. --check validates each entry
against the formats, --verify against the reference; the table changes in those entries alone.
IamConditionContextResolver.resourceTags adds the container keys, read from the stored tags of the container's ARN, and
S3's bucket policy checks read them with the bucket's ABAC tags: a request's own and a copy's of its source (CopyObject,
UploadPartCopy), which read no bucket tags before, aws:ResourceTag included. Floci does not model S3 access points, so
their s3:AccessPointTag and aws:ResourceTag read nothing, as before.
The Service Reference now gives athena:GetQueryResultStream the workgroup type, which the IAM data drift gate this
change runs reads: the table is synced, and no request member names the workgroup. docs/services/iam.md no longer lists
s3:GetBucketTagging, s3:DeleteBucket and DeleteBucketTagging as reading the bucket's tags apart, which #9920 removed.
S3BucketTagIamEnforcementIntegrationTest runs each of its checks with aws:ResourceTag/team and s3:BucketTag/team, a
cross-account copy among them; S3TablesIamIntegrationTest and S3VectorsIamIntegrationTest check that an allow on the
bucket's team reads that bucket and a table or index of it tagged otherwise, and refuses another bucket and its table or
index tagged with the team; IamConditionContextResolverTest that a table's two keys hold its bucket's and its own tags;
RequestResourceMembersTest the section's parse, lookup and refusals; test_regen_iam_request_resources.py the reading,
the vendored entries and the validation.
|
||
|
|
46252ae13e |
fix(iam): read an S3 bucket's tags once ABAC is enabled, and give its objects them (#9920)
The request-resources table gives aws:ResourceTag keys to S3's bucket and object types, but S3 gave IAM no tags, so an aws:ResourceTag condition on an S3 action never matched. The S3 User Guide says "you can control access to S3 resources based on the bucket's tags", that S3 "evaluates this condition key only after you enable ABAC on your bucket", and its example bucket policy conditions s3:GetObject on a bucket's objects on the bucket's tag. tools/aws/fetch_s3_tag_inheritance.py vendors those sentences and the example's object resource and condition key into tools/aws/sources/s3-tag-inheritance.json, refusing a reworded page. TAG_INHERITANCE_SOURCES grants it for s3, beside API Gateway, and tag_parents gives the object type, whose path continues the bucket's past a '/', the bucket as its tag parent. S3StoredResourceArns reads S3Service.storedTags: the tags of the general purpose bucket the ARN names, only while its ABAC status is Enabled, read in place with no legacy entry moved (the caller's bucket, or with the global bucket namespace the one of that name another account owns, one get per owning account), copied under the lock its tag writes hold, and none for an object or no bucket. Bucket names are one namespace here, a request signed for any partition reaching the same bucket, so the ARN's partition is not matched against the bucket's. IamConditionContextResolver gives an object its bucket's tags from tagParents, and no longer gives s3:GetBucketTagging, s3:DeleteBucket and DeleteBucketTagging the bucket's tags itself, ABAC or not. S3's own bucket policy check reads the same tags, so a bucket policy conditioned on aws:ResourceTag grants a caller from another account what it says. s3:BucketTag/<key> is not read: the generator's resource-tag key reading takes ResourceTag keys alone. The Service Reference and the IAM identifiers page changed upstream, and the IAM data drift gate this change runs reads both: tools/aws/sources/iam-identifiers.json and the table are synced, adding IAM's workload identity provider and template types and their operations, Bedrock's and Redshift Serverless's new types, and new Athena, Budgets and STS operations. The generator took a type of no variables of its own for the account's one, which every request names, even where its format lies within another type's the action acts on: Redshift Serverless's expressConfiguration, workgroup/express/express-default, is a workgroup of a fixed name, and GetCredentials was checked on it beside the workgroup its workgroupName names. Such a type is now named only by a request naming it, which leaves GetCredentials checked on the named workgroup alone. S3BucketTagIamEnforcementIntegrationTest checks that a caller allowed s3:GetObject, s3:ListBucket and the bucket's tagging actions only on resources tagged team=blue reads and lists a blue bucket with ABAC enabled and reads its tags, and is refused a red one and a blue one whose ABAC is off, its tagging actions included; and that a bucket policy granting another account s3:GetObject on blue buckets lets that account read the blue one and not the red. S3BucketStoredTagsTest checks the read and its refusals; IamConditionContextResolverTest that an object has its bucket's tags and that a bucket action's request context leaves the bucket's tags to its stored tags; test_fetch_s3_tag_inheritance.py the fetcher; test_regen_iam_request_resources.py the object's parent and the fixed-name type; IamRequestResourceEnforcementIntegrationTest that a caller allowed GetCredentials on one workgroup gets its credentials and is refused another's. |
||
|
|
1a52438dbc |
fix(iam): read API Gateway's stored tags and the tags its V1 resources inherit (#9903)
The request-resources table gives resource-tag keys to 66 API Gateway types, but API Gateway gave IAM no tags, so an aws:ResourceTag condition on an apigateway action never matched. Its Developer Guide also says that in the V1 API "child resources inherit the tags that are set on parent resources", naming RestApi, DomainName and UsagePlan as the parents, and that a stage's own tag "takes precedence" over the one it inherits. ApiGatewayStoredResourceArns reads ApiGatewayService.storedTags and ApiGatewayV2Service.storedTags: the tags of the caller's REST API, stage, custom domain name, API key, usage plan or VPC link, and of an HTTP or WebSocket API and its stages, by the first segment of the ARN's resource path, in its Region, read in place from each store with readInAccount, no legacy entry moved. The REST API's tag writes and the V2 service's now hold the service's monitor and replace the tag map instead of changing it in place, as the custom domain's, VPC link's, API key's and usage plan's already did, so a read copies a map no writer changes. tools/aws/fetch_apigateway_tag_inheritance.py vendors the guide's sentences into tools/aws/sources/apigateway-tag-inheritance.json, refusing a reworded page. The generator gives each type whose resource path continues a parent the page names past a '/' that parent, with the parent's format in the type's variable names (tagParents), from the formats alone: 27 types under RestApi, the 5 under DomainName the guide lists and 4 under UsagePlan; the V2 API's are under none. RequestResourceMembers reads it, and IamConditionContextResolver lays an ARN's own tags over its parent's, the parent's ARN filled from the ARN. The regeneration also takes the Service Reference's new ec2:FailoverVolumes. test_fetch_apigateway_tag_inheritance.py checks the fetcher's copy and refusals; test_regen_iam_request_resources.py the parent formats, the parents given and the check of them; RequestResourceMembersTest the read and refusals; IamConditionContextResolverTest that a method has its REST API's tags under its own and a V2 route none; ApiGatewayStoredResourceArnsTest each kind's read, a custom domain name and a VPC link of either API, a legacy usage plan read in place, and its copy; ApiGatewayPathArnEnforcementIntegrationTest that a caller allowed apigateway:GET on team=blue reads the blue REST API, its resources and a blue HTTP API, and is refused the red REST API, its resources and the HTTP API's routes. |
||
|
|
16bdd60072 |
fix(iam): check an AWS Backup recovery point on the ARN its request names (#9884)
The Service Reference gives AWS Backup's recovery point the format
arn:${Partition}:${Vendor}:${Region}:*:${ResourceType}:${RecoveryPointId}, a wildcard where the account goes, which
no ARN a request names matches as written, so every request naming a recovery point by its ARN
(DescribeRecoveryPoint, DeleteRecoveryPoint, StartRestoreJob and the rest) was checked on *.
The AWS Backup Developer Guide's table of resource ARNs gives each kind of recovery point's ARN with the account, or
nothing, in that place. tools/aws/fetch_backup_arn_formats.py vendors the table's recovery point rows as they stand
into tools/aws/sources/backup-arn-formats.json, refusing a row with anything else there, and writes the Service
Reference's format with the account variable in place of the wildcard. ARN_FORMAT_SOURCES grants it for backup, and
with_vendored_formats now takes a vendored format that has a variable for each of the reference's wildcards and
nothing else changed. The table's recovery point format becomes
arn:${Partition}:${Vendor}:${Region}:${Account}:${ResourceType}:${RecoveryPointId}.
Some rows give a recovery point no colon between its type and id, which that format does not fit (an EBS snapshot's
arn:aws:ec2:region::snapshot/*, a DynamoDB backup's table/*/backup/*). The fetcher also writes each row as a format
of its own, the last wildcard as ${RecoveryPointId} and one before it as ${Resource}, and the table gives the
recovery point those its format does not fit already (alternateFormats): EBS snapshots, EC2 images, FSx backups and
DynamoDB backups. RequestResourceMembers matches a type's ARN against its format or any of them.
The generic recovery point format also fits an IAM role whose path holds a colon, and the rule for an ARN member had
typed the roles StartRestoreJob, StartCopyJob and StartScanJob pass as recovery points. The generator now reads the
generated passed-roles table, as it reads the authorized-actions one, and reads no resource of an action from a
member it gives as a role the operation passes, whose ARN iam:PassRole is checked on: 98 rows in 83 operations go,
of which only those five could fit a role's ARN.
test_fetch_backup_arn_formats.py checks the fetcher's copy, its formats and refusals;
test_regen_iam_request_resources.py the account wildcard's replacement, the alternates kept and the passed-role rows
dropped; RequestResourceMembersTest the alternates' read and refusals; ResourceArnBuilderTest that DescribeRecoveryPoint
is checked on the ARN in its path, a Backup one sent encoded or not and an EBS one as an SDK encodes it, and
StartRestoreJob on its recovery point and not on the role it passes; IamRequestResourceEnforcementIntegrationTest that a
grant on one recovery point's ARN lets the caller describe that one and not another.
|
||
|
|
b13e8aa9cd |
fix(iam): read which ARN formats lie within others from the request-resources table (#9881)
An ARN a request member names may fit the formats of two types of its namespace: an endpoint group's ARN,
accelerator/<id>/listener/<id>/endpoint-group/<id>, fits its accelerator's accelerator/${ResourceId} too, the id
taking any character. The reader took such an ARN as the other type's when that type's format was the longer as
text, variable names counted, so a format with long variable names won over one that fixes more of the ARN.
The generator now gives each type the types of its namespace whose formats lie within its own and not the other way
(narrowerFormats), read from the formats as they stand, each variable matched as the reader matches it: the
partition takes no colon, the Region and the account none or more characters but a colon, any other variable one
or more of any. The reader takes an ARN as a type the resource does not read only when the table gives that type as
lying within every one of the resource's own that the ARN fits. make iam-request-resources-check derives the nesting
again from the formats.
Two readings change for real ARNs, each to the narrower type the action does not list: an AWS-managed RAM
permission (arn:aws:ram::aws:permission/...) named to an action on customer-managed permissions, and a multi-Region
access point's ARN named to S3 Control's tag operations, which no longer pass as an access point's.
test_regen_iam_request_resources.py checks the nesting of formats and that the check reports a table giving
another; RequestResourceMembersTest checks the reader reads and refuses narrowerFormats.
|
||
|
|
4d0287e6dc |
fix(iam): check DMS requests on the resources they name, from the DMS User Guide's ARN syntax (#9857)
The Service Reference ends every DMS resource type's ARN format in a wildcard where the resource goes
(arn:${Partition}:dms:${Region}:${Account}:endpoint:*), which the table reader matches as written, so no DMS request
was checked on the resource it names: one naming an endpoint, an instance or a task by its ARN stayed on *, and no
aws:ResourceTag condition on a DMS resource could match.
The DMS User Guide gives what goes there: "An ARN for an AWS DMS resource uses the following syntax:
arn:aws:dms:region:account number:resourcetype:resourcename". tools/aws/fetch_dms_arn_formats.py vendors that page
(the syntax, the sentence saying what its resource name is, and its table of formats) into
tools/aws/sources/dms-arn-formats.json, pairs the syntax with each Service Reference DMS format ending in a wildcard
by its resource type, and writes that format with the page's placeholder where the wildcard was
(arn:${Partition}:dms:${Region}:${Account}:endpoint:${resourcename}). A reworded page, or a table row whose type no
such format has, is refused. regen_iam_request_resources.py takes those formats as they stand (ARN_FORMAT_SOURCES,
granted for dms alone), each checked to differ from the Service Reference's only where its wildcard was, and verifies
the source against the live pages beside the other vendored sources.
The generator's existing machinery then names a DMS resource by the ARN a request passes, or fills the format from
the identifier a request names it by. DmsStoredResourceArns finds such an identifier, or an ARN DMS holds, as DMS
stores it (an endpoint's, an instance's or a task's ARN ends in the id DMS minted, not in its identifier; one stored before keys carried the account is the default account's and found too), and reads
the tags of an endpoint, instance, task or subnet group for aws:ResourceTag, both in place. A subnet group's ARN
ends in its identifier as DMS stores it, in lower case ("This value is stored as a lowercase string"), so the reader
resolves an ARN naming one in another case to that one (resolveStoredArn). A request leaving out
an optional ARN names the resource DMS uses for one naming none, of which it has none. A replication instance whose create
names no subnet group goes into the account's default replication subnet group, so the reader answers that group as
the one such a create acts on (findImplicitDefault), and the create is checked on subgrp:default.
The fetcher also copies what AWS answers each DMS create with, from AWS's recorded exchanges with DMS (the AWS
Emulator evaluation suite's wire tests, "a recorded exchange with AWS") and botocore's examples: whether the ARN of
what the create makes ends in a member of its request (a subnet group's in its ReplicationSubnetGroupIdentifier, an
event subscription's in its SubscriptionName) or in a value the request does not give (an endpoint's, an instance's,
a task's, a certificate's: botocore's example answers EndpointIdentifier "test-endpoint-1" with
endpoint:RAAR3R22XSH46S3PWLC3NJAWKM). The generator's rule for a variable a create's response answers, which stays open
whatever member a rule would fill it from, reads that too (with_recorded_mints), both for what a create is checked
on and for what its tags are checked on: CreateEndpoint, CreateReplicationInstance and ImportCertificate are checked on
what they make with its id open (rep:*), the tags of CreateReplicationTask, CreateDataProvider and
CreateInstanceProfile on what they make likewise, and no other row of the table changes. The creates of data
migrations, migration projects, replication configs and assessment runs have no recorded answer and keep their
fills. A modify renaming an instance is still checked on rep:<new name> beside its own ARN, nothing
being recorded for it.
The regeneration also takes the Service Reference's new SageMaker candidate, leaderboard and model monitor config
actions.
|
||
|
|
5eebe2f708 |
fix(iam): check the ses v2 legacy GET list routes as their actions (#9826)
The sesv2 model moved ListEmailIdentities and ListConfigurationSets to the POST /v2/email/list-* routes between botocore 1.43.104 and 1.43.105. SDKs built before that move still send GET /v2/email/identities and GET /v2/email/configuration-sets, which matched no route of the model, so those requests were allowed whatever the caller's SES grants were, an explicit Deny included. The REST route generator now reads those routes from botocore 1.43.104's own model: LEGACY names the release, and build_legacy vendors, for an operation both models hold on another route, the older route as an alternative checked as the operation's action. A regeneration carries them over offline, --fetch-legacy (make legacy-routes-sync) reads them again, and --verify compares the vendored block against the release. carried_legacy checks the vendored block. Closes #9818 |
||
|
|
3f881a6e24 |
feat(kinesisvideo): add stream lifecycle (CreateStream, DeleteStream, DescribeStream, ListStreams) (#9586)
Adds Amazon Kinesis Video Streams (kinesisvideo, REST JSON, 2017-09-30) with the stream lifecycle control plane: CreateStream, DescribeStream, ListStreams and DeleteStream, stored per account and Region. A stream's ARN ends with its creation time in milliseconds and is distinct for every stream, even one recreated within the same millisecond, and its KmsKeyId defaults to alias/aws/kinesisvideo. ListStreams pages by the last returned name, so deleting between pages skips nothing. Requests are checked against the constraints of the botocore model, vendored by tools/aws/regen_kinesisvideo_shapes.py, and refusals carry the codes and wording AWS sends. Under IAM enforcement every request is checked as its kinesisvideo: action on the stream it names, read through the stream's stored ARN and tags, and a tagged CreateStream also needs kinesisvideo:TagStream. The IAM data comes from the generators. A stream is ACTIVE as soon as CreateStream returns, and DeleteStream removes it at once, where AWS passes through CREATING and DELETING. |
||
|
|
1dc6478108 |
fix(iam): return GetFunction's tags only to a caller allowed lambda:ListTags (#9782)
The Lambda API reference says of GetFunction's Tags "Lambda returns tag data only if you have explicit allow permissions for lambda:ListTags", and the Service Reference lists lambda:ListTags among the actions GetFunction is authorized by. Floci returned a function's tags to every caller allowed lambda:GetFunction. tools/aws/fetch_lambda_response_permissions.py vendors, from the API reference page of each operation the Service Reference lists as authorized by an action beside its own and the reference's operations page documents, each response element's sentence saying it is returned only with a permission, with the element and the action. It refuses a sentence naming a permission and a lambda: action in any other wording, and a page whose response elements section is missing or lists no element without saying the response is empty, so a reworded or relaid page fails rather than dropping the check. The authorized-actions generator reads it into a returnedOnlyIf section, where botocore's response of the operation has a member of the element's name and the Service Reference lists the action among the operation's: GetFunction returns Tags only with lambda:ListTags. IamAuthorizedActions reads it, and LambdaController leaves the member out of a GetFunction response to a caller not allowed the action on the function, checked with the function's tags through IamEnforcementFilter.authorizeEntryResource. TagsError is not set, as no recording of AWS's answer for that case gives its code and message. IamEnforcementFilter.requestAuthorization, which hands a handler the caller the filter evaluated, now treats a blank Authorization header as no credential, as the filter itself does, and falls back to the presigned X-Amz-Credential; before, a request with a blank header and a query credential passed the filter as that credential and the handler's check as unsigned, so GetFunction returned Tags to a caller not allowed lambda:ListTags. |
||
|
|
76d93ddc32 |
chore(deps): bump botocore to 1.44.14 (#9789)
Moves the pin from 1.44.13 to 1.44.14 and regenerates the data derived from it, with the IAM tables read against
today's Service Reference.
1.44.14 models the AppConfig cloud extension client, which the Service Reference now lists AppConfig's
GetConfiguration for, so the request-resources table reads appconfigcloudextension beside appconfig and
appconfigdata; the online IAM data gate refused the table while the pinned botocore did not model it. It also models
the operations the tables parked as missing from the pinned botocore: 95 more request-resources entries (EC2's
secondary network ACLs and virtual edge network gateways, CloudWatch experiments and lookups, ACM, Glue, S3 Tables
storage lens configurations and channels, S3's default storage class and GetPart, EMR), CloudWatch's
CreateExperiment and UpdateExperiment in the passed-role table, and eight creates in the tag-on-create table. Glue's
CreateCatalog and UpdateCatalog pass one more role member, Redshift Serverless's custom domain associations change
shape, and the REST routes, query services and RPC v2 CBOR shapes gain the new operations; the rest of the
regenerated files are unchanged apart from their source label.
1.44.14 also types Redshift Serverless's ownerAccount as `.*(\d{12}).*` rather than an account id, so the
generator no longer reads it as one from the request alone; the snapshot GetSnapshot and RestoreFromSnapshot name
still takes it from the Snapshot structure's own ownerAccount, so the table is unchanged, and the generator test that
pinned the request-level reading now asserts the entries that carry it.
|
||
|
|
e4ee7816ad |
fix(iam): check each secret a Secrets Manager batch read returns as GetSecretValue (#9774)
The API reference's required permissions for BatchGetSecretValue say "you must have secretsmanager:GetSecretValue for each secret", and the Service Reference lists that action among the operation's. Floci checked the batch action only, so a caller allowed secretsmanager:BatchGetSecretValue read every secret, whatever its policies said about GetSecretValue on each one. The authorized-actions generator now reads that clause, already vendored by fetch_secretsmanager_required_permissions.py, into a perEntry section: the action an operation needs on each entry it reads, with the type of the action the clause's words name as the generators' names go (stem: secret is Secret), where the Service Reference lists the action among the operation's. IamAuthorizedActions reads it, and the Secrets Manager handler checks each secret a batch read returns against it, both by SecretIdList and by Filters. A secret the caller may not read goes to Errors as AccessDeniedException, under the id it was requested as (its ARN for a filtered read), and the others are returned, as AWS's own fidelity check records it (check_batch_get_secret_value_returns_partial_results_with_a_per_secret_error_for_a_denied_secret). Each secret is checked with the condition keys of its own stored tags (aws:ResourceTag/<key>, secretsmanager:ResourceTag/<key>), through IamEnforcementFilter.authorizeEntryResource, so a grant or a deny scoped to a tag holds for each secret of a batch as it does for a GetSecretValue of that secret alone. The gates this change runs need today's AWS too, so the tables they cover are synced: the Service Reference lists 37 more Glue actions with no resource type and S3 Tables' ListStorageLensConfigurations (iam-authorized-actions.json), S3 Tables' StorageLens type on its tagging actions with its ARN format and tag keys, and the elasticfilesystem-endpoint and s3files-endpoint namespaces it does not read (iam-request-resources.json), three S3 actions taking s3:ResourceAccount, GetBucketDefaultStorageClass, PutBucketDefaultStorageClass and GetIncompleteUpload (s3control-tag-condition-keys.json), and the S3 user guide's permissions table gives the two default storage class operations (tools/aws/sources/s3-required-actions.json). |
||
|
|
6563e6a315 |
fix(iam): check each layer a Lambda function adds as lambda:GetLayerVersion (#9769)
The Service Reference lists lambda:GetLayerVersion among the actions CreateFunction and UpdateFunctionConfiguration are authorized by, and the Lambda Developer Guide says what it is checked on: "Make sure that you have permission to call the GetLayerVersion API on the layer version". Floci checked neither operation as it, so a caller allowed to create or update functions added any layer version of its account, whatever its policies said about reading it. tools/aws/fetch_lambda_layer_permissions.py vendors that sentence from the adding-layers page, with the action and the resource it names, and refuses a page asking for permission to call an API in any other wording. The request-resources generator reads it (api_permission_resources): an operation the Service Reference lists as authorized by that action is also checked as it on each value of the request's member holding botocore's ARN shape for the type the words name (`<Type>Arn`, as minted_types reads it; `Layers`, a list of `LayerVersionArn`, for a `layerVersion`). CreateFunction and UpdateFunctionConfiguration now check lambda:GetLayerVersion on each layer version their Layers give, and a request giving none is not checked as it; no other operation changes. --verify reports an operation checked so whose action the Service Reference stops listing (verify_api_actions). CreateFunction is the first operation checked by parts that also tags what it creates, so IamEnforcementFilter now checks an operation's own action, where it is one of the parts, as it would be alone: with the request's tags (aws:RequestTag, aws:TagKeys) and carried values, not the bare part context. The checks made after it, the tagging action a create also needs, a companion and a forwarded action, are made on the resources that action was checked on, not on *, so lambda:TagResource is again checked on the function a tagged create makes. Another account's layer version is checked on its ARN alone: LambdaStoredResourceArns answers reachedInItsAccount for it, as Lambda reads such a layer in its owner's account through the owner's policy and never as the caller's layer of that name, where IAM also checked the caller's same-named layer before (GetLayerVersionByArn too). The table is regenerated against today's Service Reference too, which the online gate this change runs requires: AWS added SageMaker's leaderboard and model-monitor-config types (their ARN formats and tag keys, and the types of AddTags, DeleteTags and ListTags) and lists a backup-external namespace the table does not read. The docs and two comments in LambdaService and LambdaLayerService no longer say Floci implements no layer permissions. |
||
|
|
96819a87fd |
fix(iam): check a Secrets Manager request for the actions its required permissions give (#9758)
The Service Reference lists the actions each Secrets Manager operation is authorized by without saying when each is needed, so a request was checked as its own action alone: a BatchGetSecretValue using Filters without secretsmanager:ListSecrets, a CreateSecret adding replica Regions without secretsmanager:ReplicateSecretToRegions and a ValidateResourcePolicy without secretsmanager:PutResourcePolicy were all let through. Each operation's page in the API reference says it, in its required permissions: "If you use filters, you must also have secretsmanager:ListSecrets", "To add replica Regions, you must also have secretsmanager:ReplicateSecretToRegions", "Required permissions: secretsmanager:ValidateResourcePolicy and secretsmanager:PutResourcePolicy". tools/aws/fetch_secretsmanager_required_permissions.py copies that paragraph for each operation the Service Reference lists as authorized by another of its actions, with each clause's action and what it is needed for or on, into tools/aws/sources/secretsmanager-required-permissions.json. Two generators read it: - regen_iam_authorized_actions.py: an action needed when the request does something is a companion of the request member the clause's words name as the generators' names go (filters is Filters, add replica Regions AddReplicaRegions), where the Service Reference lists it for the operation and does not mark it as tagging, which the tag-on-create table checks. A companion a request member sets may now carry no session key. - regen_iam_request_resources.py: actions an operation always needs beside its own are each checked on what the rules read for it (ValidateResourcePolicy and PutResourcePolicy on the secret its SecretId names). A request checked by parts that names nothing is now checked on * as each action the table checks on the same resources as its own, not as its own alone, so a ValidateResourcePolicy naming no secret still needs PutResourcePolicy. The fetcher refuses a sentence naming a secretsmanager: action in a wording it does not read, so a reworded page fails rather than dropping a check, and the enforcement test runs on the AWS SDK. Not read: GetSecretValue for each secret of a batch, which AWS reports per secret in Errors rather than refusing the call; PutResourcePolicy for a cross-account replica and DeleteResourcePolicy for one stopped replicating, whose words name no member of the request; and the KMS permissions of a secret on a customer managed key. |
||
|
|
bdfc7c2161 |
refactor(iam): place an SQS redrive's actions by the guide's per-queue groups (#9751)
#9743 read which queue each action of a message move task is checked on from two parameter sentences of the API reference picked one by one (SourceArn's "only ARNs of dead-letter queues (DLQs)", DestinationArn's "specify the destination queue"), a list of the three operations' pages, and a reading of its own for ListMessageMoveTasks: a queue no parameter named was the one the row named the operation's own action of. The developer guide's steps to configure a redrive's minimum permissions group the actions by queue instead: "Permissions for the DLQ (source queue): sqs:StartMessageMoveTask, ..., sqs:ReceiveMessage, sqs:DeleteMessage, sqs:GetQueueAttributes" and "Permissions for destination queue: sqs:SendMessage". The fetcher now copies those groups, and group_permission_resources places each action the Service Reference lists an operation as authorized by on the queue its group names, the member of the request the group's words name as the generator's names go (the source queue is SourceArn, the destination queue DestinationArn), as CodeArtifact's destination repository is its destinationRepository. The parameter sentences, the list of operations and the own-queue reading are gone. The table is unchanged. |
||
|
|
1c84d5eccf |
fix(iam): check an SQS redrive as the actions its guide gives each queue (#9743)
StartMessageMoveTask was checked as sqs:StartMessageMoveTask alone, on both its SourceArn and its DestinationArn, so a caller granted the permissions AWS requires was refused on the destination, and one granted the action alone on the dead-letter queue was let through. ListMessageMoveTasks was checked as its own action alone. The Amazon SQS developer guide's table of a dead-letter queue redrive's minimum permissions gives each task's actions of each queue: "Add the sqs:StartMessageMoveTask, sqs:ReceiveMessage, sqs:DeleteMessage, and sqs:GetQueueAttributes of the dead-letter queue", "Add the sqs:SendMessage of the destination queue", and "Add the sqs:ListMessageMoveTasks and sqs:GetQueueAttributes of the dead-letter queue". The API reference names each queue's parameter: SourceArn "only ARNs of dead-letter queues (DLQs)", DestinationArn "specify the destination queue". AWS's own fidelity check (iam__sqs__sts/check_start_message_move_task_requires_composite_source_and_destination_permissions in aws/aws-emulator-evaluation-suite) refuses a caller granted sqs:StartMessageMoveTask alone on the dead-letter queue, naming sqs:ReceiveMessage on it, and lets the call through once the five are granted. tools/aws/fetch_sqs_redrive_permissions.py copies the table's rows and those parameter sentences into tools/aws/sources/sqs-redrive-permissions.json, a new PERMISSION_SOURCES entry, and the request-resources generator's task_permission_resources reads it: the row naming the operation's own action, each action on the resource the rules read from the parameter naming its queue, a queue the request names by no such parameter being the one the row names the operation's own action of. --verify checks each row's actions against the Service Reference's AuthorizedActions. Only StartMessageMoveTask and ListMessageMoveTasks change; CancelMessageMoveTask names its task by handle and keeps its reading. |
||
|
|
8440821793 |
fix(iam): read iam:AccountPropertyNamespaces from the keys PutAccountProperties sets (#9736)
The generated IAM condition key table had iam:AccountPropertyNamespaces in notRead on both actions the Service Reference lists it on, so a policy keyed on it matched nothing: the IAM user guide's DenyRoleManagerEnablement statement, ForAnyValue:StringEquals on RoleManager, let a caller enable role manager, and an Allow requiring the namespace refused every call. Neither botocore nor the Service Reference says where the value is; AWS's pages do. The IAM user guide's condition key table: iam:AccountPropertyNamespaces "Specifies the account property namespaces being read or modified in the request ... When you call PutAccountProperties or GetAccountProperties". The API reference on PutAccountProperties' Properties: "Each key uses the format Namespace/PropertyName. The key must contain exactly one / separating the namespace from the property name". tools/aws/fetch_iam_account_property_namespaces.py copies both sentences into tools/aws/sources/iam-account-property-namespaces.json with what they name: the key, the operation, the parameter, the format, its separator and the part that is the namespace. regen_iam_condition_keys.py takes that entry as it stands, refusing it unless the Service Reference lists the pair and botocore models the parameter as a map of strings, and writes it to a new fromMapKeys section, which the IAM context resolver reads from the request's map as the operation's handler does. GetAccountProperties names no properties, so it stays in notRead. |
||
|
|
5ed7187e28 |
fix(iam): read a federated assume's tags in its trust policy, and sts:TagSession from the generated tables (#9721)
Under enforcement a role whose trust policy conditions AssumeRoleWithSAML or AssumeRoleWithWebIdentity on aws:RequestTag/<key> or aws:TagKeys refused every tagged assume: neither trust policy saw the tags the assertion or the token passes, which the Service Reference gives both actions and the IAM user guide's SAML ABAC tutorial's trust policy reads. And all three assumes named sts:TagSession by hand, through AssumeRolePolicyEvaluator.TAG_SESSION_ACTION, with the assertion's PrincipalTag attributes and the token's tags claim named by hand too. The IAM user guide's page on session tags says where an identity provider passes the tags, "include the Attribute element with the Name attribute set to https://aws.amazon.com/SAML/Attributes/PrincipalTag:{TagKey}" and "the nested claim format uses a structure within the https://aws.amazon.com/tags namespace in the JWT", and what passing them needs, "trust policies for all roles connected to the identity provider (IdP) passing tags must have the sts:TagSession permission". tools/aws/fetch_sts_session_tags.py vendors it into tools/aws/sources/sts-session-tags.json, and regen_iam_authorized_actions.py gives both operations a companion naming the attribute or the claim, sts:TagSession, and the reference's aws:RequestTag/${TagKey}, where the reference's action of the operation's name takes that key. The SAML and web identity trust policies now read the tags as aws:RequestTag/<key> and aws:TagKeys, written as an AssumeRole's are, and check the companion's action for them; the assertion and token verifiers read the companion's attribute and claim. AssumeRole's trust check takes the tagging action the tag-on-create table gives it. TAG_SESSION_ACTION and the allowsTagging methods are gone. Closes #6640. |
||
|
|
b907da46b3 |
chore(deps): bump botocore to 1.44.13 (#9714)
Moves the pin from 1.44.9 to 1.44.13 and regenerates the data derived
from it.
Every request shape, route and service table the bump regenerates is
unchanged apart from its source label. partitions.json gains the
elb-proxy endpoint prefix signed as elasticloadbalancing, CloudFront
and EMR on EKS in aws-eusc, Route 53 Profiles in aws-iso and aws-iso-b,
and API Gateway in aws-iso-f; no region changes.
1.44.13 models the ELB proxy API (smithy-rpc-v2-cbor 2026-11-20), whose
operations the passed-role, tag-on-create and request-resources tables
parked as missing from the pinned botocore. They now read them:
CreateProxy passes roleArn and tags through tags{}, and each proxy
operation is checked on the proxy its proxyIdentifier or resourceArn
names. The Service Reference now also lists the tagging action for
Managed Service for Apache Flink's ImportSnapshot, so the tag-on-create
table checks its Tags.
|
||
|
|
7d3049d218 |
fix(iam): read a federated assume's source identity from its assertion or token (#9708)
Under enforcement a role whose trust policy conditions AssumeRoleWithSAML or AssumeRoleWithWebIdentity on sts:SourceIdentity refused every assume, and one that withheld sts:SetSourceIdentity was never consulted: neither operation read the source identity its identity provider sets, so the session carried none, the response returned none and its requests carried no aws:SourceIdentity. The Service Reference gives both actions sts:SourceIdentity but lists no authorized actions for either operation, and botocore models the value only in the response. The IAM user guide's page on source identity, which tools/aws/fetch_sts_source_identity.py already vendors, says where each carries it, "to set a SAML attribute for source identity, include the Attribute element with the Name attribute set to https://aws.amazon.com/SAML/Attributes/SourceIdentity" and "include source identity in the https://aws.amazon.com/source_identity namespace in the token", and what it needs, "trust policies for all roles connected to an identity provider (IdP) must have the sts:SetSourceIdentity permission". The fetcher now copies those sentences too, and regen_iam_authorized_actions.py gives each operation a companion naming the attribute or the claim and the key it is read as, where the reference's action of the operation's name takes sts:SourceIdentity. STS reads the value the table names, holds it to botocore's sourceIdentityType (the shape botocore gives the response's SourceIdentity, as it does AssumeRole's member), and refuses several values or one outside it with InvalidIdentityToken. The trust policy reads it as sts:SourceIdentity, through the keys the federated trust evaluators already read in full, and is checked for sts:SetSourceIdentity before the assume, as for AssumeRole. The session records it under aws:SourceIdentity, which a session assumed from it carries on, and the response returns it. Part of #6640. |
||
|
|
09a2cc0190 |
fix(iam): accept the regional EUSC sign-in endpoint as a SAML recipient (#9698)
Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
cc74f1c3a2 |
fix(iam): read an AssumeRole's source identity as the IAM user guide gives it (#9697)
Under enforcement an AssumeRole passing a SourceIdentity was neither held to sts:SetSourceIdentity nor read as sts:SourceIdentity, so a trust policy requiring a source identity refused every assume and one granting the permission was never consulted. The session kept no source identity either: the response returned none, its requests carried no aws:SourceIdentity, and a session assumed from it could set another. botocore gives the member and the Service Reference the key and the action, listing sts:SetSourceIdentity among the actions AssumeRole is authorized by, without saying when it is needed or which member carries the key. The IAM user guide's page on source identity says both: "to pass source identity while assuming a role, use the -–source-identity AWS CLI option or the SourceIdentity AWS API parameter", "to specify a source identity, principals (IAM users and roles) must have permissions to sts:SetSourceIdentity", and when chaining it is "required in both the permissions policy of the principal who is assuming the role and in the role trust policy of the target role". tools/aws/fetch_sts_source_identity.py vendors it into tools/aws/sources/sts-source-identity.json. regen_request_condition_keys.py reads it for sts (CONDITION_SOURCES), so sts:SourceIdentity is read from AssumeRole's SourceIdentity, and regen_iam_authorized_actions.py crosses it with the reference's AuthorizedActions and botocore's request members into a new companions section of iam-authorized-actions.json: AssumeRole needs sts:SetSourceIdentity when it names SourceIdentity or its caller carries aws:SourceIdentity. Enforcement checks the companion action on the role with the request's keys, and for a caller that is itself a role session checks it of the caller's own permissions alone too, since a trust policy naming the caller's role would otherwise stand in for them in the same account (the table's callerPolicyWhenChained, from the page's sentence on role chaining). STS checks it in the trust policy before the assume, as AWS names it where a statement granting both is conditioned on another sts:SourceIdentity. The session records the value under the key the table gives, aws:SourceIdentity, which its requests carry and a session assumed from it carries on, read there as sts:SourceIdentity too, and the response returns it. A chained request naming another value is refused with ValidationError, "The source identity is already set for this assume role session", and an AssumeRole naming a session tag key twice with InvalidParameterValue, "Duplicate tag keys found. Please note that Tag keys are case insensitive.", both as AWS's evaluation suite records them. Part of #6640. |
||
|
|
96ea43959c |
feat(eventbridgev2): tag and untag buses, subscribers and event sources (#9686)
EventBridge V2 took tags only when a bus, a subscriber or an event source was created. TagResource, UntagResource and ListTagsForResource now add, remove and list them, and IAM reads the changed tags for aws:ResourceTag conditions. AWS allows 50 tags on a resource, refuses keys that start with aws: in any case, and refuses to tag or untag a revoked resource. It lists the tags in the order of a HashMap copied from one filled in key order. One lookup finds the taggable resource for the tag calls and for the IAM resource tags, and each kind is tagged through a copy, so a failed write leaves its tags as they were. |
||
|
|
ee3970d6c9 |
fix(iam): read route53:VPCs from the vendored Route 53 developer guide (#9687)
Under enforcement a VPC association call scoped by route53:VPCs was refused for every VPC, as #8367 reports: the request condition key table never filled the key, so a condition on it never saw a value. Neither botocore nor the Service Reference says where a request carries the key or in what form. Route 53's developer guide says both, in its table of condition keys: route53:VPCs "Represents a list of VPCs in the request of AssociateVPCWithHostedZone, DisassociateVPCFromHostedZone, ListHostedZonesByVPC, CreateHostedZone, CreateVPCAssociationAuthorization, and DeleteVPCAssociationAuthorization, in the format of "VPCId=<vpc-id>,VPCRegion=<region>". A vendored source, tools/aws/sources/route53-condition-keys.json, written by tools/aws/fetch_route53_conditions.py from that page, gives each key the table gives in a format of request members, with its operations and members, and the generator reads it for route53 (CONDITION_SOURCES) beside the record keys it already reads. The table writes a key a format composes as that format with each member's place holding where the request carries it (VPCId={VPC.VPCId},VPCRegion={VPC.VPCRegion}), and a member of the query string as ? and its name (ListHostedZonesByVPC's ?vpcid and ?vpcregion), and the request condition reader fills the format from them, read from an XML body or the query string, when each member holds one value. A request naming no VPC, as a public CreateHostedZone does, carries none. Route 53 reads the VPC only where its schema puts it, the VPC below the request's root, where IAM reads it, and refuses a second VPC, a second VPCId or VPCRegion, or a repeated vpcid or vpcregion query parameter with InvalidInput, as it already refuses a change batch naming an element twice. It used to take the first VPC anywhere in the body, so a request naming a denied VPC beside another carried no value for the Deny to match and still acted on the denied one. Closes #8367. |
||
|
|
1b7ddb1101 |
fix(iam): read EKS access entry condition keys from the vendored Service Authorization Reference (#9682)
Under enforcement a CreateAccessEntry scoped by eks:principalArn or eks:accessEntryType was refused for every entry, and an AssociateAccessPolicy scoped by eks:policyArn or eks:namespaces for every association, as #8311 reports: the request condition key table read none of these keys, so a condition on them never saw a value. Neither botocore nor the Service Reference says which request member carries them. The Service Authorization Reference's table of the keys EKS defines says it: eks:principalArn, eks:kubernetesGroups, eks:policyArn and eks:namespaces filter on "the <member> present in the access entry requests" or in "the associate / disassociate access policy requests", and eks:accessEntryType and eks:username on "the access entry type" and "the Kubernetes username" present in them, the access entry requests' type and username. A vendored source, tools/aws/sources/eks-condition-keys.json, written by tools/aws/fetch_eks_conditions.py from that page, gives each key its member, and the generator reads it for eks (CONDITION_SOURCES) beside the cluster keys it already reads. The page gives what a request carries, so a vendored key is read from an action's request only where the reference lists it on the action itself; one the reference gives a resource type alone is the stored resource's value. A list's values are each read (kubernetesGroups, accessScope.namespaces). A vendored member the request carries outside its body, as DisassociateAccessPolicy carries policyArn in its path, or as a structure, as accessScope is, the page not saying which of its values the key holds, is not read. The keys the reference gives the access entry itself, its stored principal, type, groups and username on the operations acting on one, are not read yet: those requests are checked on an access entry ARN whose identity and id are left open, which names no one entry to read them from. Closes #8311. |