Commit Graph
368 Commits
Author SHA1 Message Date
Oleksandr Nikolaichuk 523eba559e fix(cloudformation): create an EKS cluster with its encryption and network settings, a replacement included (#8739) 2026-11-17 18:53:23 -04:00
Oleksandr Nikolaichuk 790b93e739 fix(cloudformation): update a KMS key in place unless the engine says it must be replaced (#8718)
An AWS::KMS::Key update created a new key every time and left the old one enabled. The key now keeps its id: Description, KeyPolicy, Enabled, EnableKeyRotation and Tags are updated in place, keeping tags added outside the stack, and a failed stack update puts them back. A changed KeySpec, KeyUsage, Origin or MultiRegion fails the update, as the AWS::KMS::Key reference says. Create now honors KeyPolicy, Enabled, EnableKeyRotation, Origin and MultiRegion, and a key that a failed create or update leaves behind is scheduled for deletion.

Part of #6606
2026-11-17 16:33:26 -04:00
Oleksandr Nikolaichuk 9c9792a019 fix(cloudformation): update an EKS nodegroup in place unless the engine says it must be replaced (#8734)
An AWS::EKS::Nodegroup update no longer creates another nodegroup. One that changes no create-only property keeps its name and ARN, and its stack-managed tags are reconciled while tags added outside the stack stay; a failed update puts them back. A change to a property the registry marks create-only replaces the nodegroup and deletes the old one once the update commits. EksService cannot apply the other mutable properties, so the cluster and the nodegroup accept any change the engine reports beyond Tags with a warning. The nodegroup is created with its template tags, and a rolled-back replacement puts back the tag-key records of the entity it restores.

Part of #6606
2026-11-17 12:59:49 -04:00
Oleksandr Nikolaichuk a221e18838 fix(cloudformation): update an EKS cluster in place unless the engine says it must be replaced (#8730)
An AWS::EKS::Cluster update used to create another cluster every time, so an unnamed cluster left the old one behind and a named one failed. The cluster now keeps its name on an update the engine does not mark as a replacement, and the tags the last deployment wrote are reconciled from a recorded key list, leaving tags added outside the stack alone. A change to a create-only property (Name, RoleArn, EncryptionConfig, BootstrapSelfManagedAddons, OutpostConfig, AccessConfig.BootstrapClusterCreatorAdminPermissions or the network family and CIDR) replaces the cluster and deletes the old one once the update commits, and a failed update puts the tags or the prior cluster back. A Version change is accepted with a warning and not applied. EventBridge's tag reconcile now shares CfnRollback.reconcileTags.

Part of #6606
2026-11-17 09:07:49 -04:00
Yang Hao 93c1d39348 feat(account): implement GetAccountInformation and PutAccountName (#8725) 2026-11-17 06:58:24 -04:00
Oleksandr Nikolaichuk b3582da1f5 fix(ecr): list untagged images and honour tagStatus in ListImages and DescribeImages (#8684) 2026-11-17 05:57:04 -04:00
Priamo Germosen 8b1de6cdbe fix(iam): read the delegation request owner a policy condition names (#8688)
The Service Reference publishes iam:DelegationRequestOwner on the
delegation-request resource type rather than on the actions that act on one,
and only ListDelegationRequests carries the owner in a parameter. On the seven
others the value is the stored request's, so the key reached no request
context: an allow conditioned on it matched nothing and a deny conditioned on
it applied to nothing, where AWS evaluates both.

The table gains a fromResource section for a key published on a resource type,
each entry carrying the type, the member of its record the value is read from
and the type's ARN format. The filter then asks the service holding the
resource an ARN names for what its record keeps there, which is the
per-resource read that already gives a resource its tags, and the delegation
store answers through the port that already keeps IAM from depending on it.

Which member carries the owner is the one thing neither botocore nor the
Service Reference says, so the generator states it where it states anything by
hand, with AWS's own word quoted and linked: the key "Filters access based on
the AWS identity or principal that owns the delegation request", whose owner is
"the AWS identity or principal in the customer account that initiated or
received the delegation request". The generator refuses an entry whose evidence
does not link to itself, or whose member botocore's record of the type does not
hold as a string.

The owner is answered from the same scan the owner listing reads, by request id
rather than by owner, so an authorization costs a lookup rather than a pass over
the store under the lock every claim and expiry takes: this runs on every
request for the actions the key is published on, which the listing does not.

A call naming no request carries no value, so CreateDelegationRequest, whose
request does not exist while it is authorized, and a request nobody has claimed
are both left without the key rather than given a wrong one. The owner is
answered to the account that owns the request and to no other, the line the
service draws when it reads one request by id.

One difference stays and is on the IAM page: the same guide lists
UpdateDelegationRequest among the operations the key supports and the Service
Reference publishes it on neither that action nor a type it acts on, so the
generated reading is what this follows.
2026-11-16 21:15:46 -04:00
Priamo Germosen ef07bfd4b3 feat(athena): check the Glue permissions a DDL statement needs as the caller (#8657)
Athena runs a DDL statement against the Glue Data Catalog with the
caller's identity, so on AWS a caller without the Glue permissions a
statement needs starts the query, and the query fails with
"Insufficient permissions to execute the query." and the Glue denial.
Floci never checked them: under IAM enforcement a caller holding only
athena:* created and dropped Glue databases and tables through Athena.

Neither botocore nor the Service Reference says which Glue actions a
statement needs. Athena's user guide does, in its table "Examples of
database and table-level permissions":

- tools/aws/fetch_athena_glue_ddl_permissions.py vendors that table as
  it stands into tools/aws/sources/athena-glue-ddl-permissions.json:
  each statement's sentence and example policy, and the sentence that
  names the example database and table. --verify compares the file
  with the live page, and athena-glue-ddl-permissions.prompt.md says
  how to rebuild it when the page's layout changes.
- regen_iam_request_resources.py reads it as a source of the IAM
  request table (STATEMENT_SOURCES, for this table alone). Each action
  of a policy statement acts on each of its resources whose type the
  Service Reference gives the action, the type whose format the example
  ARN matches, its variables filled with what the page says the example
  names stand for. The table gains statementActions, the reference's
  types for each action, and statements. --check derives both offline,
  and --verify checks the types and the page. The sync also carries
  the Service Reference's changes since the last one.
- IamEnforcementFilter.statementRefusal checks those requests as the
  caller, the way a forwarded request is checked (aws:ViaAWSService,
  the caller's keys, the resource's policy), and returns AWS's denial.
  authorizeAdditionalResource's caller and decision steps move into
  helpers the two share.
- AthenaService checks CREATE DATABASE, CREATE [EXTERNAL] TABLE, DROP
  TABLE and MSCK REPAIR TABLE in the default catalog before running
  them, naming the database and table lowercase as Glue stores them
  (GlueService.normalizeName), and a denial fails the query with
  AWS's reason. As the guide says, DROP TABLE of a table without
  partitions needs no partition action; a table Glue cannot read for
  another reason fails the query.

AthenaGluePermissionsIntegrationTest runs the guide's policies under
IAM enforcement, and a deny on a lowercase name against a query that
spells it in capitals. RequestResourcesTest and the generator's and
fetch script's tests cover the rest, and athena.md says so.
2026-11-16 21:03:21 -04:00
Priamo Germosen 0741baf9da refactor(iam): state the restore kms:Decrypt check in MEASURED, not in a FORWARDED table of its own (#8649)
The request-resources generator stated facts by hand in two places:
MEASURED, what AWS checks where neither botocore nor the Service
Reference says it, and FORWARDED, added by #8309 for the Redshift and
Redshift Serverless restores asking KMS to decrypt with the snapshot's
key. The Redshift Management Guide sentences that entry cites are
MEASURED evidence, so the two restore entries are now MEASURED entries
naming another action AWS checks the caller for ({"action", "of"}),
admitted under the checks FORWARDED had, and FORWARDED is gone. MEASURED
is again the only hand-stated part of the file. The generated table,
the enforcement and the restore check are unchanged.

The table is also regenerated from today's Service Reference, which
added Glue's dataQualityEvaluationConfig and Lambda's runtime,
runtimeAlias and runtimeVersion resource types.
2026-11-16 18:11:51 -04:00
Jimmy Liu Jia 5f77b841a2 feat(cloudformation): provision SES event destinations (#8620)
* feat(cloudformation): provision SES event destinations
* fix(cloudformation): validate SES event destination replacements
* fix(cloudformation): apply SES event destination review feedback
* test(cloudformation): use shared stack waits for SES event destinations
2026-11-16 17:08:48 -04:00
Jimmy Liu Jia 3e0cd437d7 feat(cloudformation): provision SES configuration sets (#8551)
* feat(cloudformation): provision SES configuration sets
* refactor(cloudformation): simplify SES configuration set provisioning
2026-11-16 08:40:08 -04:00
luiseterc 2cbdef4b23 fix(rds): enforce lifecycle resource scopes and tags (#8401)
IAM enforcement now reads RDS requests from the generated
request-resources table: all 168 RDS operations are checked on the
resources they name, from the Service Reference and pinned botocore,
so a policy scoped to a DB parameter group, proxy, snapshot or other
RDS resource applies. Stored tags of RDS and DocumentDB resources come
from the existing tag lookups for aws:ResourceTag conditions, read
only, in the ARN's own account.

Closes #8396
2026-11-16 08:09:35 -04:00
Priamo Germosen 9eda97cf84 feat(emr-containers): emulate the EMR on EKS control plane (#8543)
Floci had no emr-containers service, so Airflow's EmrContainerOperator, the
aws emr-containers CLI and the SDKs had nothing to call. This adds its 25
operations: virtual clusters, job runs, job templates, managed endpoints,
security configurations and tags.

Job runs follow the job run states without running Spark on Kubernetes: a
run completes as soon as it is submitted, or after
floci.services.emrcontainers.job-run-duration-seconds. When Floci's EKS has
no cluster of the virtual cluster's container provider id, the run is FAILED
with "Cluster <id> does not exist." and CLUSTER_UNAVAILABLE, as AWS's "Common
errors when running jobs" page gives it; that page also gives the wording for
a job run on a missing or non-RUNNING virtual cluster. A job template's
${name} placeholders are filled from jobTemplateParameters or the parameter's
default. Deleting a virtual cluster clears its tags, as the development guide
says, only resources in an active state of the request's Region take tags,
and a job run's template and request tags together keep the 50-tag limit. A
virtual cluster created on an EKS cluster whose authenticationMode admits
access entries is access entry integrated, which ListVirtualClusters'
eksAccessEntryIntegrated filters on.

Every request is checked against botocore's emr-containers constraints,
vendored by tools/aws/regen_emr_containers_shapes.py and gated by make
aws-data-check. Routes sit under a signed-service prefix, so a path-style S3
request for a bucket named virtualclusters still reaches S3. The routes are
added to IAM's REST route table, and emr-containers to the IAM generators'
namespaces, so each operation is checked on the resource its path names,
StartJobRun and CreateManagedEndpoint need iam:PassRole on their
executionRoleArn, and the create operations need emr-containers:TagResource
for their tags, all from AWS's Service Reference.
2026-11-16 06:58:29 -04:00
Priamo Germosen 0b6077d374 fix(glue): check the Iceberg REST endpoint's routes under IAM enforcement (#8548)
No botocore model describes AWS Glue's Iceberg REST endpoint, so no
vendored route mapped its paths to an action, and the endpoint refused
every IAM principal under enforcement, letting only root credentials
and Floci's own query engine through.

- regen_rest_routes.py reads an endpoint botocore does not model from
  the AWS page documenting it (DOCUMENTED): Glue's "REST APIs for Apache
  Iceberg specifications" gives each operation's REST path, IAM action,
  CloudTrail event and a link to its definition in the Apache Iceberg
  REST catalog OpenAPI specification. Each row of the Iceberg REST
  Catalog API is the Glue operation its IAM action and CloudTrail event
  name, refused when they differ, on the method and path of the
  definition it links, under the root and the catalogs/{catalog} prefix
  the page's path gives. Rows of one operation are its route and its
  alternatives. Where the page's own path differs from the definition
  (DeleteNamespace's "namespces", CreateTable's GET), the definition is
  taken and the difference recorded. Nothing is typed by hand.
- Reading the page needs the network, so a regeneration carries the
  routes over from the vendored file, --fetch-documented reads them
  again, and --verify checks them against the page;
  documented-routes-verify runs in iam-data-verify.
- rest-routes.json gains the endpoint's ten Glue operations under the
  glue scope, and iam-authorized-actions.json lists glue's actions of
  no resource type, as it does for every routed scope. The same
  regeneration takes the actions AWS has added since: GuardDuty's
  ListInvestigationRecords and Route 53's IP guardrail policy actions.
- The controller's refusal of IAM principals goes. Each route is now
  checked as its Glue operation, on the account's Data Catalog whichever
  catalog the prefix names: the request-resource table reads no Glue
  member from an Iceberg request, so a grant or deny scoped to a
  federated catalog, a database or a table does not apply here.
  Floci's own engine's token is not checked again.
- A request a documented route takes is another API's, so it carries
  none of its operation's members: the enforcement filter has every
  member reader (request resources, condition keys, tag-on-create,
  passed roles) read none from it, so a Glue member a caller adds to an
  Iceberg body, such as Tags or DatabaseInput, names no resource and
  gives no condition key a value.

GlueIcebergIamIntegrationTest checks a principal allowed GetCatalog and
GetDatabase reading the configuration and the namespaces and refused
creating a namespace or loading a table, by GET or HEAD, a deny on the
catalog holding under an allow on everything, and root credentials and
a minted token answered, and a Glue member added to an Iceberg body
neither satisfying an aws:RequestTag condition nor naming a database.
glue.md and iam.md say so.
2026-11-16 00:45:42 -04:00
Priamo Germosen 53ef87af1c fix(iam): grant a delegation request's holder what the guide gives it (#8531)
Under enforcement, the identity that owns a delegation request was denied every
operation on it unless a policy named them, so a customer who claimed a request
could not read it, forward it, reject it or release its token without being
granted each one. AWS grants those by default. The customer page's note, under
"Managing Permissions for Delegation Requests", reads "By default, IAM
principals who initiate a delegation request are automatically granted
permissions to manage that specific request. They can associate it with their
account, view request details, reject a request, forward it to an administrator
for approval, release the exchange token to the product provider after admin
approval, and list delegation requests that they own."

So the holder now carries a grant over the requests it owns:
GetDelegationRequest with GetHumanReadableSummary, UpdateDelegationRequest,
which is the forward, RejectDelegationRequest and SendDelegationToken on those
requests, and ListDelegationRequests. The summary sits beside the read because
the reference puts it there itself: its "rules are identical to
GetDelegationRequest API behavior, such that a party who has permissions to call
GetDelegationRequest for a given delegation request will always be able to
retrieve the human readable summary for that request".

Listing names no resource, the Service Reference giving that action none, and is
scoped by the condition key the same reference publishes on it:
iam:DelegationRequestOwner, under ArnEquals, held to the owner's own ARN. That
is the line the guide draws between its two listing permissions, the table's
"List delegation requests for your account", which an administrator grants, and
the note's "list delegation requests that they own", which an owner has without
one. So an owner names itself in OwnerId and is answered with its own requests,
while naming another owner, or naming none, is refused, and the account's whole
listing stays with the granted permission. The key is read from the request's
OwnerId member through the IAM condition-key table, which names the member for
the pair so that the table's own gates re-derive it. The seven other delegation
actions the reference lists that key on take its value from the stored request
rather than from a parameter, so they stay unread.

The grant reaches whoever claimed the request, user or role session alike:
AssociateDelegationRequest stores "the ARN of the current calling identity", so
a session is recorded under its own assumed-role ARN and is looked up by that
rather than by the role it assumed. It is read where an identity's policies are
assembled, beside the password self-service grant that works the same way, so a
live request, a simulation and the user's access report all see it.

That lookup runs wherever policies are assembled, so on every authorized
request and not only on a delegation one. It answers an empty store without
reading it, and otherwise from a view of who owns what that one scan builds and
any stored write invalidates whole, so the usual answer costs a lookup rather
than a scan of every record in every account. Invalidating the view whole is
what keeps it true: nothing updates it in place, so a claim, an expiry and a
reload all land the same way. An emulator reset wipes the backend without a
request passing through that one method, so the service is Resettable and drops
the view in clear(), which makes the invariant a hook rather than a
coincidence of the store being empty afterwards.

Two abilities the note names are left out, each for its own reason. Approving is
not implicit: the same page lists iam:AcceptDelegationRequest among the
permissions an administrator grants, which is the step the flow keeps for one.
Associating cannot be granted here at all, because a request records no owner
until it is claimed, so before the claim there is no identity to write a grant
for; the claim still needs a permission and everything after it does not.

The ownership itself comes through a port rather than a new dependency:
DelegationRequestOwnership, implemented by DelegationRequestService and asked by
IamService, which is how ScpProvider and ResourcePolicyProvider are declared so
that IAM does not reach into another store.
2026-11-15 23:51:05 -04:00
Priamo Germosen e6f57d849d fix(iam): check Glue requests on the resources they name (#8529)
Glue was one of the namespaces the table of request resources did not
read yet, so under enforcement every Glue request was checked on *: a
grant scoped to one database or table could not allow anything, and a
deny scoped to one did not hold.

- Glue moves from NOT_COVERED to NAMESPACES and the generator reads all
  314 of its operations. A table operation is checked on the account's
  Data Catalog, the database and the table, the three types the Service
  Reference gives glue:GetTable and its kin; a database operation on the
  catalog and the database; jobs, crawlers, triggers, workflows and
  connections on the ARNs Glue mints for them.
- Where a Glue request names its resources in ways the generator did not
  read yet, its rules read a little further, each from botocore alone:
  Input and List drop from a member's stem as Config and plurals do
  (DatabaseInput.Name, ConnectionNameList); a list whose own list shape
  is named for the type's names fills it (BatchDeleteTable's
  TablesToDelete, a BatchDeleteTableNameList); "being" ends a type's name
  in documentation (GetWorkflowRun's Name, "name of the workflow being
  run"); a type of no variables of its own, the account's catalog, is no
  longer dropped as an alternative to the unnamed type a create makes;
  and a create whose request carries tags and whose action acts on other
  types alone tags the resource it makes when the request names it in
  full (CreateConnection's tags on connection/<ConnectionInput.Name>),
  which the table reader now accepts.
- Outside Glue those rules change four entries: Redshift's
  BatchModifyClusterSnapshots is checked on the snapshots its
  SnapshotIdentifierList names instead of *, and EventBridge's
  CreateEventSource and QuickSight's CreateDataSet and CreateTopic gain
  a makes that changes nothing at runtime. Every other entry is
  unchanged.
- What the table does not read stays as the metadata gives it: a
  CatalogId is not read, so another account's or a federated catalog is
  checked on the caller's account's ARNs, and a schema named by its
  registry and name on schema/<SchemaName>, the Service Reference's
  format, whose botocore pattern takes no slash.

IamRequestResourceEnforcementIntegrationTest checks a table on the
catalog, its database and itself, a database and a job on the ARNs Glue
gives them, a deny on one table or connection holding inside a batch
delete, a database's creation on its DatabaseInput.Name, a connection's
tags on its ConnectionInput.Name, and a workflow run on its workflow.
The generator's tests cover each rule; iam.md says so.
2026-11-15 23:50:07 -04:00
mrfelek cf4e1101a9 fix(s3vectors): check S3 Vectors requests under IAM enforcement (#8518)
Under IAM enforcement no S3 Vectors request was checked: its model was
not among the vendored REST routes and the s3vectors namespace's request
resources were not read, so every call went through. regen_rest_routes.py
now vendors its routes and the request-resources and tag-on-create
generators read the namespace, so a vector bucket call is checked on the
bucket its vectorBucketName or vectorBucketArn names, an index or vector
call on the index its bucket and indexName or its indexArn names, and
ListVectorBuckets on *. Nothing in IAM is written by hand for it.

The IAM tests of REST services (CloudFront, EMR Serverless, S3 Tables,
S3 Vectors) sign and send their requests through one shared
SignedRestRequests helper.
2026-11-15 19:59:56 -04:00
Maxence LEFEBVRE 9e05c07bfc feat(cloudformation): provision ElastiCache replication groups (#8448)
CloudFormation now provisions AWS::ElastiCache::ReplicationGroup instead
of completing the stack with no cache behind it. The group is created
through the ElastiCache service, Ref returns its id, and Fn::GetAtt
exposes the configuration endpoint for a cluster-mode group or the
primary, reader and per-node read endpoints otherwise. A create-only
change replaces the group, an explicit ReplicationGroupId that stays the
same is refused, and an update that reuses the group warns only about the
properties it ignores.

Optional booleans in the ElastiCache, IoT authorizer, API Gateway API key
and StackSet provisioners are read through
ProvisionContext.resolveOptionalBoolean, which refuses a value that is
neither true nor false instead of reading it as false.

Closes #8447
2026-11-15 11:40:48 -04:00
Priamo Germosen 92a61c2b86 fix(s3tables): check S3 Tables requests under IAM enforcement (#8424)
Under IAM enforcement no S3 Tables request was checked: its model was
not among the vendored REST routes and its namespace's request
resources were not read, so no request mapped to an action and every
call went through, DeleteTableBucket and the policy calls included.

s3tables is now vendored by regen_rest_routes.py and read by the
request-resources, tag-on-create and passed-role generators. A table
bucket call is checked on the bucket its path names. A table's ARN ends
in an id the service mints, which no request carries: a request names
the table by its table bucket's ARN, its namespace and its name. A new
generic rule in the request-resources generator reads such a type,
found by its service by those path labels (or GetTable's query string
members, when tableArn is absent), instead of filling the bucket's name
from the table's name or reading the bucket's ARN as the table's.
S3TablesStoredResourceArns answers it from the stored table, read only.
2026-11-15 10:47:17 -04:00
Priamo Germosen 0f223224ce fix(cloudformation): check CloudFormation requests on the resources they name, from the generated request resources (#8426)
CloudFormation was not read by the request-resources generator, so under IAM
enforcement every CloudFormation request was checked on *: a grant scoped to a
stack or a stack set was refused, and a deny scoped to one never applied.
cloudformation now moves into NAMESPACES (100 operations). One rule is fixed:
an account member named after another record's shape names that record's
account, not the type's (StackInstanceAccount is a StackInstance's), so a
stack instance call is checked on its stack set in the caller's account.

A stack or a stack set named by its name is checked on the ARN CloudFormation
minted for it, which CloudFormationStoredResourceArns finds, reading only, or
with its id open when it does not exist yet. A request naming its stack by
no StackName (a change set by its ARN alone, DescribeStackResources by
PhysicalResourceId alone) stays on *, as the generated data gives it.
DescribeStackSet now returns StackSetARN, which botocore gives and Floci
left out, in the Region of the request naming it.
2026-11-15 09:59:32 -04:00
Jackson Price b8014cbd4e fix(lambda): accept layer ARNs when deleting versions (#8409)
* fix(lambda): accept layer ARNs when deleting versions
* test(lambda): share layer publication cleanup
* test(iam): include layer deletion in the resource inventory
* fix(lambda): read Lambda's IAM resources whole from the generated table
2026-11-15 01:56:37 -04:00
Priamo Germosen 4a70910c53 fix(scheduler): check EventBridge Scheduler requests from the generated request resources (#8406)
EventBridge Scheduler 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.

A schedule a request names with no group is in the default group, as
botocore documents GroupName: "If you omit this, the default schedule group
is used" (CreateSchedule, DeleteSchedule), and "EventBridge Scheduler
assumes that the schedule is associated with the default group"
(GetSchedule, UpdateSchedule). The rule that reads ECS's "If you do not
specify a cluster, the default cluster is assumed" now reads this phrasing
too, and SchedulerService answers the default group's ARN, reading only. A
resource already chosen by whether its member names the default (an
EventBridge rule on the default bus or on another) takes no default of its
own, so EventBridge's entries stay as they are.

Tagging is checked on the group Scheduler's modeled /tags/{ResourceArn}
carries, the only tagging route AWS gives it. The shared tags controller
now serves a namespace the generated table reads whole only on the routes
its model gives: the bare /tags, or an ARN whose slash is not encoded, is
refused for Scheduler, EMR Serverless, GuardDuty and Security Hub with the
controller's existing "Invalid resource ARN", and tags nothing, rather than
being checked on * where a Deny on the resource would not apply.
2026-11-14 23:59:33 -04:00
luiseterc 4c7f057072 fix(secretsmanager): resolve stored resource tags for IAM conditions (#8359)
* fix(secretsmanager): resolve stored resource tags for IAM conditions
* fix(secretsmanager): read secret tags through the generated resource-tag keys
2026-11-14 21:33:20 -04:00
Priamo Germosen 1b14d10b1f fix(secretsmanager): check Secrets Manager requests from the generated request resources (#8365)
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.
2026-11-14 19:50:46 -04:00
soreavis 6de963848b fix(config): check requests against the modeled constraints (#8363)
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.
2026-11-14 19:35:00 -04:00
luiseterc 16745c3804 fix(ec2): resolve interface identity for tag authorization (#8352)
* 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
2026-11-14 18:42:23 -04:00
Jackson PriceandAndre Kurait ade406bac2 fix(lambda): accept layer ARNs in GetLayerVersion (#8345)
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>
2026-11-14 17:33:47 -04:00
Priamo Germosen 6305250206 fix(ecs): check ECS requests on the resources they name, from the generated request resources (#8341)
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.
2026-11-14 16:01:34 -04:00
Priamo Germosen 0816789e30 feat(cloudformation): provision AWS::ElasticLoadBalancingV2::ListenerCertificate (#8353)
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.
2026-11-14 15:02:33 -04:00
luiseterc 259a0737e7 fix(eks): populate cluster request IAM conditions (#8336)
* fix(eks): populate cluster request IAM conditions
* fix(eks): read cluster conditions through the generated table and refuse mistyped flags
2026-11-14 14:21:48 -04:00
luiseterc a138f88094 fix(iam): resolve EC2 network resources and ownership tags (#8288)
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 #8286
Closes #8287
Closes #8291
Closes #8295
Closes #8300
Closes #8306
2026-11-14 13:38:41 -04:00
luiseterc e2712cf344 fix(route53): populate record change IAM conditions (#8297)
* 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
2026-11-14 12:13:47 -04:00
Yang Hao 3e4d867de3 fix(account): check alternate contact requests against the model (#8312) 2026-11-14 11:29:06 -04:00
Priamo Germosen f09468fb19 feat(redshift): require kms:Decrypt on an encrypted snapshot's key to restore it (#8309)
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.
2026-11-14 11:04:31 -04:00
Priamo Germosen 9d73ca46e5 fix(iam): derive the request resources' remaining hand tables (#8273)
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.
2026-11-14 09:43:25 -04:00
Yang Hao 5f03ff975d feat(account): implement GetContactInformation and PutContactInformation (#8262) 2026-11-14 01:04:49 -04:00
Priamo Germosen 58930c9278 fix(iam): derive the request resources without corrections (#8187)
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.
2026-11-13 22:40:31 -04:00
Tyler Webb 39c29de635 feat(ssm): generate the IAM request resources for SSM (#8203)
* 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
2026-11-13 17:15:17 -04:00
Niels Kootstra 68a5f2a7f0 fix(cur): check every request against the model's constraints (#8236)
* 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
2026-11-13 17:10:30 -04:00
Kal Cramer f1a6260a94 feat(cloudformation): add AWS::EFS::FileSystem, MountTarget and AccessPoint (#8074)
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
2026-11-13 16:30:10 -04:00
irodotos7 2dc93aa087 fix(iam): derive EC2 instance authorization from AWS metadata (#8150)
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
2026-11-13 16:05:26 -04:00
Niels Kootstra 236e20003f fix(ssm): keep document and association tags and tag them by resource type (#8132)
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
2026-11-13 08:56:30 -04:00
Vũ Thế Huy 315367f21f feat(redshift): share a cluster snapshot with another account (#8077)
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.
2026-11-12 23:34:54 -04:00
Priamo Germosen 623bb15283 fix(iam): read the documents a request supplies, and hold each to being a policy (#8164)
`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`.
2026-11-12 20:59:23 -04:00
Priamo Germosen 40ec27593e fix(iam): check created tags, default views, FIS actions and cross-account ARNs (#8165)
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.
2026-11-12 20:59:03 -04:00
mrfelekandmrfelek 6b1ba4387a fix(route53): check Route 53's requests under IAM enforcement (#8090)
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>
2026-11-12 20:56:16 -04:00
Priamo Germosen 9f1cccf83f feat(iam): check FIS, RAM, OAM and three more services by their REST routes (#8154)
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.
2026-11-12 18:59:01 -04:00
mrfelekandmrfelek 0b6a6003b0 fix(emr-serverless): check EMR Serverless's requests under IAM enforcement (#8143)
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>
2026-11-12 16:46:38 -04:00
soreavis 9ead504085 fix(organizations): refuse a request member of the wrong JSON type (#8141)
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.
2026-11-12 16:10:12 -04:00
Priamo Germosen 81894c545d feat(iam): check API Gateway's routes by botocore's models (#8060)
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.
2026-11-12 16:07:36 -04:00