Files
floci/src/main/resources/application.yml
T
TATSUNO “Taz” Yasuhiro ffe8a92635 perf(build): replace BouncyCastle with JDK crypto API as much as possible (#2988)
* perf(security): stop registering the BouncyCastle JCE provider

ACM signs through the JDK and builds PBES2 there, and KMS PSS
uses RSASSA-PSS with the parameters AWS specifies.
Downsize Docker image from 88.7 to 83.9 MB gzipped.

* test(compat): verify the native image's KMS and ACM crypto from outside Floci

Floci verifying its own signature proves nothing. Signatures now check against
GetPublicKey with an outside library, exported keys are decrypted, and issued
certificates verify their own signature.

* fix(kms): apply real PSS padding when signing a digest with RSASSA_PSS

* fix(acm): set the PBES2 salt and iteration count explicitly

* perf(kms): reuse the shared SecureRandom when signing a PSS digest

* fix(kms): let AwsException pass through the sign and verify catch blocks

* perf(native): drop the native-image config the BouncyCastle provider needed

Five --initialize-at-run-time entries and 21 reflect-config entries existed
for the BouncyCastle JCE provider. Nothing registers that provider any more,
so they only kept dead initialization code in the image.

The run-time initialization entries are what cost size. Removing them takes
the binary from 204.6 to 203.1 MB and gzip -9 from 79.5 to 78.9 MB. The
reflect-config entries measured as noise, because those classes stay
registered through another path, but they still describe a provider Floci
no longer installs.

Verified on a native build. The Python suite passes 354 tests, the Java SDK
suite passes 61 including CloudHSM v2 and ACM, and a TLS run generates its
self-signed certificate and signs with secp256k1 over HTTPS.
2026-09-03 21:49:52 -04:00

638 lines
24 KiB
YAML

quarkus:
jackson:
# Quarkus 3.37 stopped tolerating empty response beans; AWS StartApplication/
# StopApplication legitimately return {}, so keep the pre-3.37 behaviour.
fail-on-empty-beans: false
log:
console:
format: "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] %s%e%n"
category:
"io.apicurio":
level: WARN
http:
port: ${floci.port}
host: 0.0.0.0
limits:
max-body-size: ${floci.protocols.max-request-size}M
datasource:
active: false
shutdown:
# Enables the pre-shutdown phase so stop hooks run before the HTTP server stops.
# No 'delay' value is set - observers run synchronously, no artificial sleep is introduced.
delay-enabled: true
native:
resources:
# The Pricing service reads its bundled snapshot, EC2 reads its image
# catalog (ec2/image-catalog.yaml), IAM reads its AWS managed-policy
# catalog (iam/managed-policies.yaml), AppSync's GraphQL parser reads its
# message bundles, and API Gateway's Velocity engine reads its default
# properties at runtime via
# ClassLoader#getResourceAsStream. Quarkus's static resource analysis
# cannot detect these dynamically-built paths, so they are registered
# explicitly to ensure GraalVM includes every file in the native image.
includes:
- pricing-snapshots/**
- ui/*.html
- ec2/*.yaml
- iam/*.yaml
- i18n/*.properties
- org/apache/velocity/runtime/defaults/*.properties
# snappy-java registers 27 JNI libraries, one per platform. Only the one
# for the running platform loads, so 23 are dropped. Linux x86_64 and
# aarch64 cover the published images, Mac covers a local native build.
excludes:
- org/xerial/snappy/native/AIX/**
- org/xerial/snappy/native/FreeBSD/**
- org/xerial/snappy/native/SunOS/**
- org/xerial/snappy/native/Windows/**
- org/xerial/snappy/native/Linux/android-aarch64/**
- org/xerial/snappy/native/Linux/android-arm/**
- org/xerial/snappy/native/Linux/arm/**
- org/xerial/snappy/native/Linux/armv6/**
- org/xerial/snappy/native/Linux/armv7/**
- org/xerial/snappy/native/Linux/loongarch64/**
- org/xerial/snappy/native/Linux/ppc/**
- org/xerial/snappy/native/Linux/ppc64/**
- org/xerial/snappy/native/Linux/ppc64le/**
- org/xerial/snappy/native/Linux/riscv64/**
- org/xerial/snappy/native/Linux/s390x/**
- org/xerial/snappy/native/Linux/x86/**
- org/xerial/snappy/native/Linux/x86_64-musl/**
additional-build-args:
- --report-unsupported-elements-at-runtime
- --allow-incomplete-classpath
- --enable-url-protocols=http,https
- --initialize-at-run-time=io.vertx.ext.mail.impl.sasl.NTLMEngineImpl
- --initialize-at-run-time=com.github.dockerjava.transport.NamedPipeSocket$Kernel32
- --initialize-at-run-time=io.github.hectorvent.floci.services.acm.AcmService
- --initialize-at-run-time=io.github.hectorvent.floci.services.acm.CertificateGenerator
- --initialize-at-run-time=io.github.hectorvent.floci.config.TlsConfigSource
- --initialize-at-run-time=io.github.hectorvent.floci.services.cognito.CognitoSrpHelper
- --initialize-at-run-time=io.github.hectorvent.floci.services.ses.SesService
- --initialize-at-run-time=io.github.hectorvent.floci.services.route53.Route53Service
- --initialize-at-run-time=io.github.hectorvent.floci.services.kms.KmsService
- --initialize-at-run-time=io.github.hectorvent.floci.services.cloudfront.CloudFrontService
- --initialize-at-run-time=io.github.hectorvent.floci.services.emr.EmrService
- --initialize-at-run-time=io.github.hectorvent.floci.services.elasticbeanstalk.ElasticBeanstalkService
- --initialize-at-run-time=io.github.hectorvent.floci.services.elb.ElbClassicService
- --initialize-at-run-time=graphql.util.IdGenerator
- --initialize-at-run-time=io.github.hectorvent.floci.services.lambda.launcher.LambdaExecutionRoleCredentials
# snappy-java (Firehose Snappy/HADOOP_SNAPPY delivery) extracts and loads a
# bundled JNI library from the static initializers of these two classes.
- --initialize-at-run-time=org.xerial.snappy.Snappy
- --initialize-at-run-time=org.xerial.snappy.SnappyLoader
floci:
port: 4566
base-url: "http://localhost:4566"
# hostname: "" # When set, overrides the hostname in response URLs (e.g. SQS QueueUrl).
# Needed for multi-container Docker setups. Example: FLOCI_HOSTNAME=floci
default-region: us-east-1
default-account-id: "000000000000"
# Shared mock-response config for Textract/Comprehend/Rekognition/Translate. See AiMockConfigLoader.
ai-mock-config-file: ${AI_MOCK_CONFIG:}
storage:
# Supported modes: memory, persistent, hybrid, wal
mode: memory
persistent-path: ./data
host-persistent-path: ./data
prune-volumes-on-delete: false
# EFS access-point emulation for the shared local Docker volumes that stand in for EFS file
# systems. All opt-in; with the defaults below (and no owner/permission overrides) volumes are
# plain named volumes, so existing behaviour is unchanged. Emulates an access point's
# RootDirectory.CreationInfo (owner-uid/owner-gid/root-permissions) and PosixUser
# (mount-user/mount-group-add).
efs:
# owner-uid: # RootDirectory.CreationInfo.OwnerUid applied to the volume root (set with owner-gid)
# owner-gid: # RootDirectory.CreationInfo.OwnerGid applied to the volume root (set with owner-uid)
# root-permissions: # CreationInfo.Permissions, 3-4 octal digits; e.g. "0777", or "2775" for setgid
init-image: busybox:stable
# mount-user: # run mounting containers as "uid[:gid]" (access point PosixUser)
# mount-group-add: # supplementary gid added to mounting containers
wal:
compaction-interval-ms: 30000
services:
ssm:
flush-interval-ms: 5000
dynamodb:
flush-interval-ms: 5000
sns:
flush-interval-ms: 5000
lambda:
flush-interval-ms: 5000
cloudwatchlogs:
flush-interval-ms: 5000
cloudwatchmetrics:
flush-interval-ms: 5000
secretsmanager:
flush-interval-ms: 5000
acm:
flush-interval-ms: 5000
opensearch:
flush-interval-ms: 5000
batch:
flush-interval-ms: 5000
lightsail:
flush-interval-ms: 5000
codepipeline:
flush-interval-ms: 5000
s3vectors:
flush-interval-ms: 5000
s3tables:
flush-interval-ms: 5000
ecs:
flush-interval-ms: 5000
codebuild:
flush-interval-ms: 5000
config:
flush-interval-ms: 5000
transcribe:
flush-interval-ms: 5000
codedeploy:
flush-interval-ms: 5000
tagging:
flush-interval-ms: 5000
elasticbeanstalk:
flush-interval-ms: 5000
rds:
# Override storage mode for RDS (memory = no Docker volumes; hybrid/persistent = named volume per instance)
# mode: memory
ec2:
# Override storage mode for EC2 (defaults to the global storage mode). EC2 networking and
# instance metadata persist so CloudFormation-created VPC/subnet ids survive a restart (#1297).
# mode: memory
appsync:
flush-interval-ms: 5000
rum:
flush-interval-ms: 5000
resourceexplorer2:
mode: hybrid
flush-interval-ms: 5000
fis:
flush-interval-ms: 5000
guardduty:
flush-interval-ms: 5000
emrserverless:
flush-interval-ms: 5000
lakeformation:
flush-interval-ms: 5000
dns:
# Extra hostname suffixes resolved to Floci's container IP by the embedded DNS server.
# Useful when migrating from LocalStack — add localhost.localstack.cloud to avoid
# changing Lambda endpoint environment variables.
# Via env var (comma-separated): FLOCI_DNS_EXTRA_SUFFIXES=localhost.localstack.cloud,other.internal
# extra-suffixes:
# - localhost.localstack.cloud
# Public resolvers appended after Floci's embedded DNS on spawned containers' HostConfig.Dns,
# and used as the fallback upstream for Floci's own DNS forwarder. Lets Lambda/CodeBuild
# resolve public hostnames even if the embedded forwarder cannot answer.
# Disable in offline/locked-down networks where these resolvers are blocked.
container-fallback-enabled: true # FLOCI_DNS_CONTAINER_FALLBACK_ENABLED
container-fallback-servers: # FLOCI_DNS_CONTAINER_FALLBACK_SERVERS=1.1.1.1,1.0.0.1
- 8.8.8.8
- 8.8.4.4
auth:
validate-signatures: false
presign-secret: local-emulator-secret
security:
# Comma-separated browser origins allowed by the global CORS filter.
# Env var: EXTRA_CORS_ALLOWED_ORIGINS=http://localhost:3000
# extra-cors-allowed-origins:
# Extra request/response CORS header names for browser clients.
# extra-cors-allowed-headers:
# extra-cors-expose-headers:
disable-cors-headers: false
# Grant Private Network Access preflights (Access-Control-Allow-Private-Network)
# so a page on a public/secure origin can reach this loopback backend.
cors-allow-private-network: false
tls:
enabled: false # FLOCI_TLS_ENABLED (default: false)
# cert-path: "" # FLOCI_TLS_CERT_PATH (PEM certificate file)
# key-path: "" # FLOCI_TLS_KEY_PATH (PEM private key file)
self-signed: true # FLOCI_TLS_SELF_SIGNED — auto-generate a self-signed cert if no cert-path provided
aws-https-port: 443 # FLOCI_TLS_AWS_HTTPS_PORT — also bind 443 so CDK cfn-response/AWS-on-443 callbacks reach Floci (0 disables)
protocols:
max-request-size: 2048 # FLOCI_PROTOCOLS_MAX_REQUEST_SIZE: max HTTP request body size in MB (legacy: floci.max-request-size / FLOCI_MAX_REQUEST_SIZE)
strict-claiming: false # FLOCI_PROTOCOLS_STRICT_CLAIMING — reject RPC-signaled requests that no supported wire protocol claims
reject-unknown-service-scope: true # FLOCI_PROTOCOLS_REJECT_UNKNOWN_SERVICE_SCOPE — reject REST requests signed for a service Floci does not implement
docker:
log-max-size: "10m"
log-max-file: "3"
docker-host: unix:///var/run/docker.sock
resource-namespace: "" # FLOCI_DOCKER_RESOURCE_NAMESPACE; scopes child container/volume names
docker-config-path: ""
# extra-labels: # Extra Docker labels applied to every Floci-created container and volume
# - key: "com.example.project" # (FLOCI_DOCKER_EXTRA_LABELS_0__KEY / _0__VALUE; increment the index for more;
# value: my-project # reserved keys floci, floci_emulator, floci_namespace are ignored)
# - key: environment
# value: dev
services:
ssm:
enabled: true
max-parameter-history: 5
sqs:
enabled: true
default-visibility-timeout: 30
max-message-size: 1048576
clear-fifo-deduplication-cache-on-purge: false
s3:
enabled: true
enforce-auth: false
default-presign-expiry-seconds: 3600
global-bucket-namespace: false
dynamodb:
enabled: true
sns:
enabled: true
lambda:
enabled: true
ephemeral: false
ecr-base-uri: public.ecr.aws # FLOCI_SERVICES_LAMBDA_ECR_BASE_URI — registry for Lambda runtime images (legacy: floci.ecr-base-uri / FLOCI_ECR_BASE_URI)
default-memory-mb: 128
default-timeout-seconds: 3
# 500 ports, not the former 100 (9200-9299): one port is held per running Lambda
# container, so this is the concurrent-execution ceiling, and a multi-account LZA needs
# ~112 at once. See EmulatorConfig.runtimeApiBasePort for why 12000 and not a wider 9200.
# Keep in step with the @WithDefault there — a value set here WINS over the annotation,
# so changing only the default silently does nothing (the issue #2225 trap).
runtime-api-base-port: 12000
runtime-api-max-port: 12499
code-path: ./data/lambda-code
poll-interval-ms: 1000
container-idle-timeout-seconds: 300
region-concurrency-limit: 1000
unreserved-concurrency-min: 100
# aws-config-path: # Host path to bind-mount (read-only) at /opt/aws-config for real credential discovery
# extra-hosts: # Extra /etc/hosts entries for Lambda containers, "hostname:ip" ("host-gateway" allowed as ip)
# container-name-prefix: floci # FLOCI_SERVICES_LAMBDA_CONTAINER_NAME_PREFIX — base name prefix for spawned containers and code volumes ([A-Za-z0-9][A-Za-z0-9_.-]*; invalid values fall back to "floci")
# code-volume-populate-concurrency: # FLOCI_SERVICES_LAMBDA_CODE_VOLUME_POPULATE_CONCURRENCY — max concurrent first-time code-volume populates (default max(2, cpus/2), which a CPU-constrained container collapses to 2)
executor: docker # docker | kubernetes (run Lambda environments as pods)
# kubernetes:
# namespace: default # Namespace Lambda pods are created in
# labels: # Extra pod labels, key=value entries
# - team=platform
# floci-address: # Host/IP pods use to reach Floci; auto-detected in-cluster
# init-image: busybox:1.36 # Init container image (needs sh, wget, unzip)
hot-reload:
enabled: false
apigateway:
enabled: true
apigatewayv2:
enabled: true
iam:
enabled: true
enforcement-enabled: false
seed-deployer-principal: false
# account-alias: "" # When set, seeds the account alias at startup so callers can read one
# without creating it first. Unset means the account has no alias,
# matching AWS. Example: FLOCI_SERVICES_IAM_ACCOUNT_ALIAS=my-account
msk:
enabled: true
mock: false
default-image: "redpandadata/redpanda:latest"
kafka-host-port-base: 9300
kafka-host-port-max: 9399
amazonmq:
enabled: true
mock: false
default-image: "rabbitmq:3-management"
kinesis-analytics:
enabled: true
mock: false
# default-image: optional override; uncomment to pin every application to a single image
# (e.g. a private registry mirror). When unset, the image is chosen from the requested
# RuntimeEnvironment (KinesisAnalyticsRuntimes.imageFor, e.g. FLINK-1_19 -> apache/flink:1.19).
# default-image: "apache/flink:1.18"
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
proxy-base-port: 7100
proxy-max-port: 7199
# endpoint-host: localhost # Hostname clients use; empty -> DockerHostResolver
rds:
enabled: true
mock: false # FLOCI_SERVICES_RDS_MOCK — true = metadata only, no Docker (useful for CI)
proxy-base-port: 7001
proxy-max-port: 7099
# endpoint-host: localhost # Hostname clients use; enables published-port translation in Docker
# Omit image overrides to adapt Floci's built-in images to EngineVersion.
# Uncomment an override to pin that engine to an exact image.
# default-postgres-image: "registry.example.com/postgres:16-alpine"
# default-mysql-image: "registry.example.com/mysql:8.0"
# default-mariadb-image: "registry.example.com/mariadb:11"
rds-data:
enabled: true
transaction-ttl-seconds: 180
neptune:
enabled: true
proxy-base-port: 8182
proxy-max-port: 8282
db-type: "gremlin"
default-image: "tinkerpop/gremlin-server:3.7.3"
default-neo4j-image: "neo4j:5-community"
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
firehose:
enabled: true
tick-interval-seconds: 10
flush-record-count: 0
kms:
enabled: true
cognito:
enabled: true
stepfunctions:
enabled: true
allow-plaintext-http: false
mock-config-file: ${SFN_MOCK_CONFIG:}
swf:
enabled: true
timeout-sweep-enabled: true
timeout-sweep-interval-seconds: 1
cloudformation:
enabled: true
# 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
# Stub a resource whose type has no provisioner: synthetic physical id, arn:aws:stub:::
# ARN attribute, CREATE_COMPLETE, reported at warn with a resource status reason. Set
# false to fail such a resource instead, which rolls the stack back.
allow-stub-unsupported-resource-types: true
acm:
enabled: true
validation-wait-seconds: 0
athena:
enabled: true
mock: false
duck:
# url: http://floci-duck:3000 # set to skip container management
default-image: "floci/floci-duck:latest"
glue:
enabled: true
ses:
enabled: true
# smtp-host: mailpit # SMTP server for email relay (empty = store only)
# smtp-port: 1025
# smtp-user: ""
# smtp-pass: ""
# smtp-starttls: DISABLED # DISABLED, OPTIONAL, or REQUIRED
opensearch:
enabled: true
mock: false
# default-image: optional override; uncomment to lock every domain to a
# single image (e.g. private registry mirror). When unset, the image is
# picked from OpenSearchVersions.imageFor(EngineVersion).
# default-image: "registry.example.com/opensearch:2.19.5"
proxy-base-port: 9400
proxy-max-port: 9499
keep-running-on-shutdown: false
ec2:
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
mock: false
aws-faithful-private-ip: false
# container-ips-routable: true # Auto-detected by default (a throwaway TCP probe toward
# the container network). Set explicitly when the probe
# can't speak for your clients, e.g. Floci itself running
# containerized. FLOCI_SERVICES_EC2_CONTAINER_IPS_ROUTABLE
ecs:
enabled: true
mock: false
appconfig:
enabled: true
appconfigdata:
enabled: true
ecr:
enabled: true
registry-image: "registry:2"
registry-container-name: floci-ecr-registry
registry-base-port: 5100
registry-max-port: 5199
data-path: ./data/ecr
tls-enabled: false
keep-running-on-shutdown: true
uri-style: hostname
ui:
enabled: true
image: "floci/floci-ui:latest"
container-name: floci-ui
port: 4500
keep-running-on-shutdown: false
# endpoint: unset by default — Floci derives the sidecar's callback address automatically.
# Set an absolute http:// or https:// URL here only to override that derivation.
insecure-skip-tls-verify: false
bedrock-runtime:
enabled: true
backend: stub
proxy:
passthrough: false
# url: http://localhost:11434/v1
# api-key: sk-...
# default-model: llama3
# model-mapping: "anthropic.claude-3-sonnet-20240229-v1:0=claude-3-sonnet"
eks:
enabled: true
mock: false
provider: k3s
default-image: "rancher/k3s:latest"
api-server-base-port: 6500
api-server-max-port: 6599
data-path: ./data/eks
keep-running-on-shutdown: false
endpoint-mode: host # host = https://localhost:<hostPort> (host-reachable); network = container DNS name
iam-auth-webhook: true # validate `aws eks get-token` SigV4 tokens through a k3s webhook
ecr-registry-mirror: true # inject a registries.yaml so pods can pull images pushed to Floci ECR
disable-cni: false # start k3s without its bundled flannel/kube-proxy so a real CNI (e.g. Cilium) can take over
mwaa:
enabled: true
mock: false
default-postgres-image: "postgres:16-alpine"
supported-versions: "2.10.5,2.9.3,2.8.4"
default-version: "2.10.5"
proxy-base-port: 8700
proxy-max-port: 8799
data-path: ./data/mwaa
keep-running-on-shutdown: false
dag-sync-interval-seconds: 30
install-requirements: true
elb:
enabled: true
mock: false
elbv2:
enabled: true
mock: false
codebuild:
enabled: true
# docker-network: floci-network
batch:
enabled: true
runner-mode: immediate
# docker-network: floci-network
codedeploy:
enabled: true
codepipeline:
enabled: true
autoscaling:
enabled: true
applicationautoscaling:
enabled: true
elasticbeanstalk:
enabled: true
backup:
enabled: true
job-completion-delay-seconds: 3
fis:
enabled: true
route53:
enabled: true
transfer:
enabled: true
textract:
enabled: true
comprehend:
enabled: true
rekognition:
enabled: true
translate:
enabled: true
pricing:
enabled: true
transcribe:
enabled: true
ce:
enabled: true
credit-usd-monthly: 0.0
cur:
enabled: true
emit-mode: synchronous
staging-bucket: floci-cur-staging
bcm-data-exports:
enabled: true
emit-mode: synchronous
cloudtrail:
enabled: true
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
s3vectors:
enabled: true
s3tables:
enabled: true
iot:
enabled: true
mqtt:
enabled: true
auto-start: false
host: 0.0.0.0
port: 1883
iotdata:
enabled: true
cloudhsmv2:
enabled: true
efs:
enabled: true
organizations:
enabled: true
# management-account-email: "" # When set, overrides the management-account email reported by DescribeOrganization and account listings.
rum:
enabled: true
networkfirewall:
enabled: true
servicecatalog:
enabled: true
guardduty:
enabled: true
emrserverless:
enabled: true
ssoadmin:
enabled: true
controltower:
enabled: true
route53resolver:
enabled: true
connect:
enabled: true
aps:
enabled: true
lakeformation:
enabled: true
tagging:
enabled: true
pipes:
enabled: true
configservice:
enabled: true
docdb:
enabled: true
mock: false
default-image: "mongo:7.0"
bedrock-agent-core:
enabled: true
# invoke-response: '{"output":"yes"}' # Body returned by InvokeAgentRuntime
# validate-runtime-exists: false # true = reject unknown runtime ARNs
bedrock-agent-core-control:
enabled: true
servicequotas:
enabled: true
ram:
enabled: true
codegurureviewer:
enabled: true