Under IAM enforcement, these tasks are now authorized as the execution role, or as the Credentials role a state names. DynamoDB is checked as a direct request is: batches on each table, transactions by each item's own action, ListTables on its regional collection and statements by what they do. S3 putObject is checked on the object in the bucket's own partition, and a bucket policy can grant or deny. RDS Data needs the action on the cluster and GetSecretValue on the secret. Redshift Data needs what an EventBridge target needs, and its statement operations are checked on any resource.
A request naming nothing it can reach is left to its service. With enforcement off nothing changes.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Every request of every service looked its Host up among the custom
domains. The lookup copied all stored domain keys and cut a substring per
key, and almost no host is a custom domain. 100 domains added about 19 KB
to each request.
A walk over the stored keys now answers a miss first. It copies nothing.
A hit still takes the old path, so the owner, region and conflict rules
stay the same.
A docker cluster ran Hive steps, made its steps' image with Hive and ran
Hive's metastore service on its primary node only when its Applications
named Hive. EMR installs Hive's client and its HCatalog server with
HCatalog too, and the Release Guide's HCatalog page says "HCatalog is a
tool that allows you to access Hive metastore tables within Pig, Spark
SQL, and/or custom MapReduce applications".
- EMR's hive-script, in the emr-scripts package every node has, checks
only "which hive" ("Hive isn't installed." otherwise), and the hive
it finds is hive-client's, which HCatalog installs, so a Hive step
runs on a cluster with HCatalog alone.
- Its HCatalog server, hcatalog-server, is the metastore service:
Hive's hcat_server.sh runs "hive --service metastore".
So a cluster whose Applications name HCatalog installs Hive as one
naming Hive does: its Hive steps run, in the release's image with Hive,
on the metastore service its primary node runs, which its Spark steps'
Hive client uses too.
An emr-spark-* release, the AWS runtime for Apache Spark, includes
neither ("This release includes the following applications:
AmazonCloudWatchAgent, Delta, Hudi, Iceberg, JupyterEnterpriseGateway,
Livy, and Spark."), and has no Hive image to make its steps' image with
Hive from, so a cluster of one installs neither, whatever its
Applications name; one naming Hive asked for that image since #7459.
emr.md now backs a cluster's Spark steps using its metastore with the
Release Guide's EMR pages, in place of the Glue page #7636 quoted:
Spark's default catalog "always connects to a Hive metastore", and
Using HCatalog has Spark SQL read a table the HCat CLI made.
* fix(ec2): retain instance account and region during start
Run container start work in the instance owner account and region, capturing
the caller account for legacy ownerless records. Cover worker scope and
cleanup with the real Quarkus request context and mocked Docker operations.
Adapted from AndreKurait/floci#547 onto the current upstream lifecycle path.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): inherit the start worker scope when restoring volumes
Let the post-start volume-restoration callback inherit the account and region
established by the lifecycle worker instead of entering another account scope.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
A cluster's Hive steps kept their metastore in an embedded Derby
database in the cluster's /mnt, so only one Hive step at a time could
use it ("Another instance of Derby may have already booted the
database"), and Spark steps, with a catalog of their own, saw a Hive
step's tables only through the Glue Data Catalog. "By default, Hive
records metastore information in a MySQL database on the primary node's
file system", and the Glue Data Catalog is the one to pick "when you
require a persistent Hive metastore or a Hive metastore shared by
different clusters".
- On a cluster whose Applications name Hive, the primary node's
container runs Hive's metastore service on port 9083, once its HDFS
is up: with the image's Hadoop configuration, as Hive steps run, the
cluster's HDFS, its Derby database in the node's own volume, which
only the service opens, and its warehouse in the HDFS. The node is
ready once it listens, and ends if it exits, as for the HDFS daemons.
- It is on the cluster's own Docker network with the HDFS, so only the
cluster's steps reach it. It reaches tables' S3 locations through S3A
on Floci's S3, with a session for the cluster's EC2 instance
profile's role, which goes with the container: at the host's address
when Floci runs on the host, and as floci when Floci runs in a
container, which joins the cluster's network for it, as it joins EC2
VPC networks, and leaves it when the HDFS container goes. A start
that fails, or a container an earlier Floci left, does not keep
Floci there, and one Docker keeps Floci on stays known for the next
teardown.
- It gets the cluster's core-site and hive-site after its own
settings, as EMR's primary node does, so a hive-site warehouse folder
holds for it as for the steps. One an earlier Floci left running
starts again, as its session went with that Floci, and so does one
given Floci's address before Floci could join its network.
- A Floci that crashed is still on that network when it starts again,
and Docker lists it first, so what Floci launched then joined it and
reached the cluster's HDFS and metastore. Floci's own network is no
longer one it made, an EMR cluster's or a VPC's, its earlier owner
label included, or one Docker cannot inspect, unless it is on no
other, and its DNS server takes its address from that network.
- In a namespace the steps share, host or container:<id>, it does not
run: Hive 3.1 has no setting for the address it listens on, so it
would serve every interface of the namespace. Hive steps keep the
embedded Derby database there, as they do with no network.
- Hive steps get its URI in place of the embedded Derby settings, and
Spark steps' Hive client gets it too, so a Spark step reads a Hive
step's tables and makes tables a Hive step reads; a hive-site or
spark-hive-site naming the Glue Data Catalog's client factory still
uses Floci's Glue.
- Two Hive sessions starting at once both upload Hive's exec jar to
the same HDFS folder when it is not there, and one could launch Tez
tasks with a jar that changed under it, so the primary node puts it
there first, under the name Hive gives it.
EmrHiveStepsDockerIntegrationTest runs two Hive steps at once on a
cluster's metastore, and a Spark step that reads a Hive step's table
and makes one the next Hive step reads.
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.
* fix(dynamodb): refuse a PartiQL function call with the error for its place
* fix(dynamodb): answer a PartiQL statement nested too deep with InternalFailure
Every request whose access key was not 12 digits walked all stored IAM keys to find the owning account. 100 keys added about 17 KB to each request of every service.
A new store lookup does one get per owning account and returns the same entries as the scan. It returns all of them because the same id can be Inactive in one account and Active in another, and it does not migrate legacy entries.
Copy action-list membership under the existing execution monitor before
listing, approval and stage lookups. Reuse the snapshot for action ownership
lookup and stop completion so registration cannot invalidate a traversal.
Cover the four affected request paths with deterministic registration tests.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Resolve SubscriptionRoleArn for SNS subscriptions and update the role without replacing the subscription. Remove the covered CloudFormation property gap.
Validate RawMessageDelivery and FilterPolicy when Subscribe reuses an existing subscription; preserve omitted/default attributes and explicit updates.
Update the stack subscription by its prior physical identity when topic, protocol and endpoint are unchanged. Preserve Subscribe validation for creates and target replacements, reset dropped declared attributes and validate firehose roles before other attribute writes. Cover FilterPolicy and raw delivery updates/removal through CloudFormation and SNS SDKs.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* 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
The execute-api host filter parsed the request URI and ran a regular
expression on every request. The response filter created the
request-scoped route context on every response, and that object calls
UUID.randomUUID() when it is created.
The host filter now refuses a host without the regular expression and
returns before it reads anything else. The response filter checks the
path first, so the route context is created only for API Gateway paths.
fix(s3): authorize POST encryption settings and report them
fix(s3): reject incompatible POST encryption fields
fix(s3): normalize POST encryption before authorization
CreateIntegration accepts arn:aws:s3:::bucket with a Serverless namespace or cluster target. The bucket must exist in the integration's Region and have no period in its name, a bucket joins a target once, and a target takes at most 50. The integration reports SourceType s3-event-notifications, starts no poller and publishes no zero-ETL events.
fix(redshift): validate S3 integration source and target identities
fix(redshift): resolve unstored S3 bucket Region in default Region
Fall back to the deployment default Region when an S3 bucket has no stored Region, match bucket partition using RegionResolver.partitionForRegion, and remove the unused two-argument RedshiftZeroEtlEndpoints constructor.
Federated users provisioned via the hosted UI were reported with
UserStatus CONFIRMED. AWS reports EXTERNAL_PROVIDER for users that
sign in with a third-party identity provider.
- Set user status to EXTERNAL_PROVIDER in provisionFederatedUser
- Update test assertion accordingly
Closes#7545
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
fix(cognito): preserve status of linked and permanent-password federated users
Addresses qodo review: provisionFederatedUser no longer overwrites
EXTERNAL_PROVIDER on linked local profiles or federated profiles that
had a permanent password assigned.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
fix(cognito): track auto-provisioned status to preserve linked users on re-sign-in
Use a persisted federatedAutoProvisioned flag instead of overwriting
federatedProviderName, so linked profiles and permanent-password users
keep their status across repeated federated sign-ins.
Addresses pgermosen review.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
test(cognito): add re-sign-in status preservation tests
Covers linked profile re-sign-in and permanent-password profile re-sign-in.
Addresses pgermosen review.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Use an injectable UTC clock for transaction deadlines. Advance the test clock
only after the blocking query starts, then check idle expiry after it finishes.
This removes the one-second wall-clock race without changing runtime TTLs.
test(rds-data): reuse the shared manual clock
Use ManualClock for the transaction concurrency fixture and advance it
through its existing duration-based interface.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Expose backend keep-alive and idle-pool timeout controls while retaining the existing defaults. Preserve target failures without replaying uncertain requests, and document target timeout hints and local transport limits.
Validate negative idle timeouts with a Floci-specific error before creating clients, and attempt every fixture cleanup step while preserving aggregated failures. Cover negative, zero and positive configuration values and real-listener connection behavior.
Closes#7524
test(elbv2): replace timer-dependent backend checks
With Docker-backed VPC networks, one container of an awsvpc task joins
its VPC's Docker network at the task ENI address, so the address
DescribeTasks reports answers. A Lambda function with VpcConfig joins
the same network at an address leased from its first subnet, skipping
addresses an interface already holds, and returns it once its container
is removed. Peer and Cloud Map addresses still resolve on the network a
container was created on.
Closes#7639
Move the Java sources from io.github.hectorvent.floci to io.floci.aws, matching io.floci.gcp, io.floci.az and io.floci.oci. Generated by tools/rename/rename_package.py apply on the base commit, with no other edits.
Logger categories and the arn.fail-on-blank-region property move to the io.floci.aws prefix. The pom groupId becomes io.floci; the artifactId stays floci.
Refs #6589
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(cloudformation): keep NAT gateway secondary addresses the stack never declared
* test(cloudformation): keep NAT gateway secondary addresses the stack never declared
* fix(cloudformation): a null NAT gateway secondary property counts as not declared
* test(cloudformation): a null NAT gateway secondary property counts as not declared
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.
* perf(core): read the SigV4 credential scope without regular expressions
Every request ran its Authorization header through regular expressions
five to eight times to read the access key, the region and the signing
service. The account id check String.matches("\\d{12}") also compiled a
new pattern twice per request.
SigV4CredentialScope, RegionResolver and AccountResolver now read the
common header shape with indexOf. Any other shape still goes through the
same regular expressions, so every result stays the same. The account id
check is a plain loop.
* perf(core): read the access key by hand and skip the regexes without a credential
StopPipelineExecution traversed the action list while a worker could append
to it under the execution monitor. Use the same monitor for abandonment
so a concurrent registration cannot invalidate the traversal.
Add a deterministic public-handler regression that registers an action
while the stop waits and verifies that only in-progress actions are abandoned.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
A listener port carries no credentials, so the data plane read target
groups, load balancers and listeners as the default account and answered
502 for any other account. Read them as the account in the listener ARN.
Startup ran outside a request too, so only the default account's indexes,
listeners and health monitors came back. Rebuild the indexes from every
account and restore each stored account as itself.
Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Five classes had their own copy of the SigV4 URI encoder, and three had their own copy of the signing key derivation and HMAC-SHA256. They now call SigV4Canonicalization.uriEncode and SigV4RequestValidator. The S3 list response encoding for encoding-type=url also uses the shared encoder instead of URLEncoder and three replacements.