mirror of
https://github.com/floci-io/floci.git
synced 2026-11-26 23:29:28 -05:00
faf9c4e64d2ff2cbcdc2a9d238e14230bcd39528
105
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3c398103ed | fix(iam): resolve missing roles and EC2 tagging targets (#7596) | ||
|
|
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. |
||
|
|
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> |
||
|
|
3701d4d041 | feat(ec2-instance-connect): SendSSHPublicKey, verified by the unmodified AWS agent (#7473) | ||
|
|
6130fe9568 | feat(paymentcryptography): the PIN operations (#7397) | ||
|
|
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 |
||
|
|
856970a24f | feat(apigateway): add documentation part operations (#7712) | ||
|
|
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. |
||
|
|
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. |
||
|
|
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 |
||
|
|
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. |
||
|
|
c3058a8de4 | fix(iam): generate resource and request tag condition context (#7589) | ||
|
|
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 |
||
|
|
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. |
||
|
|
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.
|
||
|
|
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>
|
||
|
|
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> |
||
|
|
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. |
||
|
|
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.
|
||
|
|
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 |
||
|
|
3308ea2f1c | feat(logs): add vended log delivery sources, destinations and deliveries (#7411) | ||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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.
|
||
|
|
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`. |
||
|
|
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> |
||
|
|
6906759c9a | feat(paymentcryptography): the Payment Cryptography control plane (#7090) | ||
|
|
42bc856258 | test(cloudformation): run the schema coverage ratchet in CI (#7282) | ||
|
|
39a5a60edc | fix(iam): pass Cognito identity pool roles to cognito-identity and resync the PassRole table (#7273) | ||
|
|
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.
|
||
|
|
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 |
||
|
|
dfaab8ba4c | feat(eventbridgev2): add EventBridge V2 service (#6962) | ||
|
|
b38fe7d96d | chore(deps): bump botocore to 1.43.118 and drop it from Dependabot (#7223) | ||
|
|
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.
|
||
|
|
b987e822be | feat(bedrock): add PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy for guardrails (#7188) | ||
|
|
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. |
||
|
|
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.
|
||
|
|
07f2d62c17 | feat(eks): vendor AWS's add-on version catalog for every supported Kubernetes version (#6735) | ||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
8270cc7c41 |
feat(ecr): support pull time update exclusions (#6856)
* feat(ecr): support pull time update exclusions * refactor(ecr): remove duplicate exclusion validation |
||
|
|
981b885348 | fix(apigateway): authorize management calls against the path ARN they name (#6825) | ||
|
|
078931597e |
fix(iam): check five more services on the resources their requests name (#6927)
Under IAM enforcement, Budgets, Cost and Usage Reports, Service Quotas, Textract and Translate requests were checked on `*`, so a grant scoped to a budget, a report definition, a quota, an adapter or a terminology was refused, and a deny scoped to one never applied. The generated table of the resources requests name now reads them, 103 operations, from AWS's Service Reference and botocore as it reads the first three batches: their namespaces move from the generator's NOT_COVERED to NAMESPACES and the table is regenerated, nothing in it edited by hand; 717 operations over 17 namespaces. Each resource type's ARN format is the one Floci mints or reads: `budget/<name>` with no Region (Budgets' tag handler parses it), `definition/<name>`, and `<service code>/<quota code>` (Service Quotas' QuotaArn). Three corrections, each with its reason: CreateBudget and UpdateBudget name their budget by Budget.BudgetName and NewBudget.BudgetName, and PutReportDefinition its report by ReportDefinition.ReportName, inside a structure the rule does not read. Without them UpdateBudget and PutReportDefinition were checked only on their BillingViewArn, a billing view's ARN by botocore's pattern, so a caller allowed on one budget or report could give its ARN there and name another. Verified Permissions minted a policy store's ARN with a Region, where AWS gives none: its CreatePolicyStore example answers arn:aws:verifiedpermissions::123456789012:policy-store/PSEXAMPLEabcdefg111111, the Service Reference's format alike. It now mints it without one, in the Region's partition. Not read yet, each with its reason in NOT_COVERED: Verified Permissions, whose policyStoreId may name a store by its alias, which AWS authorizes as the action on the store the alias points to and GetPolicyStoreAlias on the alias, and whose aliasName carries the `policy-store-alias/` its format already gives; Auto Scaling, whose group and launch configuration ARNs Floci mints without AWS's id (`autoScalingGroup:<name>` for `autoScalingGroup:<id>:autoScalingGroupName/<name>`), which ECS reads back; SWF, whose domain format the Service Reference gives no Region while the SWF Developer Guide gives one; and CloudHSM, whose formats end in names while its requests give ids. |
||
|
|
34269655ba |
feat(sts): read every modelled operation's constraints from the model (#6925)
The seven operations that still answered an absent member from a check of their own are read against the vendored shapes now, which leaves every STS operation that models a member reading its constraints from the model: `AssumeRole`, `AssumeRoleWithSAML`, `AssumeRoleWithWebIdentity`, `AssumeRoot`, `DecodeAuthorizationMessage`, `GetDelegatedAccessToken` and `GetFederationToken`. `GetCallerIdentity` carries no member, so there is nothing to read for it. Two answers move, both onto the form the model and the rest of this package give. A member the request leaves out is named as a constraint message spells it, `roleSessionName` rather than `RoleSessionName`, and every absent member is reported together in the order the model lists them, where the check it replaces answered the first it found. A member sent empty is a value the request carries, so it breaks its own minimum length rather than reading as absent. That is the reading #6811 settled for the two services and what `validateRequired` was the last of in this handler. What the seven gain is every bound beside the required members, none of which was read at all: `RoleArn` at 20 to 2048 characters, `RoleSessionName` at 2 to 64, `ExternalId`, `SourceIdentity`, `SerialNumber`, `TokenCode`, `Policy`, `PolicyArns`, `Tags`, `TransitiveTagKeys` and `ProvidedContexts` on `AssumeRole`, `SAMLAssertion` at 4 to 100000, `WebIdentityToken` at 4 to 20000, `ProviderId` at 4 to 2048, `Name` at 2 to 32, `EncodedMessage` at 1 to 10240, and the `DurationSeconds` and `MinimumSessionTokenSize` ranges each operation declares. `AssumeRoot`'s own length check on `TargetPrincipal` said what the model says, so it comes off with the rest. One reading is this emulator's own, and `docs/services/sts.md` says so. `TradeInToken` is required and declares no length, so a request sending it empty carries a value: it reaches the lookup and is answered `ExpiredTradeInTokenException`, the refusal any token that cannot be redeemed gets, where the check it replaces called it absent. Nothing published says what AWS answers an empty trade-in token. Each operation keeps the refusals it answers ahead of the constraints: `GetFederationToken` and `GetSessionToken` turn away session credentials first, and `AssumeRoot` refuses the global endpoint first. Three test fixtures carried values AWS refuses and now carry values it takes. A `RoleSessionName` of `s` is one character where the model declares two, and a `WebIdentityToken` of `jwt` three where it declares four, so the fixtures that sent them are a character longer, as are the two assertions that read a session name back out of an assumed-role ARN and a condition key. The name the shared role-session fixture opens under has one writer now, `EnforcementFixtures.SESSION_NAME`, read by every test asserting on that session rather than spelled again in each: an `aws:userid` condition, a `PrincipalArn` condition, two authorization-denial messages and the ARN two trust-policy cases read back. Each of those carried the one-character name, which is a 403 where the case wants a 200, or a prefix match that no longer pins the whole ARN. |
||
|
|
e24bc36f64 |
feat(ecr): support account settings (#6855)
* feat(ecr): support account settings * fix(ecr): validate account settings against request model |
||
|
|
c9c1c0990b |
feat(sts): read a Query request's declared constraints from the model (#6891)
`GetAccessKeyInfo`, `GetSessionToken` and `GetWebIdentityToken` are held to the constraints botocore's STS model declares, which `tools/aws/regen_sts_shapes.py` vendors into `aws/sts-request-shapes.json` and `StsRequestShapes` reads through the same `QueryConstraintCheck` walk IAM reads its own file with. The two services share the protocol, the message wording and the generator, so what is new is which operations are read rather than how. What it adds is on `GetSessionToken`: `SerialNumber`, `TokenCode` and `MinimumSessionTokenSize` are declared and nothing read them, so a serial number under 9 characters, a token code that is not six digits and a size past 4096 answer `ValidationError` where they answered credentials. The size is still only validated, the token staying the length this emulator mints. `GetAccessKeyInfo` and `GetWebIdentityToken` keep the messages they already answered, from the same bounds and the same patterns, and about 130 lines of hand-written audience, tag and access-key checks come out. One answer moves: a value breaking two constraints is answered for both, where the if-else chain stopped at the first. That is the reading #6402 settled and #6580 already took for an empty role name. `jwtAlgorithmType` publishes a fixed length of 5 and no enum, the two values coming from the reference, so the walk takes a documented constraint keyed by member name and reports it in that member's place, which keeps a collected message in the model's order. It is reported only for a member the request carries that breaks nothing the model declares, which is the exclusivity the hand-written helper had. A value that is no number at all stays `InvalidParameterValue`, answered before the constraints, since the model declares a range and says nothing about what counts as a number; a digit string is a number of any width, so a `DurationSeconds` of `99999999999` breaks the maximum rather than being called no integer, as #6625 settled for an oversized `MaxItems`. Each operation asks for its violations where its own check ran rather than ahead of the switch, because `GetSessionToken` refuses session credentials before it reads anything. The whitespace around a number comes off wherever this handler reads one. The check takes a padded value and holds it to its range, so the read behind it parses the same text: parsing the value as the request spelled it threw there and fell back to the default, so a ` 3600 ` asking for an hour would have been handed the twelve hours `GetSessionToken` defaults to, or the five minutes a web identity token defaults to. IAM reads its own `MaxItems` that way already. The generator is not new code. `request_shapes.main` already drives the five generators that vendor member types, so it takes an `operations` argument now and both Query-protocol generators hand it their model, output and operations the same two-line way, which takes the hand-rolled driver out of `regen_iam_shapes.py` as well. ECR and Resource Groups still carry theirs and are a refactor of their own. The generator contract tests move with it: that a vendored file carries exactly the operations its generator lists and resolves every shape it names is one parametrized test over all four constraints generators rather than a copy per generator, and `build_constraints`'s own properties are tested once, where the shared module already tested them. The model transform the driver takes is driven through it as well, the file it writes carrying what the transform left and the staleness check calling that file current only when it prepares the model the same way, and IAM's own tests read the vendored file for each paged request reduced. Three sentences this handler wrote out by hand go the same way. The two range refusals and the length refusal on `TargetPrincipal` come from `SmithyValidationErrors`, which already wrote them word for word, and the "Must be an integer." refusal has one writer and three callers. The length comparison counts code points rather than UTF-16 units as a result, which is the reading the rest of the package uses. |
||
|
|
385ffcfdd0 | feat(lambdaweb): set the WebFunctionAuthType condition keys on endpoint routes (#6893) |