The generated request resources give Lambda's function, function version
and alias, event source mapping, web function, revision and endpoint,
MicroVM image and network connector types aws:ResourceTag/ keys, but
LambdaStoredResourceArns did not answer storedTags, so a condition on
their tags saw none. It now answers from the service holding each:
LambdaService for a function, whose versions and aliases have its tags
as Lambda keeps tags on the function alone, and an event source mapping;
LambdaWebService for a web function, whose revisions and endpoints
inherit its tags; LambdaMicrovmsService for an image or a connector.
Each reads the resource under the ARN in the account and Region it
names, a pre-multi-account one of the default account in place, through
the new AccountAwareStorageBackend.readInAccount, matched on the whole
ARN. Tagging a function or a mapping now puts a new tag map in place of
the old one, so the lookup always copies one whole set.
IAM enforcement now reads RDS requests from the generated
request-resources table: all 168 RDS operations are checked on the
resources they name, from the Service Reference and pinned botocore,
so a policy scoped to a DB parameter group, proxy, snapshot or other
RDS resource applies. Stored tags of RDS and DocumentDB resources come
from the existing tag lookups for aws:ResourceTag conditions, read
only, in the ARN's own account.
Closes#8396
* fix(elbv2): apply regional ALB zone defaults with overrides
* fix(elbv2): restore legacy subnet snapshots during stack rollback
* fix(elbv2): require two ALB zones for the AWS default
* fix(elbv2): simplify explicit ALB zone rules
IAM enforcement now reads an event bus's or rule's stored tags for
aws:ResourceTag conditions, from the exact ARN's account, Region and
partition, without creating the default bus. ListTagsForResource,
TagResource and UntagResource share the same lookup.
Closes#8397
S3 Tables now migrates an unprefixed legacy table bucket only when the
caller is the configured default account and the bucket's ARN matches the
stored one, on a lookup and on CreateTableBucket's existence check. A
lookup from another account, or with a mismatched ARN, answers
NotFoundException and leaves the legacy record in place, and another
account creating a bucket of the same name gets its own.
An image pushed through the Registry V2 endpoint now records its push
time when the registry accepts the manifest, so DescribeImages reports
the push time instead of the time of the first read. A tag added to an
existing digest keeps the first push time, a digest delete clears it,
and a metadata write that fails keeps the registry's response and the
first push time for the next read.
* fix(apigateway): reject a non-integer limit on GetUsage, GetAuthorizers and GetDocumentationParts
* test(apigateway): make the valid limit control page two authorizers
A PartiQL ORDER BY now counts the hash key conditions inside every OR
branch. An OR whose branches each name the partition key, such as
(pk = 'a' AND x = 1) OR (pk = 'b' AND x = 2), reads more than one
partition, so it needs the partition key in ORDER BY, and an OR with a
branch that names none still counts no hash key condition.
CreateDBInstance and ModifyDBInstance now check that every security
group a request names exists in the caller's account and Region and sits
in the instance's VPC, refusing an unknown id with InvalidParameterValue
and a group of another VPC with InvalidParameterCombination. Restores,
read replicas, Blue/Green deployments and CloudFormation go through the
same check, and DocumentDB shares it. An instance whose request names no
groups gets its VPC's default security group, as RDS documents, and
describe reports that group for an instance that keeps none.
GuardedMessageQueueTest's snapshot test now builds and closes its
persistent, hybrid and WAL backends through StorageTestBackends instead
of its own mode switch and shutdown branches. Paths, interval, explicit
load and the detachment assertions are unchanged.
documented-routes-verify runs inside iam-data-verify for a pull request
touching rest-routes.json, regen_rest_routes.py or its test, but
iam-data-drift.yml's pull_request.paths listed none of the three, so a
pull request changing only the routes skipped the online check until the
weekly run. rest-routes.json is also one of the authorized-action
check's paths, which went unchecked the same way.
- iam-data-drift.yml lists the three paths, and its header says it
checks the routes rest-routes.json takes from the AWS page documenting
an endpoint botocore does not model.
- DOCUMENTED_ROUTES_PATHS also covers regen_partitions.py and
regen_query_services.py, the modules regen_rest_routes.py imports, as
every other check's paths cover its generator's imports.
Floci had no emr-containers service, so Airflow's EmrContainerOperator, the
aws emr-containers CLI and the SDKs had nothing to call. This adds its 25
operations: virtual clusters, job runs, job templates, managed endpoints,
security configurations and tags.
Job runs follow the job run states without running Spark on Kubernetes: a
run completes as soon as it is submitted, or after
floci.services.emrcontainers.job-run-duration-seconds. When Floci's EKS has
no cluster of the virtual cluster's container provider id, the run is FAILED
with "Cluster <id> does not exist." and CLUSTER_UNAVAILABLE, as AWS's "Common
errors when running jobs" page gives it; that page also gives the wording for
a job run on a missing or non-RUNNING virtual cluster. A job template's
${name} placeholders are filled from jobTemplateParameters or the parameter's
default. Deleting a virtual cluster clears its tags, as the development guide
says, only resources in an active state of the request's Region take tags,
and a job run's template and request tags together keep the 50-tag limit. A
virtual cluster created on an EKS cluster whose authenticationMode admits
access entries is access entry integrated, which ListVirtualClusters'
eksAccessEntryIntegrated filters on.
Every request is checked against botocore's emr-containers constraints,
vendored by tools/aws/regen_emr_containers_shapes.py and gated by make
aws-data-check. Routes sit under a signed-service prefix, so a path-style S3
request for a bucket named virtualclusters still reaches S3. The routes are
added to IAM's REST route table, and emr-containers to the IAM generators'
namespaces, so each operation is checked on the resource its path names,
StartJobRun and CreateManagedEndpoint need iam:PassRole on their
executionRoleArn, and the create operations need emr-containers:TagResource
for their tags, all from AWS's Service Reference.
* fix(dynamodb): check PartiQL batch and transaction statements under their PartiQL actions
* refactor(dynamodb): share the condition-key puts and read PartiQL statements from the key table
No botocore model describes AWS Glue's Iceberg REST endpoint, so no
vendored route mapped its paths to an action, and the endpoint refused
every IAM principal under enforcement, letting only root credentials
and Floci's own query engine through.
- regen_rest_routes.py reads an endpoint botocore does not model from
the AWS page documenting it (DOCUMENTED): Glue's "REST APIs for Apache
Iceberg specifications" gives each operation's REST path, IAM action,
CloudTrail event and a link to its definition in the Apache Iceberg
REST catalog OpenAPI specification. Each row of the Iceberg REST
Catalog API is the Glue operation its IAM action and CloudTrail event
name, refused when they differ, on the method and path of the
definition it links, under the root and the catalogs/{catalog} prefix
the page's path gives. Rows of one operation are its route and its
alternatives. Where the page's own path differs from the definition
(DeleteNamespace's "namespces", CreateTable's GET), the definition is
taken and the difference recorded. Nothing is typed by hand.
- Reading the page needs the network, so a regeneration carries the
routes over from the vendored file, --fetch-documented reads them
again, and --verify checks them against the page;
documented-routes-verify runs in iam-data-verify.
- rest-routes.json gains the endpoint's ten Glue operations under the
glue scope, and iam-authorized-actions.json lists glue's actions of
no resource type, as it does for every routed scope. The same
regeneration takes the actions AWS has added since: GuardDuty's
ListInvestigationRecords and Route 53's IP guardrail policy actions.
- The controller's refusal of IAM principals goes. Each route is now
checked as its Glue operation, on the account's Data Catalog whichever
catalog the prefix names: the request-resource table reads no Glue
member from an Iceberg request, so a grant or deny scoped to a
federated catalog, a database or a table does not apply here.
Floci's own engine's token is not checked again.
- A request a documented route takes is another API's, so it carries
none of its operation's members: the enforcement filter has every
member reader (request resources, condition keys, tag-on-create,
passed roles) read none from it, so a Glue member a caller adds to an
Iceberg body, such as Tags or DatabaseInput, names no resource and
gives no condition key a value.
GlueIcebergIamIntegrationTest checks a principal allowed GetCatalog and
GetDatabase reading the configuration and the namespaces and refused
creating a namespace or loading a table, by GET or HEAD, a deny on the
catalog holding under an allow on everything, and root credentials and
a minted token answered, and a Glue member added to an Iceberg body
neither satisfying an aws:RequestTag condition nor naming a database.
glue.md and iam.md say so.
ecs:runTask supports request-response, .sync and .waitForTaskToken. A
.sync:2 resource used to launch the task and only then fail the state
with "Unsupported ecs:runTask mode", leaving the task running unmonitored.
The pattern is now checked before RunTask is called, and the state fails
with the same "Unsupported resource" error as other unsupported
integrations.
ListTables now checks its ExclusiveStartTableName against the table name
length and pattern, counted in characters, and lists those errors in one
message with a bad Limit, the limit first. A JSON null start name reads
as absent instead of as the name "null".
A bad DynamoDB table name now gets the errors each call gives for it.
The table calls, and the older validator of a deeply nested PutItem,
UpdateItem or DeleteItem, count the name in UTF-16 units and list every
problem, the length first. GetItem, PutItem, DeleteItem, Query and Scan
count characters and report the first problem. UpdateItem counts
characters and lists the pattern before the length. A name inside a
table ARN gets only its first problem, counted in UTF-16 units, with the
whole ARN quoted and "Table name of ARN must".
RedshiftDataIdempotencyStoreTest and SqsMessagePersistenceTest now build
and close their storage backends through StorageTestBackends instead of
their own mode switches and shutdown branches. Paths, intervals, explicit
loads and the SQS journal copy before shutdown are unchanged.
Under enforcement, the identity that owns a delegation request was denied every
operation on it unless a policy named them, so a customer who claimed a request
could not read it, forward it, reject it or release its token without being
granted each one. AWS grants those by default. The customer page's note, under
"Managing Permissions for Delegation Requests", reads "By default, IAM
principals who initiate a delegation request are automatically granted
permissions to manage that specific request. They can associate it with their
account, view request details, reject a request, forward it to an administrator
for approval, release the exchange token to the product provider after admin
approval, and list delegation requests that they own."
So the holder now carries a grant over the requests it owns:
GetDelegationRequest with GetHumanReadableSummary, UpdateDelegationRequest,
which is the forward, RejectDelegationRequest and SendDelegationToken on those
requests, and ListDelegationRequests. The summary sits beside the read because
the reference puts it there itself: its "rules are identical to
GetDelegationRequest API behavior, such that a party who has permissions to call
GetDelegationRequest for a given delegation request will always be able to
retrieve the human readable summary for that request".
Listing names no resource, the Service Reference giving that action none, and is
scoped by the condition key the same reference publishes on it:
iam:DelegationRequestOwner, under ArnEquals, held to the owner's own ARN. That
is the line the guide draws between its two listing permissions, the table's
"List delegation requests for your account", which an administrator grants, and
the note's "list delegation requests that they own", which an owner has without
one. So an owner names itself in OwnerId and is answered with its own requests,
while naming another owner, or naming none, is refused, and the account's whole
listing stays with the granted permission. The key is read from the request's
OwnerId member through the IAM condition-key table, which names the member for
the pair so that the table's own gates re-derive it. The seven other delegation
actions the reference lists that key on take its value from the stored request
rather than from a parameter, so they stay unread.
The grant reaches whoever claimed the request, user or role session alike:
AssociateDelegationRequest stores "the ARN of the current calling identity", so
a session is recorded under its own assumed-role ARN and is looked up by that
rather than by the role it assumed. It is read where an identity's policies are
assembled, beside the password self-service grant that works the same way, so a
live request, a simulation and the user's access report all see it.
That lookup runs wherever policies are assembled, so on every authorized
request and not only on a delegation one. It answers an empty store without
reading it, and otherwise from a view of who owns what that one scan builds and
any stored write invalidates whole, so the usual answer costs a lookup rather
than a scan of every record in every account. Invalidating the view whole is
what keeps it true: nothing updates it in place, so a claim, an expiry and a
reload all land the same way. An emulator reset wipes the backend without a
request passing through that one method, so the service is Resettable and drops
the view in clear(), which makes the invariant a hook rather than a
coincidence of the store being empty afterwards.
Two abilities the note names are left out, each for its own reason. Approving is
not implicit: the same page lists iam:AcceptDelegationRequest among the
permissions an administrator grants, which is the step the flow keeps for one.
Associating cannot be granted here at all, because a request records no owner
until it is claimed, so before the claim there is no identity to write a grant
for; the claim still needs a permission and everything after it does not.
The ownership itself comes through a port rather than a new dependency:
DelegationRequestOwnership, implemented by DelegationRequestService and asked by
IamService, which is how ScpProvider and ResourcePolicyProvider are declared so
that IAM does not reach into another store.
Glue was one of the namespaces the table of request resources did not
read yet, so under enforcement every Glue request was checked on *: a
grant scoped to one database or table could not allow anything, and a
deny scoped to one did not hold.
- Glue moves from NOT_COVERED to NAMESPACES and the generator reads all
314 of its operations. A table operation is checked on the account's
Data Catalog, the database and the table, the three types the Service
Reference gives glue:GetTable and its kin; a database operation on the
catalog and the database; jobs, crawlers, triggers, workflows and
connections on the ARNs Glue mints for them.
- Where a Glue request names its resources in ways the generator did not
read yet, its rules read a little further, each from botocore alone:
Input and List drop from a member's stem as Config and plurals do
(DatabaseInput.Name, ConnectionNameList); a list whose own list shape
is named for the type's names fills it (BatchDeleteTable's
TablesToDelete, a BatchDeleteTableNameList); "being" ends a type's name
in documentation (GetWorkflowRun's Name, "name of the workflow being
run"); a type of no variables of its own, the account's catalog, is no
longer dropped as an alternative to the unnamed type a create makes;
and a create whose request carries tags and whose action acts on other
types alone tags the resource it makes when the request names it in
full (CreateConnection's tags on connection/<ConnectionInput.Name>),
which the table reader now accepts.
- Outside Glue those rules change four entries: Redshift's
BatchModifyClusterSnapshots is checked on the snapshots its
SnapshotIdentifierList names instead of *, and EventBridge's
CreateEventSource and QuickSight's CreateDataSet and CreateTopic gain
a makes that changes nothing at runtime. Every other entry is
unchanged.
- What the table does not read stays as the metadata gives it: a
CatalogId is not read, so another account's or a federated catalog is
checked on the caller's account's ARNs, and a schema named by its
registry and name on schema/<SchemaName>, the Service Reference's
format, whose botocore pattern takes no slash.
IamRequestResourceEnforcementIntegrationTest checks a table on the
catalog, its database and itself, a database and a job on the ARNs Glue
gives them, a deny on one table or connection holding inside a batch
delete, a database's creation on its DatabaseInput.Name, a connection's
tags on its ConnectionInput.Name, and a workflow run on its workflow.
The generator's tests cover each rule; iam.md says so.
The embedded DNS server only started when Floci ran in Docker, so a
natively running Floci left <service>.<namespace>, Route 53 private
zone records and its own names unresolvable, both for the containers it
launches and for the host.
Natively it now starts up to two listeners. On a host with a docker0
bridge it listens on that bridge's address, port 53, the address
host-gateway points at, and hands it to the containers it launches as
their resolver, as it does from Docker. Port 53 needs root or
CAP_NET_BIND_SERVICE; without it Floci logs how to grant it and the
containers keep resolving through Docker. floci.dns.bridge-listener-enabled
turns it off. With floci.dns.host-port set it also listens on 127.0.0.1
at that port for the host's own resolver; that listener is never handed
to containers, and it refuses names Floci does not hold rather than
forwarding them, so a host resolver that routes a domain to Floci cannot
get a lookup back. Each listener answers Floci's own names with its own
address.
Startup now waits, up to five seconds, for the listener containers are
given to bind or fail, in Docker as well as natively, so a container
launched right after startup is not created without Floci's resolver.
Closes#2556
EMR Serverless resolves a custom image's digest either for each workload
or once, at the application's start: "Custom images are resolved to a
digest at application start; that digest is used for all jobs until the
application restarts". The user guide's table makes that the default for
EMR 7.13 and earlier (applicationLevelDigestResolution = true) and
resolution per workload the default from 7.14. Floci resolved every
custom image for each run, whatever the release or the setting.
Where an image configuration's applicationLevelDigestResolution is true,
or left unset on 7.13 or earlier, the application now reads the digest
of its image in Floci's ECR as it starts, gives it to the image
configuration as its resolvedImageDigest, and each run pulls the image by
that digest until the application starts again, an update meanwhile
notwithstanding; a job run's image configurations carry it. An image
outside ECR, or one Floci's ECR does not hold, has no digest to read and
is resolved for each run, as before, as is one in another account's
repository, which Floci does not check the application may pull; any
other answer from Floci's ECR fails the start, leaving the application
as it was. An update that turns a running application's image to
resolution per workload ends its pin, and a stopped application reports
no digest. EcrRegistryManager gains ecrImage, the repository and the tag
or digest an image URI names.
When a .sync Task's wait ends early, Step Functions "will make a
best-effort attempt to cancel the task". Floci's EMR Serverless undo
already passes over only the answers that say the application or run is
gone or past undoing, and fails the Task with any other. Its three
siblings passed over every failure: the EMR step's cancel, the ECS
tasks' stop and the child execution's abort.
Each now passes over only its service's answer for a job that is gone or
past undoing, logged as before: EMR's InvalidRequestException for a
cluster that is gone or a release that cannot cancel steps (a step it
will not cancel comes back FAILED in an answer that succeeds), ECS's
InvalidParameterException for a task it does not know, and Step
Functions' ExecutionDoesNotExist; a task already stopped and a child
already ended are answered without an error. Any other refusal fails the
state with the integration's error (EMR.<name>, ECS.<code>,
StepFunctions.<code>) and the service's message, the ECS one once every
task has been asked to stop, and any other failure is raised.
A cluster's instance groups and fleets reported RUNNING, with all their
capacity, from its creation until it was TERMINATED, whatever state the
cluster itself was in. InstanceGroupState and InstanceFleetState have
PROVISIONING, BOOTSTRAPPING and TERMINATING too, and the Management
Guide's events end an instance fleet's provisioning with "Provisioning
for instance fleet ... is complete ... The instance fleet now has
On-Demand capacity of Num".
No source says when each applies, so they now follow the cluster's state,
Floci's reading: PROVISIONING while it is STARTING, with nothing running
or provisioned yet, BOOTSTRAPPING with every instance up for its bootstrap
actions, RUNNING while it runs or waits, and TERMINATING as it ends, the
instances still running. One added later takes the state its cluster's
others are in. ListInstances gives each instance its group's or fleet's
state, lists those being provisioned, and filters by InstanceStates per
instance. A cluster terminated while it is STARTING keeps listing the
instances it was provisioning, still PROVISIONING and none of them
running, until it is TERMINATED, so the same instances are listed
throughout.
The generated request resources give CloudFormation's stack, stackset and
changeset types aws:ResourceTag/ keys, but CloudFormationStoredResourceArns
did not answer storedTags, so a condition on their tags saw none. It now
answers from CloudFormationService.storedTags, which reads the live stack, or
the change set, under the ARN in the account and Region it names, and
StackSetService.storedTags, which reads the stack set under the ARN in the
account it names, a pre-multi-account one of the default account in place;
each matched on the whole ARN, reading only.
Under IAM enforcement no S3 Vectors request was checked: its model was
not among the vendored REST routes and the s3vectors namespace's request
resources were not read, so every call went through. regen_rest_routes.py
now vendors its routes and the request-resources and tag-on-create
generators read the namespace, so a vector bucket call is checked on the
bucket its vectorBucketName or vectorBucketArn names, an index or vector
call on the index its bucket and indexName or its indexArn names, and
ListVectorBuckets on *. Nothing in IAM is written by hand for it.
The IAM tests of REST services (CloudFront, EMR Serverless, S3 Tables,
S3 Vectors) sign and send their requests through one shared
SignedRestRequests helper.
S3 Tables now serves GetTableBucketEncryption, returning the encryption
configuration CreateTableBucket stored, a configured KMS key ARN
included. A bucket created without one, or loaded from an older
snapshot, reports AES256. It is configuration readback only: Floci does
not encrypt table data or use the KMS key, and updating or deleting a
bucket's encryption configuration is not implemented.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
HTTP_PROXY request parameter mappings on HTTP APIs now read $request.body, $request.body.<JSONPath>, $stageVariables.<name> and $context.<name>, the sources the AWS service integration subtypes already read, resolved by ContextValueResolver for both integration types. A header mapping that carries a control character is refused with 502 before anything reaches the backend, and an overwrite:path reads each embedded source expression whole, bracketed JSONPath selectors included.
Signed-off-by: Tyler Webb <tyler.webb@verkada.com>
API Gateway's GetAuthorizers now pages with limit and position instead
of returning every authorizer at once: authorizers come back sorted by
id, at most limit of them (25 by default, capped at 500, refused below
1), with position set to the id the next page starts after, and an
unknown position is refused with BadRequestException as GetUsage and
GetDocumentationParts refuse one. GetAuthorizers and
GetDocumentationParts share one id-cursor page helper returning
PaginatedResult, and the page-size rule all three paged calls use is
named resolvePageSize.
Closes#8439
The generated request resources give Scheduler's schedule-group type
aws:ResourceTag/ keys, but SchedulerService did not answer storedTags, so a
condition on a schedule group's tags saw none. SchedulerService.storedTags
now reads the one group entry in the account and Region the ARN names and
gives its tags, matched on the whole ARN, reading only; a group stored before
storage was account-aware is read in place for the default account, and the
default group has none until a request stores it.
Tagging and untagging now put a new tag map in place of the group's, taking
turns on the group, and the field is volatile, so the lookup, and the
existing tag listing, always copies one whole set nothing changes after.
EMR's documentation sets four limits on steps that Floci did not check:
StepConcurrencyLevel "a minimum of 1 step and a maximum of 256 steps"
(ModifyCluster; "The maximum value is 256" for RunJobFlow); "only 256
steps can be RUNNING or PENDING at any given time"; an ActionOnFailure
other than CONTINUE added while the level is above 1, where "The step is
not submitted and the action fails with a message that the ActionOnFailure
setting is not valid"; and CancelSteps, "Available only in Amazon EMR
versions 4.8.0 and later, excluding version 5.0.0", with "A maximum of 256
steps ... in each CancelSteps request".
Each is now refused in the error code its operation's model points at:
ValidationException from RunJobFlow and AddJobFlowSteps, which declare no
InvalidRequestException, as Floci's other refusals of theirs, and
InvalidRequestException from ModifyCluster and CancelSteps. No source
gives AWS's messages, so they are Floci's.
UpdateKeyValueStore and DeleteKeyValueStore answered every If-Match that
did not match the store's control-plane ETag with InvalidIfMatchVersion
(400). A stale version Floci issued, one that a comment update has since
rotated, now fails with PreconditionFailed (412); a missing or malformed
version keeps InvalidIfMatchVersion. A refused request leaves the store
and its data plane unchanged, and the CloudFront overview and the
key-value-store section of the docs describe the same statuses.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
* fix(autoscaling): register instances with a Classic Load Balancer on attach and deregister them on detach
* fix(autoscaling): put members back in what they left when a detach is refused
* test(autoscaling): share the attachment tests' groups in one fixture