Under IAM enforcement, CreateAssociation is checked on the document its
Name gives as well as the association it makes, which the generated
request-resource table has done since #8203. An enforcement test now
shows a user allowed on one document can associate it and is refused
for another, and a request-resource test shows a shared document given
by its ARN is checked on that ARN. The SSM docs note the check.
ECS was not read by the request-resources generator, so under IAM enforcement
every ECS request was checked on *: a grant scoped to a cluster, service or
task definition was refused, and a deny scoped to one never applied. ecs now
moves into NAMESPACES, and where the rules misread it the rule is fixed:
- a member whose documentation spells a type of two variables as its format
does ("(family:revision)" for a task definition) is found by its service,
each element of a list, rather than read as an ARN alone;
- a member documented as naming its service's default when left out ("If you
do not specify a cluster, the default cluster is assumed") names it
(defaults), rather than naming nothing;
- a member documented as a name or an ARN of another type, in either order or
naming the type before them, reads that type's ARN (arnOf), as a pattern
taking one does;
- a list element's id field beside an enum field holding the target's type,
whose one value is the action's type, fills that type's last variable
(PutAttributes' attributes[].targetId).
The reader fills a defaults member from the default the service gives, finds
each value of one list member, and names a resource given by its own full ARN
for a type of several variables too, also giving the variable that ARN's value
beside the request's other members, as a handler may read either. EcsService
answers the lookups, reading only: the revision a reference the table finds
resolves to, and the default cluster. It now mints a service's deployments
and revisions under the service, as AWS does.
The ECS task arms of Step Functions now take the action from
IamAuthorizedActions and the resources from RequestResources.ofBody, as the
EMR arm does, so a service, cluster or task definition ECS does not have is
checked on the ARN the request names, as the direct call is.
Three ways a read through upstream repositories differed from the User
Guide:
- Upstreams were searched breadth-first. "If an upstream repository has
its own upstream repositories, the same logic is used to find a package
version before moving to the next upstream repository": the guide's
own example, my_repo with upstreams A and B, A with C and D and D with
E, is searched my_repo, A, C, D, E, B. The walk is depth-first in each
repository's listed order now.
- A version an upstream had itself retained named that upstream as its
origin, and one the upstream got from public:npmjs came back INTERNAL.
A version's DomainEntryPoint is where it "originally entered" the
domain, so a retained version now carries its upstream's own entry
point: the external connection, EXTERNAL, or the repository it was
published to, however many upstreams it came through. It is read
again when the version's claim is confirmed, so a copy made while the
upstream's own fetch is still finishing gets that fetch's connection.
- An upstream's external connection was never consulted, so a version no
upstream had fetched yet was a 404. AWS fetches it through the
upstream's connection and retains it there and in the repository the
request was made to. A miss at every upstream now tries the external
connections of the upstreams in the same order, for npm, Maven, PyPI
and NuGet, and a packument, Simple index or maven-metadata.xml read
through such an upstream offers what its connection has. That fetch
skips a version Archived or Disposed at the upstream, or here in the
Simple index, reads this repository's fences before it starts, so a
deletion during it is not undone, and passes on an npm client's ask
for the full packument. The four formats share it in
UpstreamExternalConnectionFetch.
The in-guest IMDS relay listened on 169.254.169.254:80, so Apache and
other wildcard port-80 listeners could not start in an EC2 guest. The
relay now listens on its own port, 42169, and an iptables or nft NAT
rule routes local link-local port-80 traffic to it. The guest's own nft
rules are kept, and only Floci's relay rule is added or removed. With no
working NAT backend, the older port-80 listener keeps IMDS available.
A protected instance's restart retires a retained older listener before
the workload starts, and a failed start rolls back the IMDS registration
it made. The network helper image now includes iptables.
Closes#7937
The User Guide: "Every domain in CodeArtifact automatically contains a
root package group", /*, which "can be modified, but cannot be deleted".
CreateDomain created no group, so on a fresh domain ListPackageGroups was
empty, DescribePackageGroup and GetAssociatedPackageGroup answered
ResourceNotFoundException for /*, a package no group reached had no group
at all, and DeletePackageGroup /* succeeded on a group a caller had made.
CreateDomain creates the root with the domain now. Its description is
"Default root package group" and each of its restrictions is ALLOW, as
recorded against AWS, so a group under it inherits from it rather than
from nothing. CreatePackageGroup /* is refused as the group it is, and
DeletePackageGroup /* with ValidationException "The root package group,
'/*', cannot be deleted.", AWS's own sentence. A domain stored before
this gets its root once storage is loaded at startup.
ListInstanceFleets wrote no InstanceTypeSpecifications: the fleet kept
only the names of the instance types it was created with. The Terraform
AWS provider reads instance_type_configs back from that member, a
ForceNew set in both aws_emr_cluster and aws_emr_instance_fleet, so a
fleet cluster read back empty after apply and every later plan replaced
it.
A fleet keeps the InstanceTypeConfigs it was given, from RunJobFlow and
AddInstanceFleet, and ListInstanceFleets returns each as the
InstanceTypeSpecification it describes: its type, bid price, custom AMI,
priority and configurations as given, a WeightedCapacity of 1 where it
sets none and a BidPriceAsPercentageOfOnDemandPrice of 100 where it sets
neither bid price, the defaults the API reference gives for both, and its
EbsConfiguration as one EbsBlockDevice per volume. The reference names no
devices, so they are /dev/sdb, /dev/sdc and on. A fleet stored before
this has its instance types alone, with the same defaults.
CancelSteps on a RUNNING step stopped its driver and started the next
PENDING step at once, but stopping a driver only asks for it: with a
step concurrency level of 1 the next step's driver could start beside
the cancelled one's. The Management Guide's "Cancel steps": "Canceling
a running step does not allow a pending step to start running, assuming
no change to stepConcurrencyLevel", and CancelSteps "is idempotent but
asynchronous".
In the docker runner mode a cancelled RUNNING step is now CANCEL_PENDING
while its driver stops, with the guide's step event for that state ("was
cancelled at Time and is pending cancellation", WARN), and keeps its
place among the running steps. Once its driver is gone, however it
ended, the step is CANCELLED, takes no ActionOnFailure, and the next
PENDING step starts. A second cancel answers SUBMITTED. A driver Floci's
own teardown stops leaves the step CANCEL_PENDING, as it leaves a
RUNNING one, and a restart cancels it, in either runner mode;
TerminateJobFlows cancels it at once. Until it is gone it also counts as
running for a failed step's CANCEL_AND_WAIT. In the immediate mode
nothing runs, so a cancelled step is still CANCELLED at once.
An action, a resource and a principal are written as strings: the policy grammar
spells each one out, as an <action_string>, a <resource_string> and a
<principal_id_string>. The evaluator read an element that was no string as
naming no value when it stood on its own and as the text of that value when it
sat in a list, so "Resource": 123 named no resource while "Resource": [123]
named the pattern 123.
A list is read like the bare element now, and an entry that is no string names
nothing. It tells where the element carves an exception out, since a statement
matches on whichever of the two elements it names: a NotAction or a NotResource
whose only entry was a number excluded that one text and so covered every action
or every resource there is, which made an Allow a grant over everything and a
Deny a refusal of everything. Naming no value leaves the statement matching
neither.
Condition values keep the reading they had. The grammar's JSON rules say
quotation marks "are optional for numeric and Boolean values", a lone number or
boolean was read as the text of the value already, and a list of them is read
that way still, so the two readings sit under names that say which is which.
Naming no value is a shape the access report had to learn as well.
deniesEveryRequest read a Deny that names no resource as one that bites on
every request, where matchesResource reads the same statement as matching
nothing, so an allow-everything beside a Deny whose Resource carries only a
number took the service off the Organizations access report although every
request still reached it. The report reads a statement the way the decision
does now: a Deny covers every request only when its Resource names *.
AssumeRolePolicyEvaluator refuses a trust policy with a statement that
names no valid Effect, or whose Condition is not an object of non-empty
operator objects: IAM refuses such a document when it is written, and
Floci stores it as given, so the whole document is refused when it is
read. The two federated evaluators read the same stored document another
way. WebIdentityTrustPolicyEvaluator defaulted a missing Effect to Allow
and SAMLTrustPolicyEvaluator allowed on anything that was not a Deny, so
a statement naming a federated principal and no effect let
AssumeRoleWithWebIdentity and AssumeRoleWithSAML assume a role that
AssumeRole refused. An Effect spelled "allow" or "Permit" granted the
same way, and an empty Condition, or one whose operator was empty, was
read as no condition at all.
The reading moves into TrustPolicyStatements, and all three evaluators
use it, so one stored trust policy answers the same on each path: a
document carrying such a statement lets no one assume the role.
Every @QuarkusTest class shares one emulator, so whatever a test leaves
behind shows up in any later unscoped List call. Five classes left
resources there:
- S3LeadingSlashKeyIntegrationTest kept test-slash-bucket and
test-slash-list-bucket with their objects. Each test now creates its
own bucket and names the keys it writes, and the class's @AfterEach
deletes those keys and then the bucket, so the tests no longer rely
on running in order.
- IamRestRouteEnforcementIntegrationTest left an organization with a
member account and service access in its management account, a RAM
share whenever the test's last assertion failed, and a CloudFront key
value store. Each is registered with the class's PartitionCleanup as
it is created; the organization's service access goes with it.
- CloudFormationDeletionPolicyIntegrationTest left the buckets its
Retain tests keep, and the stacks of its rollback and update tests.
- EmrServerlessJobRunIntegrationTest deleted one of the 35 or so
applications it creates. Each is deleted after its test now, its
unfinished runs cancelled first, since StopApplication refuses an
application with a run still going.
- RedshiftServerlessSnapshotSharingIamEnforcementIntegrationTest left a
KMS key, namespaces, workgroups and snapshots, in its first two tests
as well as in the encrypted-snapshot helper. Each create is now
registered with PartitionCleanup, in the order that lets it go.
CDK's ApplicationListener.addCertificates puts the first certificate on
the listener and emits one ListenerCertificate for each extra one. Floci
had no provisioner for the type, so it was stubbed as CREATE_COMPLETE and
did nothing; since the default certificate is held apart from the
listener's certificate list, such a listener came up with an empty list
and served none of its SNI certificates.
ElbV2CfnProvisioner serves the type now. Create adds the declared
certificates to the listener's list, as AddListenerCertificates does, and
delete removes the ones the resource added, recorded per physical id
because the id alone cannot carry them. Certificates updates in place, as
the resource reference says: the certificates the template gains are
added, then the ones it drops removed, and a failed update puts both back.
ListenerArn is create-only, so a change replaces the resource: the
certificates go onto the new listener, and come off the old one once the
update commits.
CloudFormation publishes no format for the resource's identifier, so Ref
returns <ListenerArn>|<suffix>.
AWS's published resource schemas have moved since the vendored tables
were last synced: AWS::Lambda::Function gained AcceleratorConfig and
RuntimeConfig, and AWS::ECS::TaskDefinition TrustedExecutionConfiguration.
That fails the online check of those tables, which this change runs, so
cfn-property-types.json and schema-surface.tsv are synced from AWS here,
and the three new properties are recorded as accepted and ignored.
* fix(eks): keep a cluster's API server port when its container is recreated
* fix(eks): leave a network-mode endpoint's port out of the restored port
* fix(eks): free an unadoptable survivor's port first, and tell a taken port from an error
CreateServiceSpecificCredential resolved the service name first, so a request
that named a user who does not exist and a service that is not supported was
answered for the service. AWS answers for the user: a recording validated
against a real account asks for a credential as a user that was never created,
once with CodeCommit and once with a service name nothing supports, and both
come back NoSuchEntity with "The user with name <name> cannot be found."
The user is confirmed before the service name is read now, under the lock it was
already taken under. ListServiceSpecificCredentials had the same shape, with its
ServiceName filter resolved ahead of the user it lists for, and reads the two the
same way round. Under AllUsers there is no user to look up, so an unsupported
filter still answers for itself.
What the bounds of CredentialAgeDays say is settled ahead of both by the
constraints every request is held to, so only the question that needs the service
is left behind it: whether this service takes the member at all. The in-operation
bounds stay where they are as the backstop they became.
EC2 network operations with resource-scoped policies were checked against
`*`, and stored ownership conditions were missing. Every EC2 request is
now read by the generated request-resource rules, its EC2 Query list
names from botocore, so a resource-scoped policy applies to each EC2
operation whose request names a resource. A list a type's ARN variable
names is the request's targets only when the request names nothing
else, and the sg-, acl-, rtb- and eni- id prefixes come from botocore's
examples.
Each target is evaluated with its own stored tags, under every EC2
type's Service Reference resource-tag keys, and tags on creation are
authorized separately. A forged SDK spelling cannot replace an EC2 wire
value. ENI creation tags are kept in the regional tag index and stay in
sync with CreateTags and DeleteTags.
Closes#8286Closes#8287Closes#8291Closes#8295Closes#8300Closes#8306
UpdateApplication now takes a STARTED application's maximumCapacity and
custom images (imageConfiguration, workerTypeSpecifications), as the
User Guide's "Updating Running Applications" describes: "You can update
key application configurations such as maximum capacity, and custom
image settings - without stopping and restarting the application."
Every other setting still needs a CREATED or STOPPED application, as the
API reference's "An application has to be in a stopped or created state
in order to be updated" says, and an image change on an application with
initial capacity is refused: "Custom image updates on running
applications are not supported on applications with pre-initialized
capacity configured."
A run already going keeps the image and maximum capacity it was launched
with, and a new run, or a new attempt of one, takes the application's
current ones, as each run already reads them when it is launched.
The EMR Serverless task arm wrote its action ("emr-serverless:" plus the API
name) and its ARNs (/applications/<id>, /jobruns/<id>) by hand, and skipped
the checks a direct request gets beside its own action: iam:PassRole on
StartJobRun's execution role, and emr-serverless:TagResource on the tags
CreateApplication and StartJobRun send.
A new RequestChecks reads a JSON request as the enforcement filter reads the
same request made directly: the action from IamAuthorizedActions, its
resources from RequestResources.ofBody, the request's tags on the action where
the tag-on-create table says it takes them, iam:PassRole on each role the
passed-roles table reads with iam:PassedToService, and the tagging action on
what a create makes. PassedRoles, TagOnCreate and RequestResources.created
gain a body form for it. The arm now hands RequestChecks the request the
integration sends EMR Serverless, so a regeneration of any of those tables
moves the task and the direct call together.
* fix(route53): populate record change IAM conditions
* fix(route53): align DNS identity and preserve XML validation errors
* fix(route53): read record change conditions from the generated table
* fix(ecs): keep a load-balanced service task running while its targets drain
* fix(ecs): stop a replaced task only once its replacement's targets are healthy
* fix(ecs): drain a load-balanced task as DEACTIVATING and hold a deployment on unhealthy replacements
AWS requires the customer managed key of an encrypted snapshot to be shared
with the account restoring it (Redshift Management Guide, "Sharing a
snapshot"). Neither botocore nor the Service Reference says so, so the
request-resources generator states it in FORWARDED, an evidence entry under
MEASURED's rules: the action and the snapshot type, with the rest read from
the metadata (the key type and format kms:Decrypt acts on, the snapshot
record's KmsKeyId member, the endpoint prefix, kms:ViaService).
Under IAM enforcement a Redshift or Redshift Serverless restore is then also
checked as kms:Decrypt on the key the snapshot records, found in the
snapshot's account, against the key policy and the caller's own policies,
with aws:ViaAWSService and kms:ViaService naming the service's endpoint. KMS
key policies are now evaluated as resource policies.
A key KMS would not use, disabled, pending deletion or not held, refuses the
restore, as KMS refuses the request the service makes with it. A snapshot
under AWS's own key records none, and one under an AWS managed key (a copy
grant made without a key) needs nothing, as AWS writes that key's policy to
let the account use it through the service.
GetJobRun now carries the job run's imageConfiguration and
workerTypeSpecifications. Each attempt copies its application's image
configurations as they stand when the attempt is made. The configuration
the driver takes its image from, its worker type's or else the
application's, gets the resolvedImageDigest of the image the attempt
pulled for the driver: the manifest digest the Docker runner's pull
already returned. The executors' configuration gets theirs, or keeps the
driver's where the two share one. "To identify which image version each
job is running, the GetJobRun API response returns the resolvedImageDigest
for that specific job."
A retried attempt resolves its images again ("New job attempts will pick
new images") and keeps its own digests; earlier attempts keep theirs. A
configuration no worker type ran gets no digest, even one naming the same
image, nor does an image built locally under that URI, nor any outside
the docker runner mode. The application's own resolvedImageDigest, which
AWS fixes at its start for 7.13 and earlier, is not part of this change.
* fix(ec2): honour DryRun on the rest of the instance calls
* refactor(ec2): launch a Spot request's instances and check its dry run through one call
* test(ec2): compare instance snapshots with their reservation ids, now stable on main
Under IAM enforcement, these tasks are now authorized as the execution role, or as the Credentials role a state names. ECS runTask, in all its forms, is checked on the task definition revision it would run, so a family and the revision it stands for are the same resource. The ECS SDK tasks are checked on the service ECS would act on or describe, and listServices on any resource. Each EMR and EMR Serverless API is checked on its cluster, application or job run under its IAM action, and a ByName API needs the list it makes as well as the modify. createCluster and createApplication have no resource type, so they are checked on any resource.
A .sync task needs its starting call alone, so a job cannot fail mid-wait for lack of a Describe permission. A request naming nothing it can reach is left to its service, and a form an integration does not serve stays unsupported. With enforcement off nothing changes.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
DeleteFunction answered 204 for every function. AWS answers 202 with {}
when it deletes a durable function or a published version of one, and
Floci now does the same. A plain function and a missing version still
answer 204.
The policy evaluator defaulted a statement's Effect to Allow, so a statement
that named none granted what it described. The IAM guide says the element "is
required and specifies whether the statement results in an allow or an explicit
deny" and that "valid values for Effect are Allow and Deny", so a statement
naming neither describes no permission, and a document that describes no
permission is not a document that grants one. A resource policy whose statement
named a principal and an action but no effect allowed that call, and so did a
session policy, a service control policy and an identity policy: a statement is
held to naming an action and a resource when a document is stored, not to naming
an effect, so such a document is kept as written and was then read as a grant.
A statement names one of the two effects the policy language defines or it names
none, and one that names none states nothing. An Effect that is absent, that is
not a string, or that is some other word is read as neither now: the statement
grants nothing, denies nothing, and the request is decided by the rest of the
document. That is already this package's reading of a role trust policy, where a
statement whose Effect names neither effect matches nothing.
The service list behind GetOrganizationsAccessReport read the same default the
other way round. Walking the service control policy levels, every statement that
was not a Deny was counted as an allow, so a statement naming no effect, or
naming some word that is neither, left a service reachable through a statement
that permits nothing. Only an Allow counts there.
No document is held to a shape here: what is stored is read exactly as it was,
and this changes only what reading it comes to.
* feat(redshift): map Redshift IAM credentials to PostgreSQL roles
* docs(redshift): document IAM database identity for Redshift services
* fix(redshift): harden Redshift IAM role handover and DbGroups lifecycle
* fix(redshift): grant public schema usage on auto-create and resolve latest credential
* fix(redshift): log in as the IAM-derived role so PostgreSQL blocks the switch back
* fix(redshift): restore the role's own password once the backend login completes
* chore(redshift): write the password tracker lock comment in English
A cluster whose bootstrap action failed in the docker runner mode ended with
BOOTSTRAP_FAILURE and AWS's message, but DescribeCluster and ListClusters gave
no Status.ErrorDetails, which the Management Guide's error code pages point to
for the failed action, its return code and its script.
- An action that exits with another code than 0 gives
BOOTSTRAP_FAILURE_PRIMARY_WITH_NON_ZERO_CODE, with the ErrorData keys its page
lists: primary-instance-id, bootstrap-action, return-code, amazon-s3-path and
public-doc. A script that cannot be read gives
BOOTSTRAP_FAILURE_BA_DOWNLOAD_FAILED_PRIMARY, with the same keys but
return-code. ErrorData is a list of maps and no source shows how AWS spreads
the keys over them: Floci gives one map holding them all. ErrorMessage is the
reason's message and the error code's page, in Floci's words.
- A bootstrap that cannot run at all, or that Floci stopped, ends with
INTERNAL_ERROR as before and has no ErrorDetails: no documented code fits.
- The details are stored with the cluster, so they survive a restart with
persistent storage, and emr.md says what Floci gives.