Files
floci/src/test/resources/application.yml
T
Hector Ventura 0bc85f3ef8 fix(sts): mint global STS and IAM ARNs per partition and add a strict partition mode (#4743)
* fix(sts): mint global STS and IAM ARNs per partition and add a strict partition mode

GetCallerIdentity's root fallback, the AssumeRole family's session ARNs, the
OIDC provider ARN and GetFederationToken built their ARNs with an empty
region, which falls back to the commercial partition, so they carried arn:aws:
whatever partition the request signed. They now go through
RegionResolver.buildGlobalArn. GetAccountSummary reports
GlobalEndpointTokenVersion only where the partition publishes a global STS
host, which is aws alone.

floci.partitions.strict (FLOCI_PARTITIONS_STRICT, default false) refuses a
request signed for a service AWS publishes in another partition but not in
the request's one (CloudFront in GovCloud, IAM in aws-eusc) with the
unknown-service guard's 404, mirroring the host that never resolves on AWS.
endpoints.json omits the services that ship only an endpoint ruleset, so a
service the data lists nowhere is served everywhere. Credential scopes carry
signing names, and 46 of them differ from the endpoints.json keys they cover
(73 keys, such as ecr for api.ecr); regen_partitions.py vendors that map as
signingNames and AwsPartition.offersSigningName joins it.

Part of #4272

* fix(core): read the gzipped botocore models the pip package ships when collecting signing names

The botocore wheel ships each service model as service-2.json.gz, while the checkout under local/aws/botocore ships it plain. collect_signing_names looked only for the plain file, so in CI, which resolves botocore to the installed package, it found no models, generated an empty signingNames and failed aws-data-check against the committed map. It now reads either form, as regen_dynamodb_shapes.py already does.

* fix(sts): keep an assumed-role session in its role's partition, and answer strict-mode Query requests in XML

GetCallerIdentity rebuilt an assumed-role session's ARN with an empty region, which falls back to the commercial partition, so a session AssumeRole issued as arn:aws-cn:sts:: came back as arn:aws:sts::, and a chained AssumeRole was then refused by a China trust policy as a caller from another partition. The session ARN now takes the partition its role ARN names.

Strict partition mode refused a form-encoded Query request (IAM in aws-eusc) with a JSON body; it now returns the Query XML error the unknown-region guard beside it already returns for such requests.

* fix(iam): mint IAM resource ARNs in the request's partition and keep them there

CreateUser, CreateGroup, CreateRole, CreatePolicy, CreateInstanceProfile and
CreateOpenIDConnectProvider minted arn:aws: whatever partition the request
signed, while STS now followed the request. Under China that denied
AssumeRoleWithWebIdentity (the trust policy names the arn:aws: provider ARN
CreateOpenIDConnectProvider returned, matched against arn:aws-cn:), and
AssumeRole reported the request's partition while GetCallerIdentity reported
the role's.

An IAM resource is now created in the request's partition and keeps it:
UpdateUser and UpdateGroup re-mint in the stored ARN's partition. Anything
derived from a stored role follows the role: all three AssumeRole handlers,
resolveCallerArn and the web identity OIDC provider ARN take the role ARN's
partition through AwsArnUtils.partitionOrDefault. The credential report's
root row takes the request's partition.

* fix(sts): mint a session from the stored role, and keep one credential report per partition

AssumeRole, AssumeRoleWithWebIdentity and AssumeRoleWithSAML find the role by
account and name, but minted the session ARN from the RoleArn the request
named. A China role assumed with an arn:aws: RoleArn therefore came back as an
arn:aws:sts:: session, while AssumeRole registered the session under the
stored role's ARN, so GetCallerIdentity reported aws-cn. All three handlers
now mint the session from the stored role's ARN when the role exists and
register it under the same ARN.

The credential report was cached once per account, so a report generated for
one partition was handed to a caller in another for four hours, with the
wrong partition's root row. It is now kept per partition.
2026-09-30 20:48:20 -04:00

542 lines
14 KiB
YAML

quarkus:
http:
port: 0
test-port: 0
# Integration signatures use localhost as the public test authority. Keep the test listener
# explicit so the production loopback default does not change the signed host.
host: 0.0.0.0
limits:
max-body-size: ${floci.protocols.max-request-size}M
# Groovy (a REST Assured dependency) starts DFA-cache-cleaner threads that never stop.
# Loaded parent-first they live in the shared system classloader, so they cannot pin a
# per-profile application classloader across the many app restarts of a test run.
class-loading:
parent-first-artifacts: org.apache.groovy:groovy
floci:
base-url: "http://localhost:4566"
network:
security-group-enforcement:
enabled: true
helper-image: floci/network-helper:local
default-region: us-east-1
default-account-id: "000000000000"
partitions:
strict: false
allow-unknown-regions: false
ai-mock-config-file: ${AI_MOCK_CONFIG:src/test/resources/fixtures/ai-mock-config.json}
storage:
mode: memory
persistent-path: ./target/test-data
prune-volumes-on-delete: true
wal:
compaction-interval-ms: 60000
services:
ssm:
flush-interval-ms: 60000
dynamodb:
flush-interval-ms: 60000
sns:
flush-interval-ms: 60000
lambda:
flush-interval-ms: 60000
cloudwatchlogs:
flush-interval-ms: 60000
cloudwatchmetrics:
flush-interval-ms: 60000
secretsmanager:
flush-interval-ms: 60000
acm:
flush-interval-ms: 60000
opensearch:
flush-interval-ms: 60000
sagemaker:
flush-interval-ms: 60000
batch:
flush-interval-ms: 60000
lightsail:
flush-interval-ms: 60000
codepipeline:
flush-interval-ms: 60000
s3vectors:
flush-interval-ms: 60000
s3tables:
flush-interval-ms: 60000
ecs:
flush-interval-ms: 60000
codebuild:
flush-interval-ms: 60000
config:
flush-interval-ms: 60000
transcribe:
flush-interval-ms: 60000
codedeploy:
flush-interval-ms: 60000
tagging:
flush-interval-ms: 60000
elasticbeanstalk:
flush-interval-ms: 60000
cloudfront:
appsync:
flush-interval-ms: 60000
rum:
flush-interval-ms: 60000
resourceexplorer2:
mode: memory
flush-interval-ms: 60000
fis:
flush-interval-ms: 60000
guardduty:
flush-interval-ms: 60000
emrserverless:
flush-interval-ms: 60000
lakeformation:
flush-interval-ms: 60000
auth:
validate-signatures: false
presign-secret: test-secret
security:
extra-cors-allowed-origins: ${EXTRA_CORS_ALLOWED_ORIGINS:}
extra-cors-allowed-headers: ${EXTRA_CORS_ALLOWED_HEADERS:}
extra-cors-expose-headers: ${EXTRA_CORS_EXPOSE_HEADERS:}
disable-cors-headers: false
# The test listener binds all interfaces so Quarkus keeps localhost as its test authority.
# This is test-only; production keeps the loopback default.
allow-unsafe-network-exposure: true
allow-private-jwt-targets: true
init-hooks:
shell-executable: /bin/sh
timeout-seconds: 5
shutdown-grace-period-seconds: 2
tls:
enabled: false
self-signed: true
protocols:
strict-claiming: false
reject-unknown-service-scope: true
docker:
log-max-size: "10m"
log-max-file: "3"
resource-namespace: ""
services:
ssm:
enabled: true
max-parameter-history: 5
sqs:
enabled: true
default-visibility-timeout: 30
max-message-size: 1048576
s3:
enabled: true
enforce-auth: false
default-presign-expiry-seconds: 3600
global-bucket-namespace: false
dynamodb:
enabled: true
vector-index-allocation-seconds: 0
vector-index-backfill-seconds: 0
backend: native
sns:
enabled: true
lambda:
enabled: true
docker-flags: ""
honour-architectures: false
zip-max-entries: 100000
# aws-config-path:
hot-reload:
enabled: true
apigateway:
enabled: true
vtl-max-loops: 10000
vtl-max-output-chars: 1048576
vtl-timeout-millis: 5000
apigatewayv2:
enabled: true
iam:
enabled: true
enforcement-enabled: false
seed-deployer-principal: false
msk:
enabled: true
mock: true
default-image: "redpandadata/redpanda:latest"
amazonmq:
enabled: true
mock: true
amqp-host-port-base: 5672
amqp-host-port-max: 5699
console-host-port-base: 15672
console-host-port-max: 15699
kinesis-analytics:
enabled: true
mock: true
elasticache:
enabled: true
proxy-base-port: 6379
proxy-max-port: 6399
default-image: "valkey/valkey:8"
default-memcached-image: "memcached:1.6"
memorydb:
enabled: true
mock: false
proxy-base-port: 6400
proxy-max-port: 6419
default-image: "valkey/valkey:8"
redshift:
enabled: true
default-port: 5439
image-version: postgres:15-alpine
poll-interval-ms: 1000
proxy-base-port: 7100
proxy-max-port: 7199
default-credential-duration-seconds: 900
proxy-handshake-timeout-millis: 10000
proxy-backend-connect-timeout-millis: 5000
proxy-max-connections: 100
rds:
enabled: true
mock: false
proxy-base-port: 7001
proxy-max-port: 7099
default-sql-server-image: "mcr.microsoft.com/mssql/server:2022-latest"
proxy-handshake-timeout-millis: 10000
proxy-backend-connect-timeout-millis: 5000
proxy-max-connections: 100
aurora-auto-pause-enabled: true
aurora-resume-delay-millis: 0
rds-data:
enabled: true
transaction-ttl-seconds: 180
redshift-data:
enabled: true
result-ttl-hours: 24
redshift-serverless:
enabled: true
neptune:
enabled: true
proxy-base-port: 8182
proxy-max-port: 8282
default-image: "tinkerpop/gremlin-server:3.7.3"
eventbridge:
enabled: true
cloudmap:
enabled: true
emr:
enabled: true
wafv2:
enabled: true
scheduler:
enabled: true
cloudwatchlogs:
enabled: true
max-events-per-query: 10000
cloudwatchmetrics:
enabled: true
secretsmanager:
enabled: true
default-recovery-window-days: 30
kinesis:
enabled: true
list-shards-next-token-ttl-millis: 300000
firehose:
enabled: true
tick-interval-seconds: 10
flush-record-count: 0
staging-bucket: floci-firehose-staging
kms:
enabled: true
cognito:
enabled: true
stepfunctions:
enabled: true
allow-plaintext-http: true
mock-config-file: ${SFN_MOCK_CONFIG:src/test/resources/fixtures/sfn-mock-config.json}
max-wait-seconds: 30
swf:
enabled: true
timeout-sweep-enabled: true
timeout-sweep-interval-seconds: 1
cloudformation:
enabled: true
# Pinned to the shipped default: the retention tests advance the test clock past this
# window by name, so the value they assume is spelled out rather than inherited.
deleted-stack-retention-seconds: 30
# Fail an AWS::Lambda::Function whose S3 code cannot be read, as real CloudFormation
# does. Set true to fall back to the built-in stub handler instead (issue #2648).
allow-stub-lambda-code: false
# Pinned to the shipped default so a test sees what a user sees; the strict-mode test
# overrides it with its own profile.
allow-stub-unsupported-resource-types: true
acm:
enabled: true
validation-wait-seconds: 0
athena:
enabled: true
mock: true
glue:
enabled: true
ses:
enabled: true
opensearch:
enabled: true
mock: true
proxy-base-port: 9400
proxy-max-port: 9499
ec2:
# Optional complete catalog override for locally built guest images.
image-catalog-path: ${FLOCI_SERVICES_EC2_IMAGE_CATALOG_PATH:}
enabled: true
imds-port: 9169
ssh-port-range-start: 2200
ssh-port-range-end: 2299
publish-security-group-ports: true
app-port-range-start: 30000
app-port-range-end: 30999
max-published-ports-per-instance: 20
socat-image: alpine/socat
volume-block-devices: false
volume-helper-image: alpine:3.21
mock: true
instance-resource-limits: true
aws-faithful-private-ip: false
# container-ips-routable: true # see src/main/resources/application.yml
# Off explicitly, not merely by implication of mock: true above. Tests must not create or
# reconcile Docker networks on whatever daemon CI happens to have.
vpc-networks:
enabled: false
ecs:
enabled: true
mock: true
host-volume-roots: []
allow-unsafe-host-volumes: false
appconfig:
enabled: true
appconfigdata:
enabled: true
ecr:
enabled: true
tls-uri: false
ui:
enabled: true
bedrock:
enabled: true
bedrock-runtime:
enabled: true
eks:
enabled: true
mock: true
max-memory-mib: 0
max-vcpus: 0
ecr-registry-mirror: true
imds: false
irsa-signing-key: true
embedded-dns: true
mwaa:
enabled: true
mock: true
pipes:
enabled: true
elb:
enabled: true
mock: true
elbv2:
enabled: true
mock: true
codebuild:
enabled: true
# docker-network: floci-network
sagemaker:
enabled: true
# docker-network: floci-network
gpu:
# Off by default: an existing deployment keeps launching CPU-only
# containers. How many GPUs an ml.* type has is shipped in
# sagemaker/instance-type-catalog.yaml; this is only about which of
# this machine's devices Floci may hand out.
enabled: false
# cdi | device-ids | count. Podman resolves only cdi, and accepts
# count while attaching no device, so cdi fails loudly instead.
mode: cdi
# Required for cdi and device-ids modes; unset allows no device.
# devices:
# - nvidia.com/gpu=GPU-<uuid>
batch:
enabled: true
runner-mode: immediate
codedeploy:
enabled: true
codepipeline:
enabled: true
source-poll-interval-ms: 100 # a shorter cycle so the "did not trigger" tests wait less
autoscaling:
enabled: true
applicationautoscaling:
enabled: true
elasticbeanstalk:
enabled: true
transfer:
enabled: true
backup:
enabled: true
job-completion-delay-seconds: 1
fis:
enabled: true
route53:
enabled: true
textract:
enabled: true
comprehend:
enabled: true
rekognition:
enabled: true
translate:
enabled: true
pricing:
enabled: true
ce:
enabled: true
cur:
enabled: true
emit-mode: off
bcm-pricing-calculator:
enabled: true
timestream-influxdb:
enabled: true
mock: true
bcm-data-exports:
enabled: true
emit-mode: off
oam:
enabled: true
cloudtrail:
enabled: true
flush-interval-seconds: 3600
lightsail:
enabled: true
cloudcontrol:
enabled: true
resourceexplorer2:
enabled: true
cloudfront:
enabled: true
allowed-private-origin-hosts: []
appsync:
enabled: true
schema-worker-threads: 4
schema-worker-shutdown-timeout-seconds: 30
vtl-max-loops: 10000
vtl-max-output-chars: 1048576
vtl-timeout-millis: 5000
s3vectors:
enabled: true
s3tables:
enabled: true
iot:
enabled: true
rule-sql-strict: false
mqtt:
enabled: true
auto-start: false
host: 127.0.0.1
port: 1883
tls-port: 8883
iotdata:
enabled: true
cloudhsmv2:
enabled: true
efs:
enabled: true
organizations:
enabled: true
rum:
enabled: true
networkfirewall:
enabled: true
servicecatalog:
enabled: true
guardduty:
enabled: true
emrserverless:
enabled: true
ssoadmin:
enabled: true
ssooidc:
enabled: true
local-principal-id: ${FLOCI_SERVICES_SSOOIDC_LOCAL_PRINCIPAL_ID:}
macie2:
enabled: true
account:
enabled: true
controlcatalog:
enabled: true
accessanalyzer:
enabled: true
identitystore:
enabled: true
scim-bearer-token: ${FLOCI_SERVICES_IDENTITYSTORE_SCIM_BEARER_TOKEN:floci-scim-token}
budgets:
enabled: true
inspector2:
enabled: true
securityhub:
enabled: true
detective:
enabled: true
controltower:
enabled: true
seed-landing-zone: true
route53resolver:
enabled: true
connect:
enabled: true
appintegrations:
enabled: true
dlm:
enabled: true
cognitoidentity:
enabled: true
globalaccelerator:
enabled: true
datasync:
enabled: true
aps:
enabled: true
lakeformation:
enabled: true
tagging:
enabled: true
configservice:
enabled: true
transcribe:
enabled: true
docdb:
enabled: true
mock: false
default-image: "mongo:7.0"
bedrock-agent-core:
enabled: true
bedrock-agent-core-control:
enabled: true
servicequotas:
enabled: true
verifiedpermissions:
enabled: true
ram:
enabled: true
codegurureviewer:
enabled: true
codeartifact:
enabled: true
marketplace:
enabled: true
dms:
enabled: true