Secrets Manager was built by hand in ResourceArnBuilder. It now moves out of
HAND_BUILT into NAMESPACES, so every operation's resources come from
iam-request-resources.json, and the hand builder and the enforcement filter's
routing to it are gone.
The six characters Secrets Manager mints after a secret's name come from
botocore, which documents CreateSecret's Name: "Secrets Manager automatically
adds a hyphen and six random characters after the secret name at the end of
the ARN". A new rule records them as mintedSuffixes ("-??????") and has the
create name the secret it makes by Name. The reader appends them open to a
secret Secrets Manager does not hold. An ARN given for a secret, a partial
one included, is checked on the ARN of the secret the operations read it as,
alone: SecretsManagerService resolves it through resolveStoredArn to the
caller's secret in the ARN's Region, else to the one the ARN's account holds
under that full ARN, reading only.
ARNs the table renders, and the resource a create makes that its tags are
checked on, take the request's partition for every namespace, as the
Secrets Manager builder did, so a Region Floci does not know keeps the
partition of the request.
The Config handler read each member with asText, asInt or path and
checked only some of them by hand, so an empty or over-long Arn on the
two recorder Describe calls answered
NoSuchConfigurationRecorderException, and an empty ResourceArn on the
three tag operations was accepted, as was an over-long one that isn't
a Config resource's ARN.
tools/aws/regen_config_shapes.py now vendors every Config operation's
request constraints from botocore, kept in sync by make aws-data-check,
and RequestConstraintCheck checks each served operation's request
before it runs. A violation is a ValidationException, which the model
documents for missing required fields and input that fails validation,
and a Limit out of range answers the InvalidLimitException its
operation models.
The hand-written checks the table covers are gone, putConfigRule's
included: ConfigCfnProvisioner now checks the rule it builds as a
PutConfigRule request before storing it, so a template property outside
the constraints fails the resource. A rule without a ConfigRuleName
keeps its InvalidParameterValueException, since the model doesn't
require the member.
The loop that drops blob and timestamp members moves into
request_shapes as drop_blob_and_timestamp_members, used by both the
Config and Kinesis generators. Both vendored files are unchanged.
* fix(ec2): resolve interface identity for tag authorization
* fix(ec2): read resource condition keys through the generated table
* fix(ec2): look up a tag batch's interfaces in one pass
GetLayerVersion took an unversioned layer ARN as a literal layer name
and answered ResourceNotFoundException. It now resolves the ARN through
the existing layer resolver, keeping its account and partition checks,
and builds the archive URL from the layer's own Region.
Both GetLayerVersion and GetLayerVersionByArn take their IAM resources
from the generated request-resource table. The generator reads a
name-or-ARN alternative on URI and query members, and fills an ARN
variable from the integer shape named after it, so the layer version is
read from the model. A REST route keeps its modeled operation when AWS
authorizes it under another action name, and an ARN selector is checked
on the stored version it resolves to, in that version's account and
Region. The lookup tests share one layer archive fixture.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
ECS was not read by the request-resources generator, so under IAM enforcement
every ECS request was checked on *: a grant scoped to a cluster, service or
task definition was refused, and a deny scoped to one never applied. ecs now
moves into NAMESPACES, and where the rules misread it the rule is fixed:
- a member whose documentation spells a type of two variables as its format
does ("(family:revision)" for a task definition) is found by its service,
each element of a list, rather than read as an ARN alone;
- a member documented as naming its service's default when left out ("If you
do not specify a cluster, the default cluster is assumed") names it
(defaults), rather than naming nothing;
- a member documented as a name or an ARN of another type, in either order or
naming the type before them, reads that type's ARN (arnOf), as a pattern
taking one does;
- a list element's id field beside an enum field holding the target's type,
whose one value is the action's type, fills that type's last variable
(PutAttributes' attributes[].targetId).
The reader fills a defaults member from the default the service gives, finds
each value of one list member, and names a resource given by its own full ARN
for a type of several variables too, also giving the variable that ARN's value
beside the request's other members, as a handler may read either. EcsService
answers the lookups, reading only: the revision a reference the table finds
resolves to, and the default cluster. It now mints a service's deployments
and revisions under the service, as AWS does.
The ECS task arms of Step Functions now take the action from
IamAuthorizedActions and the resources from RequestResources.ofBody, as the
EMR arm does, so a service, cluster or task definition ECS does not have is
checked on the ARN the request names, as the direct call is.
CDK's ApplicationListener.addCertificates puts the first certificate on
the listener and emits one ListenerCertificate for each extra one. Floci
had no provisioner for the type, so it was stubbed as CREATE_COMPLETE and
did nothing; since the default certificate is held apart from the
listener's certificate list, such a listener came up with an empty list
and served none of its SNI certificates.
ElbV2CfnProvisioner serves the type now. Create adds the declared
certificates to the listener's list, as AddListenerCertificates does, and
delete removes the ones the resource added, recorded per physical id
because the id alone cannot carry them. Certificates updates in place, as
the resource reference says: the certificates the template gains are
added, then the ones it drops removed, and a failed update puts both back.
ListenerArn is create-only, so a change replaces the resource: the
certificates go onto the new listener, and come off the old one once the
update commits.
CloudFormation publishes no format for the resource's identifier, so Ref
returns <ListenerArn>|<suffix>.
AWS's published resource schemas have moved since the vendored tables
were last synced: AWS::Lambda::Function gained AcceleratorConfig and
RuntimeConfig, and AWS::ECS::TaskDefinition TrustedExecutionConfiguration.
That fails the online check of those tables, which this change runs, so
cfn-property-types.json and schema-surface.tsv are synced from AWS here,
and the three new properties are recorded as accepted and ignored.
EC2 network operations with resource-scoped policies were checked against
`*`, and stored ownership conditions were missing. Every EC2 request is
now read by the generated request-resource rules, its EC2 Query list
names from botocore, so a resource-scoped policy applies to each EC2
operation whose request names a resource. A list a type's ARN variable
names is the request's targets only when the request names nothing
else, and the sg-, acl-, rtb- and eni- id prefixes come from botocore's
examples.
Each target is evaluated with its own stored tags, under every EC2
type's Service Reference resource-tag keys, and tags on creation are
authorized separately. A forged SDK spelling cannot replace an EC2 wire
value. ENI creation tags are kept in the regional tag index and stay in
sync with CreateTags and DeleteTags.
Closes#8286Closes#8287Closes#8291Closes#8295Closes#8300Closes#8306
* fix(route53): populate record change IAM conditions
* fix(route53): align DNS identity and preserve XML validation errors
* fix(route53): read record change conditions from the generated table
AWS requires the customer managed key of an encrypted snapshot to be shared
with the account restoring it (Redshift Management Guide, "Sharing a
snapshot"). Neither botocore nor the Service Reference says so, so the
request-resources generator states it in FORWARDED, an evidence entry under
MEASURED's rules: the action and the snapshot type, with the rest read from
the metadata (the key type and format kms:Decrypt acts on, the snapshot
record's KmsKeyId member, the endpoint prefix, kms:ViaService).
Under IAM enforcement a Redshift or Redshift Serverless restore is then also
checked as kms:Decrypt on the key the snapshot records, found in the
snapshot's account, against the key policy and the caller's own policies,
with aws:ViaAWSService and kms:ViaService naming the service's endpoint. KMS
key policies are now evaluated as resource policies.
A key KMS would not use, disabled, pending deletion or not held, refuses the
restore, as KMS refuses the request the service makes with it. A snapshot
under AWS's own key records none, and one under an AWS managed key (a copy
grant made without a key) needs nothing, as AWS writes that key's policy to
let the account use it through the service.
The request-resources generator kept eight hand-written tables beside
its rules. Seven now come from botocore and the Service Reference, and
the eighth keeps only Floci's own coverage:
- CLIENTS_NOT_READ goes: reading Kinesis Data Analytics v1's client as
well changes no operation.
- MINTED_IDS: botocore's <Type>Arn pattern takes one more path segment
past a format that ends in a name (EventBridge's connections and API
destinations).
- UNQUALIFIED: the reference gives types whose formats are a type's and
one more :${...}, which no action acts on (Step Functions' alias and
version), or botocore documents a member as "name:<selector>"
(Parameter Store's Name).
- QUALIFIED_MEMBERS: botocore's shape takes an alias as well as the
type's ARN (Payment Cryptography's KeyArnOrKeyAliasType).
- FOUND_BY: botocore documents a type's key ("Scalable targets are
uniquely identified by the combination of resource ID, scalable
dimension, and namespace"), or a member names a type whose id no
request of the namespace gives (Redshift Serverless names, the Data
API's WorkgroupName); a keyed type is never filled from members.
- THROUGH: botocore's record of a thing the reference gives no type
holds its id beside members named after types (the Data API's
SessionData holds SessionId, ClusterIdentifier and WorkgroupName).
- ID_TARGETS keeps its coverage, EC2's instances; the id prefix comes
from botocore's documentation ("the instance ID (for example,
i-0123456789abcdef0)") and the list of resources from member shapes.
READ_IN_HAND_BUILT goes with CloudWatch Logs read whole, next.
The table changes only where the rules read more than the tables gave:
through entries for Athena query executions, named queries and
notebooks (their workgroup), CodePipeline executions, Cognito managed
login branding and terms, ECR layer uploads and an OpenSearch
migration, which no service answers yet, so no check changes;
QuickSight custom permissions and policy assignments found by name, as
their creates are; duplicate finds collapsed. Eight EC2 operations AWS
has since added are read.
The request-resources generator carried 106 CORRECTIONS over 22
namespaces, each a hand-written entry for one operation. They are gone,
and no Floci service states what an operation acts on either: a service
only looks up what it holds where an entry asks it to. Every operation
the corrections covered is now read from botocore's shapes and
documentation and the Service Reference, or, in two places, from a fix
to the handler whose behavior the correction worked around.
One table stays stated by hand, MEASURED, for what AWS was measured to
check where neither botocore nor the Service Reference says it. The
generator admits an entry only when it links to its measurement, names
types the reference does not list for the action, and gives what the
rules do not; review admits only real AWS evidence. It holds DynamoDB
ListTables, on table/* (#7336's probes and AWS's recorded denial), and
Step Functions SendTaskSuccess, SendTaskFailure and SendTaskHeartbeat,
on the token's activity or state machine (#7277's probes and AWS's
recorded denial). The generator's older hand tables (FOUND_BY, THROUGH,
MINTED_IDS, UNQUALIFIED, QUALIFIED_MEMBERS, ID_TARGETS,
CLIENTS_NOT_READ, READ_IN_HAND_BUILT) are unchanged.
Generator rules: documentation naming the type fills it when it says the
member is a name or an id as the variable is; an ARN head noun, or a
name ending in ArnList, makes an ARN member; fields of a top-level
structure and of the structures in a map are members; the id a create
answers beside another type's ARN is that type's (RunJobFlow's JobFlowId
and ClusterArn); an account-id member fills AccountId; a qualified
member fills first, and a ResourceId variable is the type's own id,
filled by a member named ResourceId before one named after the type. An
ARN member whose pattern names another service, or which its
documentation gives as the ARN of another type of the service, is not
read unless named after a type the action acts on. Each SDK client's
model is read apart, resources the clients disagree on carry their
endpoint, and a v2 load balancer's type is picked by its Type enum and
documented default. A variable no member fills is fixed to the one
value of an enum named after it that the operation's name gives
(CodePipeline's Custom action type owner), and a type named only by an
optional member documented as holding what the operation is about is
reached through that thing when the member is left out (EMR's
ModifyInstanceGroups, through its instance groups).
Reader and service changes: a member left out, or a JSON null, names
the service's default where it has one (Athena's primary workgroup and
AwsDataCatalog, EventBridge's default bus, per PutEvents entry); two
types whose formats differ by one variable are told apart by whether the
member names that default (EventBridge rules); a name for an id variable
is found by the service (Rekognition stream processors, Logs
deliveries); a bare id of the type an operation is about reaches the
acted-on type through its service (the project CodeBuild holds a build
under, the delivery destinations of the source a Logs
DeleteDeliverySource deletes). A member given a JSON null names nothing,
as the handlers read it, wherever the reader fills a variable from it,
so an EMR ClusterId or an IAM Identity Center TargetId of null no
longer names cluster/null or account/null. The table no longer has
absent or before, and the reader refuses a resource key it does not
know.
Checks that change where the old correction had no evidence of AWS
behind it: a Step Functions Local <stateMachineArn>#<test case> is
checked as given; Macie CreateMember on member/*; IAM Identity Center
ProvisionPermissionSet for ALL_PROVISIONED_ACCOUNTS on its instance and
permission set alone, the request-scoped account pinning that served the
account check removed; Logs DeleteDeliverySource on its delivery
destinations; a CodeBuild build id of no build Floci holds on *.
Handler fixes: Athena's ListDatabases, ListTableMetadata and
GetTableMetadata read Glue whichever catalog was named, so they were
also checked on AwsDataCatalog. They now refuse a catalog whose metadata
is not the account's Glue Data Catalog with MetadataException and are
checked on the catalog they name. Cost Explorer's cost reads ignored
BillingViewArn, so they were checked on *. They now answer the primary
billing view alone, refuse another with ResourceNotFoundException, and
are checked on the view they name.
The passed-roles table had drifted from the Service Reference and is
regenerated. AWS now passes CreateTrainingSession's role to
training-session.sagemaker alone, so its RoleArn is read rather than
left unread for naming two services, and AWS lists Secrets Manager's new
AssociateCrossAccountReplica, which the pinned botocore does not model
yet. The generator now leaves an operation no pinned model has unread on
its own, until a bump brings it in, in place of a hand-written entry for
each, so the two there were are gone.
The tag-on-create table had drifted too: AWS no longer lists a tagging
action for Network Firewall's CreateProxy, CreateProxyConfiguration and
CreateProxyRuleGroup, and lists five operations the pinned botocore
does not model yet. It is regenerated.
* feat(ssm): generate the IAM request resources for SSM
* test(ssm): enforce IAM on parameter reads, deletes and tagging
* refactor(ssm): derive the SSM request resources without corrections
* fix(iam): read a Parameter Store name as its parameter's ARN holds it
* fix(ssm): refuse tagging a resource type other than a parameter
* test(ssm): read an unslashed parameter by its ARN under a grant on it
* test(iam): expect ssm parameter in the vendored unqualified types
* fix(ssm): keep tagging documents and associations
* refactor(iam): drop the SSM operations read in the hand-built namespaces
* chore(iam): resync Route 53 record set protection resource types
* fix(cur): check every request against the model's constraints
* fix(cur): refuse report names the emitter cannot write to S3
* test(iam): modify a report definition with a billing view ARN the model accepts
A template can now create the three EFS types. They are provisioned
through EfsService, so a stack and a direct API call see the same
file systems, mount targets and access points.
- Ref and Fn::GetAtt resolve for every type.
- Updates change ThroughputMode, ProvisionedThroughputInMibps,
BackupPolicy, LifecyclePolicies, FileSystemPolicy,
FileSystemProtection and tags in place; create-only properties
replace the resource, and a failed update puts back what it changed.
- Backups are off on create unless BackupPolicy is ENABLED or the file
system is One Zone, and ThroughputMode provisioned requires
ProvisionedThroughputInMibps.
- Required properties are validated from the registry schema.
Ref #7972
Authorize generated instance targets with their own stored tags before mutation. Return malformed Query errors as XML HTTP 404, reuse enforcement group cleanup, and update generated-target regression coverage. Regenerate IAM metadata on current main.
Closes#8159
CreateDocument and CreateAssociation now keep their Tags, and AddTagsToResource, ListTagsForResource and RemoveTagsFromResource pick a document by name or an association by ID from ResourceType instead of always looking up a parameter. A document's tags are returned in its DocumentDescription and ListDocuments entry.
Read the SSM tag calls, CreateDocument and CreateAssociation from the
generated request-resource table instead of building their ARNs by hand.
A ResourceType enum value now picks its resource type ignoring case and
hyphens, ResourceId fills it whatever its kind, and a variable named for
leaving out the leading slash drops it, as a parameter ARN does.
Closes#7959
AuthorizeSnapshotAccess and RevokeSnapshotAccess record the accounts that may restore a
manual, available snapshot. The snapshot reports OwnerAccount and AccountsWithRestoreAccess,
DescribeClusterSnapshots takes an OwnerAccount filter that lists only what the owner shared
with the caller, and RestoreFromClusterSnapshot takes an OwnerAccount (or a SnapshotArn of
another account) and restores a shared snapshot from the owner's dump. A snapshot that is not
shared is refused with AccessToSnapshotDenied, and the grant does not outlive the snapshot.
IAM takes generated data only, so the RestoreFromClusterSnapshot correction is replaced by two
rules in regen_iam_request_resources.py. A top-level request member whose name ends in Account
gives the account of each type whose botocore structure has that same member: Snapshot has
OwnerAccount and Cluster does not, so the snapshot moves to the owner's account and the restored
cluster stays the caller's. Of several members that could fill a variable, one naming the type
before the variable wins over a bare one, so the snapshot's ClusterName comes from
SnapshotClusterIdentifier rather than ClusterIdentifier.
Across every operation the rules change only that entry, which also gains DefaultIamRoleArn and
RedshiftIdcApplicationArn as ARN rows that never match a cluster or snapshot, and CloudFront's
GetInvalidationForDistributionTenant, whose tenant is now filled from DistributionTenantId rather
than the invalidation's Id.
The handler's SnapshotArn check now resolves the partition through RegionResolver, as the
service's Region check does, so a Region outside the known partitions cannot make the two
disagree.
`SimulatePrincipalPolicy` read neither `PolicyInputList` nor
`PermissionsBoundaryPolicyInputList`, so a caller testing a policy it has not
attached, or a boundary other than the stored one, was answered about the
principal as it stands: a decision about a question nobody asked. Both members
have published behaviour, and `SimulateCustomPolicy` already read both, the
documents being its whole input, so this is the principal simulator dropping two
of its own.
A `PolicyInputList` document is "an optional list of additional policy documents
to include in the simulation", so each is evaluated with the weight of a policy
the principal holds: an allow in one allows an action the attached policies do
not, which is what the operation's own example in the API Reference turns on, and
a deny in one stops an action they allow. A `PermissionsBoundaryPolicyInputList`
document is the boundary that simulation runs with in place of the stored one,
"if a permissions boundary is attached to an entity and you pass in a different
permissions boundary policy using this parameter, then the new permissions
boundary policy is used for the simulation", and it is the boundary when the
entity carries none, the member being "the IAM permissions boundary policy to
simulate". The one-document limit both simulators are held to is read in one
place now rather than two.
Neither document is attached to anything, so no `PolicyExclusionList` identifier
reaches either: that member names the policies "actually attached to the
principal", where these are the request's own. A simulation leaving out every
part a `PolicyType` can name therefore still carries what the request handed in,
and a boundary handed in still holds the simulation down where the stored one was
left out.
Reading a document means being able to read it, so each supplied document is held
to the grammar before anything is decided from it. Four operations take
`PolicyInputList`, the two simulators and the two context-key readers, and each
takes "the complete, valid JSON text of an IAM policy". A text that does not
parse as a JSON object, and an object carrying no `Statement`, "the main element
for a policy. This element is required.", are both refused with the modelled
`InvalidInput`, 400, naming the entry by the index the request numbered it with.
A supplied permissions boundary carries the sentence that names no entry, the
member taking one document. Without that, an unreadable document was answered as
though the request had carried nothing at all: an unreadable identity document
left an attached allow still allowing, and an unreadable boundary was worse,
becoming a ceiling that allows nothing and turning an allow into an implicit
deny.
The 500 `PolicyEvaluation` the two simulators model is not that answer. It
carries no sender fault where `InvalidInput` does, and the two context-key
readers take this same member and model no `PolicyEvaluation` at all, so one
defect on one member would otherwise be answered two ways across the four
operations that take it.
A document already stored is read as it always was: it contributes no statements
and the decision is made on the rest, because a policy the account accepted once
must not make every later call fail. The supplied documents are read ahead of the
principal lookup now, which is where this package answers an input.
Either supplied document is also held to the shape the model declares, so one
past 131072 characters is a `ValidationError` naming the member under the index
the request numbered it with. The boundary list was read by the constraint walk
already; `PolicyInputList` was carried by hand for both simulators, which only
`SimulateCustomPolicy` needs: it requires the member and answers an empty list in
its own wording, "At least one PolicyInputList member is required.", where
`SimulatePrincipalPolicy` leaves the member optional and so has nothing of its
own in front of the walk. So the generator's exemption drops that operation and
the vendored shapes are regenerated from the pinned model, which adds the one
member to `SimulatePrincipalPolicyRequest`.
Four gaps in how the request-resources table reads a request, which the
review of #8154 found in its services and which hold for any service:
- A create whose action acts on no resource type had its tags checked on
`*` too, so a tagging grant scoped to the type it makes refused them. The
generator gives such a create the resource it makes (`makes`), and its
tags are checked there when the request's tagging action acts on that
type.
- An optional member holding the ARN of a type, left out, names the
resource its service uses then (`default`), which the reader asks the
service for: Resource Explorer's `Search` and `ListResources` with no
`ViewArn` are checked on the Region's default view.
- A field of each value of a map of structures, named after a type the
action acts on, names one resource for each value: an FIS experiment
template's create and update are checked on each action it names.
- An ARN naming another account is checked as given alone when its service
acts on the resource in that account: an OAM sink a link is made to, a
RAM invitation sent to the caller or a share another account owns.
Under IAM enforcement no Route 53 request but the delegation set calls
was checked: Route 53's model was not among the vendored REST routes,
and its namespace's request resources were not read, so no other
request was mapped to an action and the filter let it through. A
caller with no permissions could create, change and delete hosted
zones, record sets, health checks and tags.
Route 53's routes are now vendored and its requests read, now that
REST-XML path and query members are. Two generator changes name what
the rules did not:
- a path segment in ies names the type in y, so a bare Id after it is
that type's: ListTrafficPolicyVersions's, in
/trafficpolicies/{Id}/versions, is the traffic policy's, as the rule
for path labels already reads UpdateHostedZoneComment's hosted zone
and the other traffic policy calls;
- a member whose enum lists two or more of the action's types picks
the type: Route 53's tag calls, by ResourceType.
RequestResources drops a leading /<type>/ from an id, the path Route 53
returns its ids under, so a delegation set or hosted zone named that
way is the same resource. The delegation set calls go through the
vendored routes like the rest, and their hand-built action map and ARN
builder are gone.
Co-authored-by: mrfelek <17274927+mrfelek@users.noreply.github.com>
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. AWS Fault Injection Service, AWS RAM, CloudWatch
Observability Access Manager, AWS Resource Explorer, AWS Account
Management and AWS Control Catalog were among those: none of their 94
served routes had a rule.
Vendors the six models, so each route is checked as its operation's
action, on the resource its request names. A caller holding no grant
for them is now refused where the request used to pass; that is the
behaviour change.
Resource Explorer's five routes that S3 Vectors shares are matched on
the path without the prefix its filter moves them under. The FIS and
Resource Explorer tag routes are the shared controller's and keep its
bare /tags form. OAM's tag routes take the ARN as the rest of the path,
as the controllers serving them do, so an ARN sent with its slash
unencoded is checked too.
The request-resources generator reads these requests with no
hand-written correction, through four rules that hold for any service:
- A bare id after a path segment naming a type names that type:
/safetyLevers/{id}/state is the lever whose state
UpdateSafetyLeverState sets.
- A member fills the variables of a resource's own path before the
account its ARN is in, so Account Management's AccountId is the
member account of an accountInOrganization ARN.
- A type whose ARN is the account alone applies to a request leaving
out its optional account member, when that member names another
type: a request without AccountId acts on the caller's own account.
- A create makes its own type even when a member holds the resources
the action acts on: CreateResourceShare makes the share, and its
resourceArns are what the share holds.
Account Management finds that member account's organization and
management account in the caller's organization, through the lookup
the reader asks a service for the ARNs it stores, so a request naming a
member is checked on the ARN AWS checks.
The first rule also reads four CloudFront web ACL association
operations and four OpenSearch data source attachment operations on the
distribution or application their paths name. Floci serves none of
them.
An ARN fitting both a customer's format and one AWS owns is AWS's, so
an AWS managed permission is not also checked in the caller's account.
Regenerating the tables also brings in what AWS has added since the
last sync: eight Amazon Cognito user pool session operations and eight
Kinesis Analytics snapshot operations, none of which Floci serves. The
snapshot create's tags are read once the pinned botocore has it. The
count of tagged operations in iam.md is now the table's, 589, which
also takes 23 that earlier syncs added without moving it.
Under IAM enforcement no EMR Serverless request was checked: its model
was not among the vendored REST routes and its namespace's request
resources were not read, so no request was mapped to an action and the
filter let it through. A caller with no permissions could create, read,
update and delete applications and start and cancel job runs. A request
sent straight to /_emrserverless, the prefix its route filter moves
requests onto, reached the controller too, whatever it was signed for.
EmrServerlessRouteFilter now goes through SignedServiceRoute, as the
other filters that move a service's routes do: a request signed for
EMR Serverless is moved onto /_emrserverless, one sent to the prefix
signed for another service is refused, and the prefix it records lets
IAM match the vendored routes at the model's paths. EMR Serverless's
routes are vendored and its requests read, so an application call is
checked on the application its path names. Its namespace also leaves
the exclusions of regen_iam_tag_on_create.py and regen_iam_passed_roles.py:
tags a create sends are checked as emr-serverless:TagResource, and
StartJobRun and StartSession check iam:PassRole on the execution role.
Co-authored-by: mrfelek <17274927+mrfelek@users.noreply.github.com>
The Organizations handler read each member with asText, asInt or path,
so a Tags that isn't a list was read as no tags, a number where a
string belongs as its text, and a string MaxResults as a number.
Vendor botocore's Organizations request shapes with
tools/aws/regen_organizations_shapes.py, kept in sync by make
aws-data-check. Once the switch in handle finds a served operation,
walk the request against that operation's input shape with
RequestShapeCheck before the operation reads it, as Rekognition's
handler does. An operation Floci doesn't serve still answers
UnknownOperationException, whatever its body.
A mismatch is a SerializationException worded as DynamoDB's
deserializer words it. Organizations' own error and wording haven't
been measured.
The tag checks parseTags already makes still run: a null member counts
as absent in the walk, so a null or missing Key or Value and a repeated
key keep their InvalidInputException.
API Gateway was the one REST service besides S3 that the registry
authorized by hand: seven rules gave every management route its HTTP
method's action, apigateway:GET, apigateway:POST and so on, with two
named exceptions written in. Its routes were vendored for the coverage
test only.
The developer guide gives the management API's actions as the HTTP
verbs, and the Service Reference lists most API Gateway operations the
action of their route's method beside permissions AWS checks only when
the request carries what they guard, such as UpdateRestApiPolicy for a
resource policy or iam:PassRole for a role. The authorized-actions
table now lists those operations, 55 of them, under authorizedByMethod,
and a request on such an operation's route is checked as the action its
own method names: TagResource is a PUT in v1 and a POST in v2. The
other 132 are the single-action renames the table already held,
RejectDomainNameAccessAssociation and PutRoutingRule among them, or
keep the action of their own name, as the portal, portal product and
routing rule operations do.
So the rules go and API Gateway leaves the hand-routed scopes. Every
route Floci serves is checked as before. Its v1 tag routes are the
shared tags controller's, so they take an ARN sent unencoded and keep
the bare /tags forms, whose tagging form is a POST although v1 tags
with a PUT. v2's tag routes take an unencoded ARN too, as its
controller does.
The routes Floci does not serve, those of portals, portal products and
routing rules, are now checked as the actions AWS names for them rather
than as their method. A path no route of either model has, such as a
deployed API's execute path signed for apigateway, is no longer checked
as a management action: AWS authorizes an invocation as
execute-api:Invoke, which the execute path checks itself.
Regenerating the authorized-actions table also brings in two Lake
Formation operations AWS has added since,
GetGlueFunctionSessionContext and GetTemporaryGlueFunctionCredentials,
both authorized as lakeformation:GetDataAccess. Floci serves neither.
The passed-role generator imports the authorized-actions one, so the
online IAM gate checks the passed-role table for this change too, and
the table no longer held: AWS now passes EMR StartSession's role to
managed-compute.elasticmapreduce alone. Syncing it had failed since AWS
listed iam:PassRole for three more operations the generator found no
role member on, and asks a reason for.
CloudWatch Logs StartQuery names no role at any depth, in the pinned
botocore or the newest, so it is not read for that reason. SSM
RegisterDefaultHostManagementConfiguration and Kinesis Analytics
ImportSnapshot are newer than the pinned botocore, so their requests
cannot be read yet. They get a reason the sync and the offline gate
both refuse once the pinned models carry the operation, so a bump
cannot leave their roles unread. Floci serves StartQuery and neither of
the others.
That refusal caught two entries the pin had already outgrown. ECS
CreateGateway and UpdateGateway were excused as operations botocore
does not model, from the day the table was generated, and the pin has
had both for a while, each naming the infrastructureRoleArn of "the IAM
role that the gateway assumes to create and manage infrastructure on
your behalf". The reference passes it to ecs.amazonaws.com, so the
table reads it for both now. StartSession's role goes where the
reference sends it, and the hand mapping that picked elasticmapreduce
out of its two services is gone. Floci serves neither ECS gateway
operation nor StartSession.
* fix(lambda): retain MicroVM run settings and image version
Retain execution settings in run responses and stored MicroVM metadata, and select the requested image version. Validate request bodies with vendored model constraints through the shared request validator.
* fix(lambda): share connector defaults and verify list summaries
Use the same managed connector projection for image and MicroVM responses. Cover the requested version and unchanged summary fields in ListMicrovms, including explicit-version and omitted-version controls.
PutReportDefinition now stores its Tags on the report definition, and
TagResource, UntagResource and ListTagsForResource read and change them
by ReportName instead of answering empty stubs. ModifyReportDefinition
keeps the tags, a missing report answers ResourceNotFoundException, and
the TagList and TagKeyList constraints from the model are checked.
Closes#7952
PutReportDefinition and TagResource now fail with ValidationException when the report would hold more than 50 tags, when Tags is not a list, or when a tag key, value or TagKeys entry is not a string.
tools/aws/regen_cur_shapes.py vendors the TagResource, UntagResource and ListTagsForResource input constraints from botocore, and CurRequestShapes checks them, and the Tags of PutReportDefinition, through RequestConstraintCheck in place of the hand-written limits.
Recreate the reviewed Rekognition changes on the existing upstream main base using a verified commit. The complete file tree is identical to PR head 19f259b43e1ec8a3ce5fd2a50eb9c21e4ed604df, preserving the collection, pagination, persistence and model-validation fixes while removing the unsigned merge.
Generate constraints for every modeled operation with constraints=True. Select the served operation in the handler, validate its request once, then dispatch. Preserve UnknownOperationException for unserved actions.
Move constraint tests to the handler boundary and verify newly modeled operations are detected without maintaining an allowlist. Verified 189 Java tests, 55 generator tests, Checkstyle, generated-data, documentation and partition checks. Addresses review 5865133468.
CloudFront's REST routes were not in the vendored route table and its namespace's resources were not read, so under IAM enforcement no CloudFront request was checked: a caller with no permissions could create, change and delete distributions, cache policies, functions and the rest. Its botocore model is now in regen_rest_routes.MODELS and its namespace in regen_iam_request_resources.NAMESPACES, so each request is checked as the action of the operation its route names, on the resources the request names.
regen_iam_request_resources read requests of the JSON, Query, CBOR and REST-JSON protocols only, so a REST-XML request named no resource. It now reads a REST-XML request's path labels and query parameters, which RequestResources reads whatever the protocol, and not its body, which is not one it reads.
Creation tags stay unread: CloudFront wraps them in a Tags structure holding Items, which regen_iam_tag_on_create does not read yet.
Three CloudFront operation shapes were still checked on `*` or as no
IAM action:
- `stem` drops a trailing `config`, so a bare `Id` names the resource
whose config an operation reads (GetDistributionConfig and the other
...Config reads, and GetFieldLevelEncryption, whose type is
field-level-encryption-config).
- A member whose pattern takes only an ARN counts as an ARN when it is
named `Resource`, as well as when it is an identifier, so the tagging
calls are checked on the resource their ?Resource names. Members
naming another resource (a role, a monitor, a target) still do not.
- An operation whose own name is no action, and which several actions
authorize, is the one its name starts with as a word:
CreateDistributionWithTags is checked as cloudfront:CreateDistribution.
The same rule maps Keyspaces' CreateKeyspace, CreateTable, CreateType
and RestoreTable to cassandra:Create and cassandra:Restore, and
QuickSight's CreateTopicV2 and UpdateTopicV2 to quicksight:CreateTopic
and quicksight:UpdateTopic. A plural is no such word: S3's
DeleteObjects is checked for each object it deletes.
* feat(logs): support saved query definitions
Closes#7999
* fix: preserve saved-query retries and fence reset writes
Keep client-token request snapshots and returned IDs separate from mutable query definitions. Delayed create and update retries preserve newer content, reject conflicting input, and do not resurrect deleted definitions. Persist retry records with the configured account-aware CloudWatch Logs storage until reset.
Gate saves and deletes through beforeReset/afterReset under the service monitor so reset drains active writes and rejects new writes throughout the storage wipe.
Validation: 137 focused service, SDK integration, reset, and existing CloudWatch Logs regression tests passed. Checkstyle, docs-check, partition-check, and git diff --check passed.
* fix: validate saved queries against vendored Logs constraints
Include all three saved-query actions in the existing botocore constraint generator and share RequestConstraintCheck with delivery handlers. Return InvalidParameterException for saved-query constraints while preserving delivery ValidationException messages. Remove duplicated lengths, patterns, enums, list sizes, and type checks from the service and handler; retain domain checks for retries and query-language compatibility.
Reuse AwsTestClients for SDK integration fixtures. Cover modeled errors before service calls, nested parameters, valid maximum sizes, and existing saved-query retry/reset behavior.
Validation: 179 focused Java tests and 50 request-shape generator tests passed. Generated-data freshness, Checkstyle, docs-check, partition-check, and git diff --check passed.
Neither REST model was vendored in rest-routes.json and no rule mapped
their routes, so under enforcement every Security Hub and GuardDuty
request resolved to no action and was let through: a user with no
policies could EnableSecurityHub or ListDetectors.
- regen_rest_routes.MODELS reads securityhub and guardduty;
rest-routes.json takes their routes from botocore 1.43.118, and
iam-authorized-actions.json their actions of no resource type
(securityhub 31, guardduty 70). Nothing else changed.
- Both move from NOT_COVERED to NAMESPACES in the table of request
resources: 228 operations, 3350 over 46 namespaces, no other entry
changed. Security Hub's hub actions are checked on the caller's hub
in the Region, hub/default, the ARN Security Hub gives it, and
GuardDuty's detector and publishing destination operations on the
detector their path names.
- The generator gains a rule: an optional top-level member holding the
ARN of a type whose format has no variable of its own also names
that type when the request leaves it out. DescribeHub with no HubArn
is so checked on hub/default, as AWS checks it, rather than on *,
which would refuse a grant scoped to the hub. The rule changes no
other operation.
- Both move to NAMESPACES in the tag-on-create table too: an
EnableSecurityHub carrying tags also needs securityhub:TagResource on
the hub, a GuardDuty create carrying tags guardduty:TagResource, and
the create is checked with aws:RequestTag and aws:TagKeys.
Regenerated from the Service Reference retrieved 2026-11-11. It now
also gives two Lake Formation operations, GetGlueFunctionSessionContext
and GetTemporaryGlueFunctionCredentials, checked as
lakeformation:GetDataAccess; they are left to the next sync, which
--verify reports without failing. Macie is read by #7869.
IamRestRouteEnforcementIntegrationTest checks both services: a caller
with no grant refused, a grant scoped to the hub or detector let
through, another Region's hub and another detector refused, and a deny
holding under an allow on everything. IamTagOnCreateEnforcementIntegrationTest
checks a hub enabled and a detector created with tags: TagResource
needed, a request tag condition applied, and an untagged create
needing its own action alone. All four fail on main. iam.md says so.
Closes#7830
Closes#8000
Workgroup deletion bypassed saved-query storage and ignored RecursiveDeleteOption. Reject non-recursive deletion when saved queries exist, and remove saved queries and retry records before deleting the workgroup. Serialize deletion with named-query creation to prevent orphaned records.
Vendor all Athena input constraints from pinned botocore and check requests through RequestConstraintCheck. Remove copied named-query bounds and type checks, allow creation without a client request token, and share workgroup scans and isolated test-client setup. Update required-field expectations and cover generation drift, nested constraints, Unicode bounds, and untokened creation.
Move the standard member-constraint Messages implementation and formatter into RequestConstraintCheck, parameterized by error code. Migrate Athena, ECR, and both Payment Cryptography APIs and remove the redundant PaymentCryptographyShapeErrors class. Preserve HTTP 400, existing rule wording, operation-prefix removal, nested list paths, and each service error code with shared contract and service tests.
* feat(redshift-serverless): allow cross-account restore of a snapshot its policy shares (#7801)
RestoreFromSnapshot with an ownerAccount other than the caller's now reads the
snapshot from the owner's account and evaluates its resource policy for
redshift-serverless:RestoreFromSnapshot. A policy that allows the caller or the
caller's account grants the restore, an explicit Deny wins, and a snapshot with
no policy is not shared (AccessDeniedException). The dump is read from the
owner's directory and the restore targets the caller's namespace and workgroup.
* fix(redshift-serverless): restore a shared snapshot by the owner's ARN and check its policy under the service lock
A cross-account RestoreFromSnapshot with the owner's snapshotArn failed validation
because only the caller's account was accepted. The snapshot and its policy were also
checked before the service lock was taken, so a deletion, expiry or policy revocation
could land between the check and the restore. The check now runs under the lock.
* fix(redshift-serverless): evaluate a shared snapshot's policy through a ResourcePolicyProvider (#7801)
Move the snapshot policy check out of the service and into IAM enforcement, as SQS, SNS and S3 do:
- RedshiftServerlessResourcePolicyProvider supplies the snapshot's policy and the account in its ARN.
A statement with no Resource, as in AWS's own PutResourcePolicy example, applies to the snapshot.
- redshift-serverless leaves NOT_COVERED: namespaces, workgroups and snapshots are found by name through
StoredResourceArns, and RestoreFromSnapshot and GetSnapshot name the owner's snapshot when ownerAccount is set.
- Drop RedshiftServerlessSharedSnapshots and the snapshot-taking restoreFromSharedSnapshot overload.
* fix(redshift-serverless): derive snapshot account from the generator and find endpoint access ARNs (#7801)
Take ownerAccount as an account member in the request-resources generator and honor
account on found resources, replacing the hand-written CORRECTIONS entries and the
two-name branch in find. Answer endpointAccess in find. Share one call in
handleRestoreFromSnapshot.
* fix: derive account members from service models and reuse endpoint lookup
X-Ray is the one AWS service local stacks ask for and Floci does not have: SQS
and SNS already carry AWSTraceHeader, and nothing on the other end accepts the
segments that header points at. This serves the ingest loop, the summaries that
read it back, the service graph a console draws from it, and the sampling the
X-Ray daemon polls on its own timers.
The API is REST JSON on literal paths (/TraceSegments, /Traces, /TraceSummaries,
/ServiceGraph, /TraceGraph, /GetSamplingRules, ...), which S3's path-style routes
would swallow as a bucket name, so a request signed for the xray credential scope
is rewritten onto an internal prefix and every other request keeps its path. Only
the paths Floci serves are claimed.
What Floci stores is the segment document as sent: BatchGetTraces has to answer
exactly what PutTraceSegments accepted, so re-serialising through a model would
change what the caller reads. The summaries and the graph parse those documents
on read, which keeps the stored bytes the caller's and costs nothing while a local
stack is idle.
A filter expression is parsed, not pattern-matched: service("name"), hasError,
hasFault, hasThrottle, duration, responsetime, http.status, annotation.key,
comparisons, AND, OR, NOT and parentheses. Anything outside that set is refused
with InvalidRequestException naming what it could not read, because accepting a
filter and ignoring half of it hands a caller a superset and looks like a pass. A
lone '!' is refused the same way rather than left as a delimiter no branch
consumes, and responsetime is compared in seconds, the unit AWS uses.
The graph collapses segments into services by name, derives edges from parent ids,
and reports AWS's SummaryStatistics and cumulative DurationHistogram per node and
per edge. A node is a service, not a document shape: the same service seen once
with an http block and once without is one node.
Sampling answers the Default rule AWS serves in every Region, so a daemon has
something to sample at before any rule exists, and five rules per Region on top of
it. It is answered, not adapted: the reservoir is reported as the quota and
renewed every 10 seconds rather than decremented per report, and the service page
says so.
A local emulator runs for days, so the store is bounded to 10000 traces per Region
with AWS's 30 day window, oldest evicted first. A bad document is reported under
UnprocessedTraceSegments with its reason instead of failing the whole call, and
100 documents per call is the AWS limit, enforced.
Co-authored-by: David Guardiola <davidguardiola@gmail.com>
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. Lake Formation, Macie and Inspector were among those:
of their 33 served routes only Inspector's Disable had a rule, added by
hand. AWS's Service Reference gives 32 of those 33 actions no resource
type, so each is authorized on "*", which is what the route join added
in #7461 already checks when the model is vendored.
Vendors the three models, so all 33 are checked as their operation's
action. A caller holding no grant for them is now refused where the
request used to pass; that is the behaviour change.
The 33rd is Macie's CreateMember, on the POST /members it shares with
Security Hub, which AWS authorizes on the member it makes and with the
tags it carries. A correction fills the member from account.accountId,
so a grant or a deny scoped to one member holds, and Macie joins the
tag-on-create table, so a request with tags needs macie2:TagResource
and its tags are what aws:RequestTag and aws:TagKeys see.
Inspector's Disable rule goes, since the vendored route gives the same
action. Macie and Inspector move into the table of request resources,
their reason for staying out (no model vendored) no longer being true.
Lake Formation has no resource type at all, so that table does not
list it.
Regenerating the tables also brings in es:UpdateClone, which AWS has
added since. Floci does not serve it.
make iam-tag-on-create-sync has failed since AWS listed three more
operations with a tagging action, because the generator found no request
member carrying tags on any of them and asks for a reason.
SSM's StartExecutionPreview has no such member at any depth, so it is
not read for that reason. Athena's CreateSystemTableConfiguration and
SageMaker's CreateClusterExtension do take Tags, but the pinned botocore
predates both, so their requests cannot be read yet. They get a reason
of their own, which the generator refuses once the pinned botocore has
the operation, so a bump cannot leave their tags unread. Floci serves
none of the three.
The sync also lists the new applicationinsights namespace, and iam.md's
count of operations read with their tags follows the table.