Commit Graph
111 Commits
Author SHA1 Message Date
Vũ Thế Huy e37f45f714 feat(redshift-serverless): allow cross-account restore of a snapshot its policy shares (#7801) (#7803)
* 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
2026-11-11 11:57:28 -04:00
dgl-aiandDavid Guardiola b144879127 feat(xray): serve traces, summaries, the service graph and sampling (#7733)
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>
2026-11-11 08:50:26 -04:00
Priamo Germosen dfec9737a6 feat(iam): check Lake Formation, Macie and Inspector by their REST routes (#7869)
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.
2026-11-10 22:47:39 -06:00
Aditya Upadhye 2d8cdeb343 feat: add CloudWatch OTLP metrics ingestion (#7781) 2026-11-10 18:39:55 -04:00
Andre Kurait ef1e00fba7 fix(controltower): generate IAM routes and request resources (#7872) 2026-11-10 10:46:59 -04:00
Priamo Germosen 90a4455905 chore(iam): sync the tag-on-create table with what AWS has added (#7852)
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.
2026-11-10 06:37:23 -06:00
luiseterc 3c398103ed fix(iam): resolve missing roles and EC2 tagging targets (#7596) 2026-11-09 18:28:31 -04:00
Murtuza Chhil ab312d68e6 feat(paymentcryptography): the card values and the authorization cryptograms (#7400)
* feat(paymentcryptography): the single DES decryption

The retail MAC closes its tag with a decryption under the right half of the
key, so the cipher package needs the Single DES decryption as well as the
encryption. It is the same cipher the encryption is, the other way round, and
it is BouncyCastle's like every other cipher here.

* feat(paymentcryptography): the card values and the authorization cryptograms

The card validation value is the three digit value of the X9 algorithm: the
account number, the expiry and the service code, enciphered under the card
verification key, and decimalized. The dynamic variants compute the value
from the transaction rather than from the card's own fields, and they take a
key of their own usage that may derive.

The authorization cryptogram is the ARQC of the transaction: the ISO 9797-1
algorithm 3 retail MAC over the transaction data, cut to eight bytes, under a
session key the request's derivation produces. The EMV common session key, the
EMV 2000 one, the Mastercard one and the Visa one are served. The American
Express derivation is refused rather than approximated: the AEIPS session key
derivation is proprietary and there is nothing to verify it against, and a
plausible wrong cryptogram is worse than an error.

The operations are written on the data plane as it is now: the hexadecimal is
java.util.HexFormat, the digests are the shared Digests, and the ciphers are
the BouncyCastle ones the package already uses. The routes of the card
operations are in the vendored rest-routes.json already, so they are
authorized by the generated rules and need no hand-written ones.

* test(paymentcryptography): the card operations over the SDK and the CLI

The unit tests call the operations directly, so they do not reach the routes
the requests travel, the JSON the body carries, or the rules that decide which
action a request is. The suite does, through a client that signs the request
the way a client of the data plane signs it.

The Java suite drives the card verification value and the authorization
cryptogram with the AWS SDK for Java v2, and the CLI suite drives them with
the AWS CLI. Both refuse the American Express derivation, the key of another
usage, and the value or the cryptogram that does not verify.

* fix(paymentcryptography): the card requests are checked against the model

The card operations' constraints were not vendored, so their requests were
checked by hand and only partly: the account number was read as the digits it
carried, the expiry and the service code were not checked at all for the
first card verification value, and the key an operation acted on was not
checked to be a key.

The constraints are in the model, so they are vendored now, the four
operations are checked against them before they look at the request, and the
checks that repeat them are gone.

The model states that the PAN sequence number is two digits and that the
application transaction counter is two bytes. The derivation reads the last
eight bytes of the packed PAN || PSN and the first two bytes of the counter,
so the longer values the hand-rolled checks allowed were read as something
other than the counter they stood for. The vectors are the ones the EMV
derivation gives for the model's inputs.

* docs(paymentcryptography): the card requests are checked against the model

The account number is digits, the expiry is four of them, the service code is
three and the PAN sequence number is two, the EMV ones as the model states
them. A formatted account number and a longer sequence number are refused
rather than read as the digits they carry.

* docs(paymentcryptography): the data plane's operation count

The Service Matrix counts the operations a service documents, and the data
plane documents four more now: the card verification value and the
authorization cryptogram.

* fix(paymentcryptography): the card operations raise the errors the model names

Three findings from the review, all in the card operations.

A key that may not be used for the operation was refused with
InvalidKeyUsageException, which the data plane's model does not name, so a
client cannot catch it as its own type. The data plane names three errors,
and a refusal that is not one of them is a ValidationException.

The ARPC method 2 read an ArpcInputFormat member that no model, and no SDK,
carries, so the branch it guarded could never be taken. The member is gone
and the response value is always made the way the reference makes it.

And a hexadecimal member of an odd length is a request the model allows and
the cipher cannot read, so it was answered with an internal failure the
caller cannot catch. It is refused with the error the model names, and the
refusal names the member.

* test(paymentcryptography): the card operations' members are covered

Seven members the card operations read were read by no test, so nothing
proved they work: the response attributes and the response code, the card
status update and the proprietary data, the track data, the unpredictable
number and the validation data length. Each is sent now, and the shape the
service receives with them is exercised.

The response value is made by both ARPC methods, and a request that asks for
none is answered without one.

* test(paymentcryptography): the padding type is refused

The padding type belongs to RSA, and the symmetric cipher does not pad, so a
request that names one is refused rather than answered with a cipher that
ignored it. Nothing sent one, so the refusal was never exercised.

* fix(paymentcryptography): the wrapped key is refused on every operation that carries one

The encrypt, decrypt and re-encrypt requests hold a wrapped key for the key
exchange, and the unwrapping is part of that exchange rather than part of the
cipher. A request that carries one is refused, as the PIN operations already
refused it, rather than answered as if the key were a fixed one.

The rule now lives in one place, so the two paths cannot disagree on it.

* fix(paymentcryptography): the master key is derived over the rightmost sixteen digits

The block the ICC master key is derived over is the rightmost sixteen digits of
the account number and the PAN sequence number, padded on the left with zeros
when they are shorter. That is the rule EMV 4.4 Book 2 Annex A1.4.1 gives for
Option A, and the Visa Integrated Circuit Card Specification states it the same
way.

An account number of twelve digits is therefore read and derived from, where
the derivation used to refuse it, and the refusal in the request layer goes
with it.

A derivation the request cannot be read for is refused with the error the
model names, rather than answered with a failure the caller cannot catch.

* test(paymentcryptography): the derivations are the ones the specifications give

The vectors are the ones the specifications publish: the ICC master key from
the EMV Option A derivation, the MasterCard proprietary session key and the
application cryptogram it produces over the same data from the M/Chip worked
example, and the common session key from the same document.

The common session key is compared with the parity bits masked, because the
document does not force the parity of the derived key and the derivation does
not affect the computation.

* fix(paymentcryptography): the dynamic value is the one Visa describes

The Visa Contactless Payment Specification gives the dynamic card
verification value in full: the leftmost four digits of the account number are
replaced by the transaction counter, and the result, the expiry and the service
code are enciphered under the card's unique derived key, which the issuer
derives from the master key with the account number and the PAN sequence
number. The three leftmost decimal digits of the result are the value.

The derivation used a session key and covered the account number as it stands,
so it was the emulator's own construction and not the value Visa describes.
The key it needs is the one the unique derived key derivation already makes,
and the request carries the PAN sequence number that derivation takes.

The counter is a binary coded decimal counter, so a counter that is not one
is refused rather than read.

* docs(paymentcryptography): the dynamic code is the emulator's one

* fix(paymentcryptography): the card value carries the length asked for

The model states the length of a card validation value as three to five, and
the service refused every length but three. The value now carries the number
of digits the request asks for, and the verification compares as many.

The dynamic value's counter is a binary coded decimal counter, so the digits
that replace the leftmost ones of the account number are zero padded on the
left to the four the field holds.

* fix(paymentcryptography): the card values and cryptograms as specified

The review of the branch found that the card values and the authorization
cryptograms did not follow the rules they are made by.

The Option B master key derivation turned the hexadecimal digits of the
hash into digits as it scanned them. The specification takes the decimal
digits of the hash first and only then the nibbles that are not decimal
digits, each reduced modulo ten, so the derivation now follows it.

The transaction data reaches the service already padded, because the
caller pads it the way the card padded it before the card enciphered it.
The service was padding it a second time, which enciphered a block the
card never enciphered. The data is enciphered as it was sent now, and a
length that is not a whole number of eight-byte blocks is refused,
because the ISO 9797-1 MAC runs over whole blocks.

The key table names the application cryptogram usage, the TDES_2KEY
algorithm and the DeriveKey mode of use for the ARQC key, so a key of
another usage, another algorithm or without the mode of use is refused.
The rules are asked in one place now, so the card operations and the
cryptogram operations cannot drift apart on what they accept.

The response value of the second issuer authentication method is made of
the card status update and the proprietary data, as the specification has
it. The response code belongs to the first method.

The EMV 4.1 tree derivation and the dynamic card verification code are
refused rather than approximated: the first is proprietary, and the
second was the emulator's own construction.

A verification that fails carries the reason the model names, and a key
that is not there is answered with a 404.

* refactor(paymentcryptography): the model settles the card value's length

The card operations refused a validation data length that was not three to
five digits, and a validation data that was not, while the model states
both. The model is checked before the operation runs, so the two checks
never reached the point where they could answer, and the model answers
the same request with the same error. The checks are gone, and the
model's own constraints have a test each, so the refusal is proved.

The class comment of EmvCrypto said the ARQC is made over the CDOL, and
it is made over the transaction data as the caller sent it, so the
comment says that now.

* refactor(paymentcryptography): the card side reads the shared helpers

The review found the card side holding copies of what the service already
holds, and the comments around them out of date.

The card operations read the request members through
PaymentCryptographyAttributes now, the same as the cryptogram operations,
instead of carrying their own text and soleVariant.

They read the key's material through PaymentCryptographyKeyRules.materialHex
as well. A key read back after a restart holds no material, and the shared
rule says so, where the raw accessor gave a null that the derivation failed
on.

The refused dynamic card verification code left its branch in the
computation and the track data and unpredictable number fields behind, and
the two-argument retailMac had no callers. They are gone.

The comments are in step with the code now: the class comment of the
cryptogram operations no longer calls the EMV 2000 derivation the common
one, the comment on the second issuer authentication method no longer
carries the response code in its input, and the class comment of EmvCrypto
no longer names OpenSSL or the original engine.
2026-11-09 11:18:07 -04:00
dgl-aiandDavid Guardiola 13640785a9 feat(signer): serve the Signer control plane for profiles, permissions and job records (#7680)
Signer was the last control plane Floci's CloudFormation provisioner stubbed:
SignerCfnProvisioner recorded only the identifiers a template handed it, with
a comment saying Floci has no Signer API. This serves the API, so an SDK, the
CLI or a stack sees the profile it actually created.

Cancellation keeps the profile, as AWS does: it stays readable through
GetSigningProfile with the same ARN and version and the status Canceled, it
stops accepting jobs, and ListSigningProfiles hides it unless includeCanceled
is set or statuses names Canceled. A PutSigningProfile on the same name brings
it back as a new active version.

A signing job fails by default, and says why. Nothing on this machine signs the
artifact, so a succeeded job would advertise a signedObject key that does not
exist and every download of it would fail; the job instead completes as Failed
with a statusReason naming the object that was not written, and RevokeSignature
refuses it because there is no signature to revoke. Metadata-only callers can
set floci.services.signer.mock-signing-jobs=true, which records jobs as
succeeded and is documented as a mock rather than as AWS behaviour.

Signer routes collide with S3's path-style ones, so a request signed for the
signer scope is rewritten onto an internal prefix before matching. That rewrite
used to happen before IAM resolved the action from the path, which left every
Signer call unchecked; IamActionRegistry now strips the internal prefix the
signing service owns, and SignerIamEnforcementIntegrationTest proves a key with
no policy is refused while one with signer:* is allowed.

Co-authored-by: David Guardiola <davidguardiola@gmail.com>
2026-11-09 09:08:00 -04:00
Allen Sanborn 3701d4d041 feat(ec2-instance-connect): SendSSHPublicKey, verified by the unmodified AWS agent (#7473) 2026-11-08 18:24:23 -04:00
Murtuza Chhil 6130fe9568 feat(paymentcryptography): the PIN operations (#7397) 2026-11-08 18:15:17 -04:00
Jimmy Liu Jia 6e75e4096e feat(securityhub): import and query ASFF findings (#7692)
fix(securityhub): validate provider fields and preserve default product metadata

fix(securityhub): preserve custom names and reconcile provider updates

fix(securityhub): prefer provider fields on first import

docs(securityhub): update findings operation count

fix(securityhub): validate initial verification state
2026-11-07 09:18:47 -04:00
Jimmy Liu Jia 856970a24f feat(apigateway): add documentation part operations (#7712) 2026-11-07 02:09:21 -04:00
Priamo Germosen ee2cdfc4f8 docs(iam): close the service principal's comma on what AWS publishes (#7617)
`CreateServiceLinkedRole`'s AWSServiceName was left with one question open.
The capture on #6042 quotes [\w+=.@-]* for it, without the comma the
vendored shape admits, and nothing recorded said whether AWS takes a comma
or refuses one, so the shape kept the model's pattern and the message the
captured text.

AWS's own API Reference entry for the operation answers the part that
matters. It gives the member a minimum length of 1 and the pattern
[\w+=,.@-]+, the comma included, which is what botocore declares for the
shape it aliases the member to as well. The comma is therefore what AWS
documents for this member rather than something that aliasing brought
along, the captured message is the only source that drops it, and a message
answers for the text a violation carries rather than for what a value is
held to. So what a principal is held to stays the published pattern and
nothing moves about what this service admits. The minimum is published
there too, which is why an empty principal stays refused for a reason of
AWS's own rather than the model's alone.

What is left is a reading worth pinning rather than inferred again: a
principal carrying a comma clears the shape and reaches the lookup, where a
service no recording covers has its role name derived from the principal's
labels, the answer any unrecorded principal gets. That reasoning lives in the
docs page alone, with the generator's comment and the test's javadoc pointing
at it, and a capture of AWS refusing a comma as a pattern violation moves the
quoted-pattern entry, the shapes file a regeneration writes from it, and that
test.
2026-11-06 23:02:22 -06:00
Priamo Germosen 6110825561 fix(iam): check the tags an OpenSearch domain is created with (#7616)
OpenSearch's CreateDomain and the legacy CreateElasticsearchDomain store
the TagList they carry, but the tag-on-create table did not read the
`es` namespace, so under IAM enforcement a caller allowed to create a
domain could tag it with no es:AddTags, and a policy allowing the create
only with some tag did not hold. The reason the generator gave, that no
rule maps its REST routes, has not been true since they were vendored.

`es` moves to the generator's namespaces. The Service Reference lists
OpenSearch Service's operations for the `es` client alone, so, as the
request-resources generator does, an operation of a vendored REST model
it lists for no client is read as the action of its own name: it needs
the tagging actions of the operations the reference lists that action
for, and is checked with the request's tags when that action takes
them. The `opensearch` client's CreateDomain is es:CreateDomain, which
the reference lists for CreateElasticsearchDomain beside es:AddTags, as
the OpenSearch Service developer guide's policy for creating a domain
only with a tag grants es:CreateDomain and es:AddTags. Both creates now
need es:AddTags on the domain they name, and are checked with the tags
as aws:RequestTag/<key> and aws:TagKeys (587 operations over 72
namespaces, no other entry changed).

The handler also read a TagList the model does not allow, and not as the
check reads it: a tag with no value was dropped, though the check lets it
replace an earlier tag of its key, and an object's structures were tags,
though the check lets a member of the same name replace them. Either got
a denied tag past a deny on it. The model requires a list of tags, each
with a Key of 1 to 128 characters and a Value of up to 256, so CreateDomain
and AddTags now refuse anything else with a ValidationException, before
changing anything, and the tags checked are the tags a domain gets.
2026-11-06 23:02:09 -06:00
Murtuza Chhil 4617e4a4f8 feat(paymentcryptography): the data plane as a service of its own (#7396)
* feat(paymentcryptography): the data plane as a service of its own

docs(paymentcryptography): the data plane has a page of its own

fix(paymentcryptography): a MAC under a three-key Triple DES key is computed

test(paymentcryptography): a key of another purpose does not encrypt data

feat(paymentcryptography): the data plane's IAM is generated

fix(paymentcryptography): a DUKPT MAC needs a base derivation key

fix(paymentcryptography): a key whose material is not held is refused

docs(paymentcryptography): the data plane's example runs

test(paymentcryptography): the data plane through the AWS SDK

test(paymentcryptography): the data plane through the AWS CLI

fix(paymentcryptography): the CLI test removes the keys it makes

docs(compat): the AWS CLI suite names the data plane

test(paymentcryptography): the route is read as the registry reads it

test(paymentcryptography): the request names its method and its URI

fix(paymentcryptography): the cipher pads no data

fix(paymentcryptography): the data plane takes the service scope

fix(paymentcryptography): a MAC length that is not a number is refused

docs(paymentcryptography): the data plane says the cipher pads no data

fix(paymentcryptography): the data plane ciphers with Triple DES as well

fix(paymentcryptography): the scope alias names the model's scope

fix(paymentcryptography): the Triple DES cipher is BouncyCastle's

fix(paymentcryptography): the usage and the blob keep their comments

fix(paymentcryptography): a key's family is read from its algorithm

fix(paymentcryptography): the cipher reads the vector through one helper

test(paymentcryptography): the keys are built by one builder

fix(paymentcryptography): the data plane checks the model's rules

fix(paymentcryptography): the Triple DES check value is BouncyCastle's

fix(paymentcryptography): the SDK names it TDES_2_KEY

docs(contributing): the ciphers come from BouncyCastle

refactor(paymentcryptography): the model owns the request shapes

refactor(paymentcryptography): the ciphers are BouncyCastle's

test(compat): one helper makes a key of either algorithm

docs(contributing): the cipher rule comes out

fix(paymentcryptography): the refusals are the model's

refactor(paymentcryptography): the ciphers are one helper each

refactor(paymentcryptography): the generators share the helper

docs(paymentcryptography): the javadocs name both ciphers

test(aws): the moved constants read from the shared helper

fix(paymentcryptography): the deprecated cipher constructors go

chore(paymentcryptography): the duplicate import goes

test(paymentcryptography): the DUKPT vectors the standard publishes

fix(paymentcryptography): the DUKPT refusal is the derivation's

docs(paymentcryptography): the retail MAC is over a double-length key

fix(paymentcryptography): the ISO 9797-1 MAC pads only a partial block

refactor(paymentcryptography): the refusals the model already makes

chore(aws): the routes are generated from the models again

* chore(aws): the IAM resources are generated again
2026-11-06 20:05:00 -04:00
jwoa95 f8670f64fb feat(quicksight): add metadata APIs and limited registered-user embedding (#7529)
Closes #7522

Origin comparisons preserved host casing and default ports, CSP named only the immediate parent, and expired sessions remained in storage indefinitely. Normalize both sides of origin checks, allow all configured ancestors, and reap expired sessions across accounts with the shared sweep worker.
2026-11-06 09:11:30 -04:00
luiseterc c3058a8de4 fix(iam): generate resource and request tag condition context (#7589) 2026-11-06 09:02:14 -04:00
Aymen JAMAAOUI 5bcb83b932 fix(iam): check Redshift requests on the resources they name (#7287)
Under IAM enforcement, Redshift requests were checked on `*`, so a
grant scoped to a cluster, a snapshot or a database user was refused,
and a deny scoped to one never applied.

The redshift namespace moves from NOT_COVERED to NAMESPACES in the
request resources generator, with corrections where the generated rule
checks the wrong resource. GetClusterCredentials now also gives the
redshift:DbUser condition key, from a new generated table, to its own
check and to the CreateClusterUser check that AutoCreate adds.

Refs #5907

fix(redshift): act only on a snapshot of the cluster the request names

A snapshot request is checked on snapshot:<cluster>/<name> for the
cluster it names, but DeleteClusterSnapshot, RestoreFromClusterSnapshot
and DescribeClusterSnapshots found the snapshot by its name alone. A
caller allowed on one cluster's snapshots could act on a snapshot of
another cluster by naming the allowed one.

A snapshot taken from another cluster than the one the request names,
in SnapshotClusterIdentifier, the cluster of a SnapshotArn, or
DescribeClusterSnapshots' ClusterIdentifier, is now not found.

Refs #5907

chore(iam): generate the Lambda Web and Redshift condition keys into one table

chore(redshift): read a restore's snapshot ARN once
2026-11-05 11:57:59 -04:00
Priamo Germosen a64fa37cd7 feat(iam): read IAM Access Analyzer's request resources (#7567)
Access Analyzer's routes are vendored, but the table of request
resources did not read the namespace, so a route of an action AWS
checks on an analyzer, GetAnalyzer, CreateAnalyzer and DeleteAnalyzer
among the ones Floci serves, was left unchecked under enforcement: a
caller with no grant on the analyzer was let through and a deny on it
never applied.

- access-analyzer moves from NOT_COVERED to NAMESPACES: 39 operations,
  1544 over 35 namespaces, no other entry changed. An analyzer is read
  as analyzer/<analyzerName> from the path or the body, the ARN Floci
  mints, an archive rule as analyzer/<analyzerName>/archive-rule/<ruleName>,
  and the operations naming an analyzer by its ARN, in the body or the
  query, on that ARN.
- With every operation of the scope in the table, the routes check
  each by the resources-read half of the join rule. No vendored route
  is left unchecked: every routed scope is read, built by hand, or of
  an action of no resource type.
- The REST reason of the namespaces not read yet no longer says the
  path is not read: RequestResources reads it from the vendored routes,
  which do not have those namespaces' models yet.
- access-analyzer is read by the tag-on-create table too, so a
  CreateAnalyzer carrying tags also needs access-analyzer:TagResource
  on the analyzer it names, and its own action is checked with them as
  aws:RequestTag and aws:TagKeys, as the Service Reference lists. The
  regeneration also takes Config's PutServiceLinkedConfigurationRecorder,
  which the reference has listed with config:TagResource since the last
  sync; Floci does not serve it.

IamRestRouteEnforcementIntegrationTest creates an analyzer and checks
GetAnalyzer, CreateAnalyzer and DeleteAnalyzer on the ARN Access
Analyzer gives it, a grant scoped to it, another analyzer refused and
a deny holding; the vendored-route test's unchecked example is gone.
IamActionRegistryTest checks the analyzer routes and keeps an unread
example on a fixture (Backup's GetBackupPlan); RequestResourcesTest
reads an analyzer from a path label and a body and an archive rule from
both; IamRestRouteCoverageTest pins the five operations Floci serves;
IamTagOnCreateEnforcementIntegrationTest checks a tagged CreateAnalyzer
needs TagResource on its analyzer and meets a request-tag condition,
and an untagged one CreateAnalyzer alone.
iam.md and access-analyzer.md say so.
2026-11-04 21:50:47 -06:00
Priamo Germosen 9062572948 feat(iam): read a REST request's resources from its path and query (#7499)
The table of request resources read only a request's body or Query
form, so no REST namespace was read: a REST request names its
resources in its path and its query. An OpenSearch Service request
naming its domain, DescribeDomain on
/2021-01-01/opensearch/domain/{DomainName}, was left unchecked by the
routes the previous change reads, as Floci could not check it on the
domain AWS checks it on.

- The generator reads a rest-json request's members in its path and
  its query as members, under their botocore names, and records where
  each one a resource reads is (`located`): a path label, `{Label}`, or
  a query parameter, `?name`. RequestResources lays them over the body,
  a label's value from the route the request matched in the vendored
  routes (IamActionRegistry.pathLabels, IamRestRoutes now capturing
  each label), a query parameter's from the query, so every kind of
  resource reads them as it reads the body's. A located member is read
  from where it is alone, as its handler reads it: one the body also
  gives is dropped.
- A namespace read this way also takes the operations of each botocore
  model Floci reads routes for under it (regen_rest_routes.MODELS) that
  the reference lists for none of its clients, each the action of its
  own name with that action's resource types, when the reference has
  that action: the reference lists OpenSearch Service's `es` client
  alone, while the `opensearch` client's operations are named after
  `es` actions. --verify checks such an operation's action and types
  against the reference's Actions, and reports one whose action AWS no
  longer has.
- `es` moves from NOT_COVERED to NAMESPACES: 120 operations, both API
  versions', 1505 over 34 namespaces. Every domain route Floci serves
  reads its domain, from the path, the body or `?arn`, on
  `domain/<DomainName>`, the ARN Floci mints. Those whose resource the
  table does not find (outbound connections, applications, insights)
  are routes Floci does not serve.
- Reading rest-json would also have read the Payment Cryptography data
  plane's key from its path; Floci serves only the control plane, so
  `payment-cryptography-data` joins CLIENTS_NOT_READ with its reason
  and its operations stay as they were. No other entry changes.

With the domain operations in the table, the routes check them by the
resources-read half of the join rule. IamActionRegistryTest checks the
domain routes and the labels a request's path gives;
RequestResourcesTest reads a path label, a query parameter and a body
together; IamRestRouteEnforcementIntegrationTest checks DescribeDomain,
DescribeElasticsearchDomain and ListTags on the domain they name; the
generator tests cover the located members, a member two clients locate
apart, the REST models' operations and a round trip through --check and
--verify. iam.md says so.
2026-11-04 08:05:50 -06:00
Hector Ventura 49f0837fd8 fix(paymentcryptography): accept a key ARN in every partition's regions (#7485)
CreateKey minted an ARN that the next request naming it was refused for in
GovCloud, EUSC and the ISO partitions. The vendored patterns widened the
partition the model writes but kept its region segment, which only fits a
two-letter prefix and one further part, so us-gov-west-1 and eusc-de-east-1
failed the full match.

The generator now widens the region on every pattern that carries it,
including the bare Region shape, to [a-z]{2,4}(-[a-z]{1,16})+-[0-9]+. The
pattern is slightly looser than the model, as the partition segment already
is, and still refuses a malformed ARN. Every region in partitions.json is
checked against it on both the Python and the Java side.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-04 05:22:17 -04:00
Hector Ventura e46579ec03 fix(apigateway): report the published regional hosted zones (#7487)
* fix(apigateway): report the published regional hosted zones

A regional custom domain reported the invented Z2FDTNDATAQYL2 everywhere outside
GovCloud, so a Route 53 alias built from it pointed at a zone AWS does not have.
Vendor the data plane table of the API Gateway General Reference page into
region-facts.json, with the GovCloud guide kept as a cross-check. A region with no
row keeps the placeholder, now documented as one. Stored domains keep their id.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* test(apigateway): read the regional hosted zone through the SDK clients

Create and read the custom domains with ApiGatewayClient and ApiGatewayV2Client, so the test also shows both SDKs parse the zone fields.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-04 05:17:48 -04:00
Priamo Germosen 251bb39375 feat(iam): check REST routes no rule maps by botocore's models (#7461)
A REST request gets its IAM action from IamActionRegistry's
hand-written rules, and a route no rule maps gets none, which the
caller allows: under enforcement such a request runs unchecked.
IamRestRoutes (#7085) reads botocore's routes at runtime, but only for
the operations a hand-written list enrolls, ValidatePolicy alone, and
only by literal paths.

A request no rule maps is now the operation whose route in botocore's
model it matches, and it is checked as that operation's action
(IamAuthorizedActions), as a Query or JSON request naming its
operation is, when Floci checks it on the resources AWS does: those
its request names, which ResourceArnBuilder builds for its namespace
or the vendored request resources read for the operation, or none,
when the Service Reference gives the action no resource type, as AWS
authorizes such an action on `*`. An action AWS checks on a resource
Floci neither builds nor reads stays unchecked, as before: checked on
`*`, a grant scoped to its resource would be refused. That is the
reason #7085 gave for enrolling ValidatePolicy alone, now read from
generated data instead of a list.

- The actions of no resource type come from the Service Reference's
  Actions, through regen_iam_authorized_actions.py, into
  iam-authorized-actions.json, for each credential scope whose routes
  rest-routes.json reads: 88 over 7 scopes. They are read from Actions,
  not Operations, because the reference lists one SDK client's
  operations per namespace, OpenSearch's `es` client alone. --check
  fails until a scope rest-routes.json adds is listed, and --verify
  fails when AWS gives a listed action a resource type.
- IamRestRoutes now matches every route of a model: literal segments,
  a label taking one segment, a greedy label the rest of the path, and
  the query a route names, which must be on the request. Of the routes
  a request matches, the most specific wins, segment by segment from
  the left a literal, then a segment mixing a literal and a label, then
  a label, then a greedy label; then the route naming more of the
  query. The path is the one the rules match, still percent-encoded and
  without a trailing slash, and a segment may still end in a matrix
  parameter, which the router ignores.
- The rules come first, so nothing they map changes. S3 and API Gateway
  are listed as handRouted, with their reasons, and routed by their
  rules alone: S3 tells apart the operations of one route by their
  query and headers, and API Gateway is checked by HTTP method. The
  route generator fails when one route names two operations of any
  other scope.
- OpenSearch Service's models, both API versions, are read under `es`:
  59 of their 147 operations are checked by their routes (29 of the
  `es` model's 51, 30 of the `opensearch` model's 96), 53 of which ran
  unchecked, ListDomainNames and ListVersions among them. The other six
  are the VPC endpoint operations #7351 mapped by hand: their rules are
  removed, as their routes give the same actions.
- Access Analyzer's 9 operations of no resource type are checked by
  their routes, ListAnalyzers among those Floci serves, where
  ValidatePolicy alone was; its analyzer operations are not.

Lambda's, EKS's, Scheduler's, Pipes' and DSQL's resources are built
by hand and their routes all mapped by their rules, so none is checked
differently. IamRestRouteCoverageTest checks every route of a scope
not hand-routed: by the vendored routes alone it is its own operation,
and through the registry it is its action when its resources are built
by hand or read, or its action has no resource type, and unmapped
otherwise.
iam.md and access-analyzer.md say which routes are checked.
2026-11-03 23:18:31 -06:00
Priamo Germosen 5c303afac6 fix(iam): check four more services on the resources their requests name (#7365)
Under IAM enforcement, DataSync, EMR, Rekognition and IAM Identity
Center requests were checked on `*`, so a grant scoped to a DataSync
agent, an EMR cluster, an Identity Center permission set or a
Rekognition custom model was refused, and a deny scoped to one never
applied.

The generated table of the resources requests name now reads them, 276
operations, from AWS's Service Reference and botocore as it reads the
earlier batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 1385 operations over 33 namespaces. Each resource
type Floci serves has the ARN format it mints: DataSync's
`agent/agent-<id>`, `location/loc-<id>` and `task/task-<id>`, EMR's
`cluster/<id>`, and IAM Identity Center's instances and permission
sets, with no Region or account. Of Rekognition, Floci serves the image
analyses alone, which act on no resource but a custom model.

Corrections, each with its reason:

- EMR requests naming a cluster by its job flow id, JobFlowId or
  JobFlowIds (AddInstanceGroups, AddJobFlowSteps, DescribeJobFlows,
  TerminateJobFlows and the four Set operations), are checked on that
  cluster: a job flow's id is the cluster's.
- EMR's AddTags and RemoveTags are checked on the cluster their
  ResourceId names, the one Floci tags, not on the one their ClusterId
  gives, which only scopes a session-scoped resource's tags. Read as
  generated, a ClusterId the grant covers would have let a request tag
  another cluster.
- EMR's ModifyInstanceGroups may leave out its ClusterId ("Required:
  No") and name each instance group by its id alone, which EMR then
  finds the cluster of. Such a request is checked on the cluster each
  group is in, where it was checked on `*`; a null ClusterId is read as
  none, as the handler reads it. An InstanceGroups that is not a list
  names no group to the check, and the handler now refuses it as naming
  none, where it modified the groups an object's values named.
- Rekognition's stream processor operations are checked on
  `streamprocessor/<Name>`: the Developer Guide's example gives a
  processor named streamProcessorForCam the ARN
  `...:streamprocessor/streamProcessorForCam`.
- IAM Identity Center's CreateAccountAssignment,
  DeleteAccountAssignment and ProvisionPermissionSet are also checked on
  the account their TargetId names, `account/<id>`, which the action
  acts on beside the instance and the permission set. A
  ProvisionPermissionSet for ALL_PROVISIONED_ACCOUNTS names no TargetId
  and provisions the permission set to every account it is provisioned
  to (the User Guide: up to 3,500 accounts that way, one with
  AWS_ACCOUNT), so it is checked on each of them, where a grant on the
  instance and the permission set alone let it through. Its TargetId
  names the account only for AWS_ACCOUNT, so a null one with
  ALL_PROVISIONED_ACCOUNTS names none.

The two lookups are the existing `through` entries, which named the
cluster or workgroup a Redshift Data session runs on: one may now read
each value of a list's field, and apply only `when` the request names
its resource no other way. StoredResourceArns.through gives a list of
ARNs, which EmrService and SsoAdminService now answer from what they
store, EmrService under the lock its handlers change clusters under.

Fixes the new formats needed:

- DataSync's ARN formats, and IAM Identity Center's applications' and
  trusted token issuers', name their account `${AccountId}` where every
  other format has `${Account}`. The generator now reads that slot as
  `${Account}`, so the caller's account fills it; a new Identity Center
  application was otherwise checked on `arn:aws:sso::*:application/*/*`,
  which no account-scoped grant matches.
- Identity Center's application providers are AWS's own,
  `arn:aws:sso::aws:applicationProvider/<id>`. An ARN of a type whose
  format fixes the account as `aws` is now checked in that account
  alone, not also as the caller's own copy, which does not exist and
  which a grant on the provider did not cover. An ARN of any other type
  giving the account `aws` is still checked as the caller's too.
- A permission set, an application or a trusted token issuer an
  Identity Center create makes is in the instance its InstanceArn
  names, whose id its ARN carries, `permissionSet/<instance id>/<id>`.
  It was checked with both ids open, which no grant scoped to an
  instance's permission sets matched. The generator now fills a variable
  no member fills from the ARN of another type the action acts on whose
  format is that variable alone, given by the ARN member named after it.

Left as generated, on `*`: Rekognition's CreateStreamProcessor and
StartMediaAnalysisJob, which name their collection or model two
structures deep, where the table reads none, and which Floci does not
serve.

Elastic Beanstalk and Redshift Serverless, which have as few resource
types, stay unread, each with its reason: an environment's ARN carries
an application name its requests do not give, and Redshift Serverless'
ARNs end in ids its requests name by name, so both need the stored
ARNs found first.

iam.md lists the four services, and AWS Payment Cryptography, which
the table already read, and gives the corrections, the rule for an
AWS-owned resource's ARN, and the cluster, accounts and instance the
lookups and the creates are checked on.
2026-11-03 17:14:32 -06:00
Aniket Shukla eb65ad88d2 feat(accessanalyzer): add basic ValidatePolicy checks (#7085)
* feat(accessanalyzer): add policy validation JSON endpoint

* feat(accessanalyzer): report policy grammar findings with source spans

* feat(accessanalyzer): secure policy validation pagination and IAM

* fix(accessanalyzer): report repeated policy keys

* fix(iam): authorize policy validation through modeled routes

* refactor(iam): resolve policy validation from vendored routes

* refactor(iam): share condition operator metadata
2026-11-03 13:51:07 -04:00
Ovidiu (Ovi) 3308ea2f1c feat(logs): add vended log delivery sources, destinations and deliveries (#7411) 2026-11-03 13:20:11 -04:00
Andre Kurait 16704ff32b fix(s3): resolve ResourceAccount conditions from the bucket owner (#7372)
* fix(s3): resolve ResourceAccount conditions from the bucket owner

* fix(s3): generate ResourceAccount action coverage

Read s3:ResourceAccount support from the Service Reference action table and carry each evaluated action into shared signed-request and service-call context. Preserve resolved bucket ownership, existing request tag coverage and SDK session-policy regressions. Reuse AwsTestClients for IAM and STS fixtures.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-02 23:52:33 -04:00
Andre Kurait 918c57a64e fix(dynamodb): authorize ListTables against its regional collection (#7336)
* fix(dynamodb): authorize ListTables against its regional collection

* test(dynamodb): reject ListTables authorization through ignored selectors

* fix: generate the DynamoDB ListTables request resource

Record the measured table collection as a generated correction and dispatch table-owned operations before hand-built fallbacks. Preserve batch, transaction and PartiQL resource extraction.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-02 22:24:56 -04:00
Andre Kurait bbe23ed550 fix(stepfunctions): authorize task callbacks against their resource (#7277)
* fix(stepfunctions): authorize callbacks with generated resource lookups

Preserve measured callback resource authorization, token ownership and closed-token behavior. Use explicit generated member lookups, retaining ordinary name resolution and invalid-token precedence. Preserve current main Redshift session-through lookups, generator type validation and payment alias consumers.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* test(stepfunctions): reuse the SQS callback queue fixture

Create callback queues through SqsTestQueue and await token JSON with the shared in-process helper. Retain the existing callback authorization matrix, token error precedence and cleanup registration.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-02 11:29:30 -04:00
Murtuza ChhilandPriamo Germosen 96d21c6782 chore(iam): the request-resources generator's own tidying (#7262)
* chore(iam): the request-resources generator's own tidying

The file has a few things the tooling complains about: the import of
the passed-roles helpers is too long for the line, the zip of the
resources with the marks does not say whether the two lists have to be
the same length, and the kinds of a resource are read as whatever the
untyped mapping holds, which a type checker cannot follow.

The kinds are now read through a helper that gives the strings they
are, the zip says it expects the two lists to be the same length, and
a vendored file that is not JSON is reported as an error the way a
missing one is, instead of a traceback.

* test(iam): the file the request resources gate reads

The gate reads the vendored file and reports a file that is missing, so a
file that cannot be read is reported the same way instead of ending in a
traceback. The tests call the gate with a file that is not JSON and with
one that cannot be read, under both the offline and the online mode, and
find the exit code and the message.

* test(iam): the read the gate cannot do, refused rather than denied

A file made unreadable is still readable by a run as root, so the test
refused the read itself instead of relying on the permissions of the
caller. The gate is asked for a file it cannot read either way.

---------

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-11-02 09:56:29 -04:00
Priamo Germosen c84e9249c9 fix(iam): check a Redshift Data statement in a session on the target the session runs on (#7300)
Under IAM enforcement, an ExecuteStatement or BatchExecuteStatement
naming only its SessionId was checked on `*`. A policy allowing one
cluster's or workgroup's ARN let a statement open a session there and
refused the next statement in it, and a deny on that ARN under an
allow on `*` let every statement after the first through.

A session runs on the cluster or serverless workgroup it was opened
on: ListSessions filters sessions "by session status, compute target
(cluster or serverless workgroup), or database", and the SessionId
"can then be used in subsequent ExecuteStatement and
BatchExecuteStatement operations". The Service Reference gives a
session no resource type, so the generator's new THROUGH names the
members a request names a resource through, with the types that
resource may be of: redshift-data:SessionId, on a cluster or a
workgroup. Each operation whose request has the member, and whose
action acts on one of those types, gets a generated
`{"types": [...], "through": "SessionId"}` entry, so there are no hand
corrections. The generator's validation and the Java loader reject a
`through` that is not one top-level member, or that sits beside any
other reading key.

For such an entry the reader asks the namespace's StoredResourceArns
through(member, value, region) for the ARN of the caller's resource
at the other end, and keeps it when it matches one of the types. When
there is none, as for a session that is closed, expired or another
caller's, it names nothing and the request stays on `*`; the Data API
then refuses it. RedshiftDataService now implements StoredResourceArns
for redshift-data, since it owns the sessions and builds their owner
scope: through gives the target ARN of the caller's open session,
through RedshiftDataSessions.targetArn, which find now shares; find
still gives the workgroup a name or an ARN finds, through the
resolver.

ExecuteStatement and BatchExecuteStatement gain the entry (1095
operations over 27 namespaces, unchanged). ListSessions takes a
SessionId too, but the Service Reference gives it no resource type,
so it stays on `*`. iam.md's sentence on EventBridge V2, which said
Floci does not serve it, now says how its requests are read.
2026-11-02 07:53:36 -06:00
Priamo Germosen b4c539d009 fix(iam): read a status and a service principal from the model (#7265)
Two members were held back from the vendored shapes because this service was
read as answering them in a wording of its own. Captures from a real account,
posted on issue #6042, answer both, and neither reading holds.

`statusType` is shared by `UpdateAccessKey`, `UpdateSigningCertificate`,
`UpdateSSHPublicKey` and `UpdateServiceSpecificCredential`. One hand-written
check answered all four, naming neither the offending value nor the permitted
set, which is what a 2025 recording of one of them carries. AWS names the set,
`Member must satisfy enum value set: [Expired, Active, Inactive]`, and answers
an omitted status as the required member it is rather than as a value outside
the set, which one check reading a null as a bad value could not tell apart.
Both are the model's own wording, so all four read it through the Query front
door and the check comes out.

The set is listed in the order AWS lists it, which is not the order botocore
declares. The values are the model's and the generator holds them to it: only
their order is read from the capture.

`AWSServiceName` on `CreateServiceLinkedRole` answered `InvalidInput` with a
sentence about its own bounds, where AWS answers a constraint violation naming
the declared pattern. A principal that satisfies the pattern and names no
service AWS has is still `InvalidInput`, so the layering the capture leaves in
place is the shape first and then whether the service exists.

The required-member message loses the word that stood where the value would
go. IAM names a member and leaves its value out everywhere, and the one
message carrying `Value null at` did so for want of a capture either way; the
capture answers `Value at 'status'`. The form moves in the one object that
decides it, so the eight refusals this package writes by hand move with the
walk, and the services that do quote their values keep the word.

The message quotes the pattern AWS quotes, which is not the one the shape
declares. botocore aliases that member to the shape it gives a group name,
`[\w+=,.@-]+` at 1 to 128 characters, where AWS's message gives
`[\w+=.@-]*`: the comma is gone and a `*` stands where the minimum is 1.
Only the message is in hand rather than the shape, so the generator records
AWS's text beside the model's and one object decides which text any
violation quotes, the way the enum order is read from the capture while the
values stay the model's. A comma is still admitted and an empty principal
still refused, and an empty one now breaks the minimum and the pattern at
once, as every other string member here does. The comma is what a second
capture would settle, and the difference is recorded in
`docs/services/iam.md`.
2026-11-02 07:53:11 -06:00
Hector VenturaandPriamo Germosen 0260a54ee2 chore: keep aws-cdk flags out of botocore-bump and tidy two follow-ups (#7271)
regen_partitions.py reads each region's optIn and s3WebsiteDashForm from the
aws-cdk checkout, so make botocore-bump could carry unrelated flag changes and
aws-data-check-botocore accepted them. Add --carry-region-flags, which keeps the
stored flags and refuses a region with none, and use it in the botocore-only
targets. aws-data-sync and aws-data-check still read aws-cdk.

Hold the ses-account lock in SesCustomVerificationEmailTemplateTest, which sends
and could overlap a test that turns account sending off.

Correct the lambdaTaggedArn Javadoc, which still described the MicroVM tag target
from before #7145.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-11-02 08:56:39 -04:00
Murtuza Chhil 6906759c9a feat(paymentcryptography): the Payment Cryptography control plane (#7090) 2026-11-02 08:14:58 -04:00
Oleksandr Nikolaichuk 42bc856258 test(cloudformation): run the schema coverage ratchet in CI (#7282) 2026-11-02 07:37:06 -04:00
Hector Ventura 39a5a60edc fix(iam): pass Cognito identity pool roles to cognito-identity and resync the PassRole table (#7273) 2026-11-02 07:05:31 -04:00
Priamo Germosen 9bd90d6580 fix(iam): check Redshift Data API requests on the cluster or workgroup they name (#7234)
Under IAM enforcement, Redshift Data API requests were checked on `*`,
so a grant scoped to a cluster or a serverless workgroup was refused
and a deny scoped to one never applied.

The Service Reference gives ExecuteStatement, BatchExecuteStatement,
DescribeTable, ListDatabases, ListSchemas and ListTables two resource
types: Redshift's `cluster:${ClusterName}`, which ClusterIdentifier
fills, and Redshift Serverless's `workgroup/${WorkgroupId}`. A
workgroup's ARN ends in the id Redshift Serverless gives it (its
workgroupId, "The unique identifier of the workgroup"; botocore's
WorkgroupNameString takes an ARN ending in workgroup/<uuid>), while a
request names it by WorkgroupName, "The serverless workgroup name or
Amazon Resource Name (ARN)". So the workgroup is a FOUND_BY type,
found by WorkgroupName.

FOUND_BY named a type by its members only where the rule had derived
a fill for the type to replace, as ResourceId fills a scalable target's
${ResourceId}. No member fills ${WorkgroupId}, so FOUND_BY now names
every FOUND_BY type the action acts on whose members the request has,
as its docstring already said. The Application Auto Scaling entries
are unchanged.

RedshiftDataResourceResolver, which resolves the target a request
runs on, now implements StoredResourceArns for redshift-data: it
gives the ARN of the workgroup a name or an ARN finds, through
RedshiftServerlessService.findWorkgroupByNameOrArn, which the
service's own name-or-ARN lookup now uses as well.

Redshift Data joins the table (12 operations, 1048 over 26
namespaces). The six operations above are checked on the cluster's
ARN or on the stored workgroup's, and on `workgroup/*` for a workgroup
there is none of; their SecretArn names neither. A request naming only
its SessionId stays on `*`, and so do CancelStatement,
DescribeStatement, GetStatementResult, GetStatementResultV2,
ListSessions and ListStatements, which the Service Reference gives no
resource type.
2026-11-01 20:57:48 -06:00
Jimmy Liu Jia 1cbf58a8ae fix(iam): match service-linked role name validation (#7235)
* fix(iam): match service-linked role name validation

Match the recorded AWS ValidationError for malformed AWSServiceName while preserving the documented length and character constraints.

Refs #6042 (item 1)

* fix(iam): align service-linked role validation
2026-11-01 22:24:43 -04:00
Ruslan Sovinskyy dfaab8ba4c feat(eventbridgev2): add EventBridge V2 service (#6962) 2026-11-01 18:44:29 -04:00
Hector Ventura b38fe7d96d chore(deps): bump botocore to 1.43.118 and drop it from Dependabot (#7223) 2026-11-01 12:44:09 -04:00
Priamo Germosen beef71e8eb fix(iam): check Application Auto Scaling requests on the scalable target they name (#7193)
Under IAM enforcement, Application Auto Scaling requests were checked on
`*`, so a grant scoped to a scalable target was refused and a deny
scoped to one never applied.

A scalable target's ARN ends in a unique id the service assigns,
`scalable-target/<id>` ("The unique ID ... is a value assigned by
Application Auto Scaling to the scalable target"), which the Service
Reference names ${ResourceId}, while requests name the target by
ServiceNamespace, ResourceId and ScalableDimension. Read as the table
reads other services, ResourceId (`service/<cluster>/<service>`) would
have filled that id, so the namespace was left out until the table could
look the ARN up.

The generator's new FOUND_BY gives a type whose ARN is all an id its
service mints, with the members a request names it by. An operation
whose request has them all names the type by them (`find`), generated
rather than corrected, and the reader asks the service for the ARN they
find through StoredResourceArns, the lookup EventBridge's connections
already use, or else checks the ARN with its id open, as for a create.
StoredResourceArns.find now takes the values a request names the
resource by, in the table's order: one name for EventBridge, the three
members for Application Auto Scaling, whose service now implements it
from the store its handlers read. A member left out or given a JSON
null names none, as the handler reads it.

Application Auto Scaling joins the table (14 operations, 1036 over 25
namespaces): RegisterScalableTarget, DeregisterScalableTarget,
PutScalingPolicy, DeleteScalingPolicy, PutScheduledAction and
DeleteScheduledAction are checked on the target's stored ARN, and a
RegisterScalableTarget registering a new one, its tags included, on
`scalable-target/*`; TagResource, UntagResource and
ListTagsForResource on the ARN their ResourceARN gives; the Describe
operations and GetPredictiveScalingForecast on `*`, as AWS checks them.
2026-11-01 10:10:02 -06:00
galsuchetzky-act b987e822be feat(bedrock): add PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy for guardrails (#7188) 2026-11-01 08:23:49 -04:00
Priamo Germosen bfd3bcbbce fix(athena): read and check a request naming no catalog as AwsDataCatalog (#7061)
Athena's GetDataCatalog, ListDatabases, ListTableMetadata and
GetTableMetadata handlers read the catalog name with has() and
asText(), so a JSON null became a catalog named `null`: GetDataCatalog
then answered InvalidRequestException rather than the AwsDataCatalog
it answers for a request naming none. They now read it through the
handler's text(), as GetWorkGroup and StartQueryExecution read
WorkGroup, so a JSON null names no catalog.

Under IAM enforcement, a GetDataCatalog naming no catalog was checked
on `*` though Floci answers AwsDataCatalog, so a grant on that catalog
was refused and a deny on it did not apply, and the three catalog
reads given a JSON null CatalogName were checked on `datacatalog/null`
as well as on AwsDataCatalog. The request-resources table now reads a
request naming none, or a JSON null, as naming AwsDataCatalog for all
four, as it reads Athena's primary workgroup.

The table's regeneration also takes up drift in AWS's Service
Reference since the last sync, which the online check of both IAM
tables fails on: AWS now lists cognito-idp:DescribeTermsByClient among
the actions it authorizes DescribeTermsByClient as, so the
authorized-actions map no longer maps it to DescribeTerms and the
request-resources table checks it as its own action, and the map
gains MediaConnect's new BatchGetDestinationEndpoint and
BatchGetSourceEndpoint. Floci serves none of these operations.
2026-10-31 10:27:14 -05:00
Priamo Germosen ca3599f8c9 fix(iam): check seven more services on the resources their requests name (#6976)
Under IAM enforcement, Athena, Data Exports, Pricing Calculator, Cost
Explorer, CloudTrail, Global Accelerator and Timestream for InfluxDB
requests were checked on `*`, so a grant scoped to a workgroup, an
export, a workload estimate, an anomaly monitor, a trail, an
accelerator or a parameter group was refused, and a deny scoped to one
never applied.

The generated table of the resources requests name now reads them, 305
operations, from AWS's Service Reference and botocore as it reads the
first four batches: their namespaces move from the generator's
NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it
edited by hand; 1022 operations over 24 namespaces. Each resource
type's ARN format is the one Floci mints or reads: Athena's
`workgroup/<name>` and `datacatalog/<name>` (its tag handler parses
them), `export/<name>`, Cost Explorer's `anomalymonitor/<id>` and
Global Accelerator's `accelerator/<id>` with no Region, listeners and
endpoint groups under the accelerator's, `trail/<name>`, and Timestream
for InfluxDB's `<type>/<id>`.

Corrections, each with its reason:

- Athena's StartQueryExecution, ListQueryExecutions and ListNamedQueries
  naming no workgroup are checked on the primary one, where Athena runs
  and lists them ("If a workgroup is not specified, returns a list of
  query execution IDs for the primary workgroup"), and so is
  GetWorkGroup, which Floci answers with the primary one then. Floci's
  StartQueryExecution and GetWorkGroup handlers now read a JSON null
  WorkGroup as none, as ListQueryExecutions does, rather than as a
  workgroup named "null", so the workgroup checked is the one acted on.
- Athena's ListDatabases, ListTableMetadata and GetTableMetadata are
  checked on AwsDataCatalog, the Glue Data Catalog Floci reads
  whichever catalog they name, as well as on the one their CatalogName
  names.
- Cost Explorer's nine cost and usage reads are checked on `*`, not on
  their BillingViewArn: Floci serves no billing views and answers the
  account's costs whichever view is named, so a grant scoped to one
  must not reach them.
- Data Exports' CreateExport is not checked on its Export.ExportArn,
  the ARN "for this export", which the request creates; its pattern
  takes a table's, so a caller could choose the table checked.
- CloudTrail's StartLogging, StopLogging and GetTrailStatus name their
  trail by a bare Name, a name or an ARN, AddTags, RemoveTags and
  ListTags their resources by the ARNs in ResourceId and
  ResourceIdList, members whose names do not end in Arn, and the
  dashboard operations their dashboard by DashboardId, a name or an
  ARN.
- Cost Explorer's GetAnomalyMonitors and GetAnomalySubscriptions name
  their monitors and subscriptions by the ARNs in MonitorArnList and
  SubscriptionArnList; GetAnomalySubscriptions' MonitorArn, a
  monitor's ARN, is not read as a subscription's.
- Timestream for InfluxDB's RebootDbCluster is checked on each member
  instance its instanceIds names as well as on the cluster.
- Global Accelerator's ListCustomRoutingPortMappings is checked on its
  accelerator alone: its EndpointGroupArn extends the accelerator's ARN
  and so matched the accelerator's format.

Not read yet, each with its reason in NOT_COVERED: CodeDeploy, whose
on-premises instance format the Service Reference gives as
`instance:${InstanceName}` while the CodeDeploy permissions reference
gives `instance/instance-ID` and AWS's GetOnPremisesInstance example
answers `instance/<name>_<id>`; Redshift Data, whose serverless
workgroup's ARN ends in an id the service mints while its requests name
the workgroup by WorkgroupName; and Service Catalog, whose
*PortfolioShare requests give in AccountId the account a portfolio is
shared with, whose imported portfolios and products keep their owner's
account while requests name them by id, and whose AppRegistry half is
named in the path.
2026-10-30 07:23:46 -05:00
Robin Baeckman 07f2d62c17 feat(eks): vendor AWS's add-on version catalog for every supported Kubernetes version (#6735) 2026-10-30 07:21:01 -04:00
Mohith 628beeef85 fix(rds): report the RDS hosted zone id on clusters and instances (#6826)
* fix(rds): report the RDS hosted zone id on clusters and instances

DescribeDBClusters omitted HostedZoneId and DB instance endpoints omitted
Endpoint.HostedZoneId, so Terraform's aws_rds_cluster.hosted_zone_id was
empty and Route 53 alias records pointing at RDS endpoints failed.

Add a per-region rdsHostedZoneId fact to region-facts.json through the
generator, with the us-east-1 value from the AWS CLI RDS documentation,
and read it through AwsRegionFacts.rdsHostedZoneId. Regions without a
captured value fall back to the us-east-1 zone; Floci's Route 53 resolves
alias targets by DNS name, so the fallback does not affect resolution.
The value is looked up when the response is built, so existing clusters
and instances report it too.

Closes #6778

* fix(rds): read the RDS hosted zone from the CLI example and keep the fallback in RDS

AwsRegionFacts.rdsHostedZoneId now returns an Optional like every other
accessor there, and RdsQueryHandler owns the fallback zone for regions with
no captured value, the way API Gateway keeps its own placeholder. A missing
us-east-1 entry can no longer break a describe call.

The generator reads the us-east-1 zone from a snapshot of the AWS CLI
describe-db-instances example under aws-docs/partition-guides, as the
GovCloud API Gateway zones come from the GovCloud guide, instead of a
typed-in constant. The parse is required and fails on a missing,
wrong-region or ambiguous example. Adding another region is now a data
change.
2026-10-30 07:05:41 -04:00
Priamo Germosen 98a3d2a346 feat(iam): read every modelled operation's constraints from the model (#6965)
The vendored file carried 52 of IAM's operations and carries 162 now, which
is every one of the 164 that declares a required member, a length, a pattern,
an enum or a range, bar the two account alias operations: those answer their
single member in AWS's own wording, so there is nothing left for the walk to
read on them.

What takes the last of them in is a walk that reads a Query map and anything
nested under one. A map arrives as entries numbered under its own name,
`ReplacementValues.entry.1.key` and `.entry.1.value`, and an entry's value is
named under the key that entry carried, `replacementValues.Department.values`,
which is how both maps this service answered by hand already named one and how
the JSON protocols name a map's value here. An entry is read off its key, so
one numbered with a value and no key is not an entry the map could hold. A
structure's field may be a list, a list's member may hold a list of its own
and a map's value may be a structure, so `AcquireRole`,
`PutAccountProperties`, `CreateDelegationRequest` and both simulators are read
with the rest, and the file refuses to load only for a shape of a type the
walk would pass over unread.

The two hand-written map checks come off with that. `AcquireRole`'s answers do
not move at all: the count of 30, each entry's required `Values` and the 20
values one entry admits read exactly as its own check read them, named by the
key the entry was sent under, which is what the tests it already had pin.
`PutAccountProperties` keeps the set it answered for a key, `Map keys must
satisfy constraint: [...]`, with the minimum length of 1 the model declares
now inside it where the hand-written set listed the maximum and the pattern
alone, and a value outside its bounds is answered in the words every other
member carries rather than the `must have length between 1 and 1024` that
check wrote. The `Namespace/PropertyName` rule stays exactly where it was,
being a rule the service applies after the format is good rather than a
constraint the model declares.

Two reductions keep an answer that is AWS's own rather than rewording it, both
through the hook the shared driver already takes. Eight operations answer a
member the request leaves out with "The request must contain the parameter
CertificateBody.", the wording this emulator answers for a missing Query
parameter in several services, so their shapes are vendored without the
model's required list and keep that refusal while their lengths and patterns
are read. Seventeen more are vendored without a member they answer in a
wording of their own: a service-linked role's principal and suffix, an empty
`ServiceNamespaces`, `statusType` on all four operations that take it,
`Encoding` on `GetSSHPublicKey`, the simulators' empty `ActionNames`,
`PolicyInputList` and `PolicySourceArn`, and `TagKeys` on the eight untag
operations.

Nine wordings this service wrote for itself go with the checks that wrote
them: the three password-policy ranges, the name refusal that spelled out its
own bounds and the group, server certificate and instance profile names beside
it, the path refusal, the authentication code, the virtual MFA device name and
the serial number. Each is answered by the model's own violation now, through
the one writer this package already had.

A member whose shape fixes one length is answered for that length rather than
for a bound it sits under, `Member must have length equal to 6`. That is the
wording a report's 36-character job id already answered by hand, which is why
the three report readers can be read from the model at all, and it reaches
STS through the same writer, whose `TokenCode` and `SigningAlgorithm` each fix
one length too.

Two test fixtures carried values AWS refuses and now carry values it takes.
`SignedIamUsers` named a user with a prefix plus a whole UUID, which reaches
66 characters where `userNameType` declares 64, and the two sibling fixtures
that named one the same way follow it onto the shorter suffix. The SDK suite
registered a SAML provider with a 375-character metadata document where AWS
declares 1000, so each of its two documents is padded to that bound on its
own.

`docs/services/iam.md` carries each reading, the maps among them.
2026-10-29 20:32:48 -05:00
Priamo Germosen 62527ebaa8 fix(iam): check ModifyReportDefinition on the report it names alone (#6935)
The generated table of the resources requests name checked Cost and
Usage Reports' ModifyReportDefinition on the report its ReportName
names and also on its ReportDefinition.BillingViewArn, read as a report
definition's ARN. That member is a billing view's ARN
(arn:aws:billing::<payer account>:billingview/...), never a report's,
so a request carrying a report's ARN there was checked on a report it
does not act on. PutReportDefinition's correction already leaves it
out.

A correction now reads ModifyReportDefinition's report from ReportName
alone, sharing PutReportDefinition's reason, and the table is
regenerated; nothing in it is edited by hand.
2026-10-29 18:04:35 -05:00
Aniket Shukla 8270cc7c41 feat(ecr): support pull time update exclusions (#6856)
* feat(ecr): support pull time update exclusions

* refactor(ecr): remove duplicate exclusion validation
2026-10-29 16:20:51 -04:00