Security¶
fdyno checks SigV4 on every API request against configured static credentials. It is single-tenant, without IAM, accounts, session tokens or resource policies.
Development without credentials has no authentication
A development process without DYNODB_CREDENTIALS_FILE or
DYNODB_CREDENTIALS accepts any access key and does not check the
signature, as DynamoDB Local does. Anyone who can reach its port can read
and change all data. It logs no authentication at every start. Configure
credentials to require SigV4. The production profile always requires
configured credentials and checks every signature.
What fdyno checks and what you provide¶
| fdyno provides | You provide |
|---|---|
| SigV4 verification against static keys | Identity management beyond static keys |
| Per-key table, read-only and control-plane policies; per-key rate limits | Tenant isolation; separate FoundationDB databases for separate trust domains |
| In-process TLS with reload and mutual TLS | Certificate issuance and renewal, or a TLS proxy |
Credential reload on SIGHUP |
Secret distribution and rotation across processes |
| A production profile that refuses unsafe settings | A private network for fdyno, FoundationDB and the operations listener |
| FoundationDB TLS, encryption at rest and access control |
Direct FoundationDB access permits reading and changing all data. Protect its network as you protect the data.
Network exposure¶
- Bind data to a private address. Use a TLS proxy or in-process TLS.
- Keep
DYNODB_OPS_ADDRprivate: probes, metrics and/fdb/key-locationsare unauthenticated. Metrics expose table names/access-key IDs; key locations expose item keys. - Keep pprof off or on loopback.
- Enforce browser origin rules at a proxy. Requests with
OrigingetAccess-Control-Allow-Origin: *; SigV4 is still required.
Credentials¶
Prefer DYNODB_CREDENTIALS_FILE: no environment secrets, reload without
restart. Require process-user ownership and mode 0600 or 0400.
Generate secrets with openssl rand -base64 32. See the credential file checks and production credential requirements.
The file is one JSON document. A key without policy fields has full access:
{
"credentials": [
{ "access_key": "KEYA", "secret": "<secret of at least 32 bytes>" },
{ "access_key": "KEYB", "secret": "<secret of at least 32 bytes>" }
]
}
The file has no other format. A file of key:secret lines is refused,
with an error that says so. An optional first line
#!fdyno-credentials-json is skipped.
DYNODB_CREDENTIALS accepts comma-separated key:secret pairs once at startup.
| Check | Development | Production profile |
|---|---|---|
| File path absolute, a regular file, at most 1 MiB, at least one key; no malformed or duplicate entry | Refuses the file | Refuses the file |
| File mode without group, other or execute bits; owner is the effective user, where the platform reports it | Logs a warning | Refuses the file |
| A built-in key or secret; a secret under 32 bytes | Accepted | Refuses the set |
A malformed pair (no :, empty key or secret) in DYNODB_ |
Skips the pair | Refuses the set |
A duplicate key in DYNODB_ |
The later pair wins | Refuses the set |
A control character in a key or secret in DYNODB_ |
Accepted | Refuses the set |
A DYNODB_ entry that starts with {, [ or " (JSON) |
Refuses to start | Refuses the set |
DYNODB_ set, but no valid pair parsed |
Refuses to start | Refuses to start |
| No credentials configured | No authentication: accepts any access key and any signature | Refuses to start |
A development process without configured credentials has no authentication. Never expose it.
Rotate a key¶
SIGHUP swaps the file's whole key set. Invalid files retain the previous
set and log an error. Signal every process; reload is not coordinated.
A request uses the policy from the same credential snapshot that verified
its signature. Tightening or removing a key does not cancel requests
already authenticated against the old snapshot. Check new requests on every
process before treating a removed key as retired across the fleet.
With neither a credentials file nor in-process TLS, SIGHUP stops the process.
Follow credential rotation and see the
credential snapshot test.
Scoped JSON credentials¶
Add policy fields to an entry to limit that key:
{
"credentials": [
{
"access_key": "ORDERS_READER",
"secret": "<generated secret of at least 32 bytes>",
"tables": ["orders_*"],
"readonly": true,
"control_plane": "deny",
"rate": { "requests_per_second": 100, "burst": 200, "bytes_per_second": 1048576 }
}
]
}
| Field | Meaning |
|---|---|
access_, secret |
Required. Access keys are unique and have no spaces. |
tables |
Table names, or prefixes that end in one *. Omitted or ["*"] allows every table; [] allows none. |
readonly |
true denies every write, control-plane writes too. Default false. |
control_ |
"allow" (default) or "deny". Deny blocks table management and listing calls. Data-plane calls stay allowed, subject to tables and readonly. |
rate |
Optional rate limits. |
Denials return HTTP 400 AccessDeniedException. Lists hide inaccessible
tables. One invalid field rejects the whole file.
How a request is scoped¶
For a scoped key, the service checks the whole request before its handler
runs. For example, a BatchWriteItem that names both an allowed and a denied
table is denied before it writes either table. The same check walks every
transaction member and every PartiQL statement; a restore must be permitted
for both its source and target. A valid signature is not permission to run
an action or to access every table in a request.
Allowed list operations filter out inaccessible tables before they build a
page or cursor. Issuing a stream iterator does not grant independent access:
GetRecords checks the authenticated key's policy against the stream named
in the cursor. See the
authorization and pagination tests
and the iterator check.
Per-credential rate limits¶
See the rate and burst bounds.
| Field | Rule |
|---|---|
requests_ |
Request rate, up to 1,000,000. |
burst |
Bucket size, 1 to 1,000,000. Default: the request rate, at least 1. |
bytes_ |
Request plus response bytes, up to 2^40. |
Over-limit requests return retryable HTTP 400
ProvisionedThroughputExceededException and do nothing; SDKs retry them.
Limits are per process: N processes accept up to N times the rate.
Large responses finish; later requests wait for budget.
How the buckets charge a request¶
Each limited key has two token buckets in each process: one for requests and one for bytes. A field that is absent leaves its bucket out. Both buckets start full.
| Order | Check or charge | Outcome |
|---|---|---|
| 1 | SigV4, the in-flight limit, then authorization | Refused: charges nothing |
| 2 | The request bucket holds at least 1 token and the byte bucket is above 0 | Either configured bucket short: 400 Provisioned; charges nothing |
| 3 | Take 1 request token and the request body bytes, then run the handler | |
| 4 | After the response is built, take the response body bytes; the bucket may go below 0 | Never refuses or changes the response |
| Bucket | Size | Refill | Accepts when | Charge |
|---|---|---|---|---|
| Requests | burst |
requests_ |
At least one token | 1 per accepted request |
| Bytes | One second of bytes_ |
bytes_ |
Above zero | The request body as received, at admission; the response body after the handler |
The byte bucket accepts a request of any size while it holds any tokens, and
the response charge never refuses or changes the response. Either charge can
take the bucket below zero. That debt refuses every request of the key on
this process until the refill repays it. As an example input, a key with
bytes_per_second: 1048576 that reads a 16 MiB response owes about 15
seconds of refill after it.
These requests charge nothing:
- a request that fails authentication;
- a request that fails the body read: a body over 16 MiB, a read error or a spent request-body budget;
- a request refused by the in-flight request limit (
400ThrottlingException); - a request that fails the
X-Amz-Targetcheck or authorization; - a request refused by these buckets.
A request the buckets accept is charged even when
its handler then fails or is throttled for another reason (FoundationDB
pressure, contention). So client retries during FoundationDB pressure drain
the key's buckets, and the key can then get
ProvisionedThroughputExceededException. The check runs before the
handler, so a request refused by these buckets does no FoundationDB work.
A key can be restricted by tables (other than omitted or a list that
contains "*"), readonly or control_plane: "deny". For such a key,
authorization has already decoded the body. For an unrestricted key, the
body is not decoded. The request charge
counts the body as received, so a compressed body counts its compressed size.
The response charge counts the body before response compression. See
credential_rate.go,
auth.go
and service.go.
A credential reload keeps a key's buckets, with their tokens and debt, when
its rate is unchanged. A new key, or a key whose rate changed, starts with
full buckets. The throttle response carries the ThrottlingReasons reason
MaxOnDemandThroughputExceeded and counts in
fdyno_requests_throttled_total{reason="credential"}. The JSON
credential_throttles_top view splits each key's refusals into
throttled_requests_total (request bucket empty) and throttled_bytes_total
(byte bucket at or below zero). Use it to tell which field to raise.
TLS¶
Set DYNODB_TLS_CERT_FILE and DYNODB_TLS_KEY_FILE to serve the data
listener over TLS. The operations listener defaults to plaintext on loopback;
DYNODB_OPS_TLS=1 uses the same certificate. See the TLS configuration and reload code.
| Control | Rule |
|---|---|
| Protocol | TLS 1.2/1.3, HTTP/1.1. HTTP/2-only clients fail the handshake. |
| Mutual TLS | DYNODB_ requires every client's certificate from that CA. SigV4 remains required. |
| Rotation | Runbook; file checks every 5 seconds; SIGHUP reloads without waiting for those checks. |
| Failed reload | Keeps previous certificate; increments fdyno_. Alert on it and fdyno_ below renewal margin. |
| Test certificates | scripts/ generates a test CA/certificates. Never use them in production. |
How a request is authenticated¶
The checks run in this order. The first failure answers the request, with one exception. After a failed head check (steps 1 to 6), fdyno still drains the body. Then a body over 16 MiB, a body read timeout or another body read error answers 413, 408 or 400 instead.
Request head: no secret, no body
| Step | Check | Outcome |
|---|---|---|
| 1 | Authorization header present |
Missing: Missing |
| 2 | Credential, Signature, SignedHeaders present; X-Amz-Date, or Date if X-Amz-Date is absent |
Missing: Incomplete |
| 2 | Authorization well formed; date parses | Malformed or unparseable: Invalid |
| 3 | Request time within 15 min of the server clock | Outside: Invalid |
| 4 | Scope date = request date; scope service dynamodb |
Mismatch: Invalid |
| 5 | host is a signed header |
Not signed: Invalid |
| 6 | Access key in the current credential snapshot; development without credentials accepts any key | Unknown key: Unrecognized |
Body
| Step | Check | Outcome |
|---|---|---|
| 7 | Read the body: 16 MiB cap, request-body budget | Over the cap: 413; budget spent: 400 Throttling |
| 8 | X-Amz-Content-Sha256, if sent, = SHA-256(body) |
Mismatch: Invalid |
| 9 | Signature, constant-time compare; skipped in development without credentials | Mismatch: Unrecognized |
After authentication
| Step | Check | Outcome |
|---|---|---|
| 10 | In-flight request limit (DYNODB_) |
Limit reached: 400 Throttling |
| 11 | X-Amz-Target has the Dynamo or Dynamo prefix |
Other prefix: Unknown |
| 12 | Scope check, then per-key rate limit | Denied: Access; over the rate: Provisioned |
| 13 | Handler |
- Steps 1 to 6 need no secret and no body. A request that fails them holds no body buffer and no body budget. It holds no place under the in-flight request limit. fdyno reads its body to the end and discards it as it arrives, so a body over the 16 MiB limit still gets 413.
- The body is read before the signature is checked.
Content-Lengthis an unverified claim. The first buffer is at most 64 KiB and grows only as bytes arrive; each growth is charged to the request-body budget. A client that declares 16 MiB and sends nothing holds 64 KiB until the fixed 60 s read timeout. A 413 or a spent budget closes the connection. - Admission comes after authentication. A client that cannot sign, or
sends its body slowly, does not use up the in-flight request limit. Signed
requests need that limit.
See process overload and
DYNODB_MAX_INFLIGHTin configuration. - Payload hash. Without
X-Amz-Content-Sha256, or with an empty value, fdyno hashes the body itself. A nonempty value must be the 64-character hex SHA-256 of the body; any other value,UNSIGNED-PAYLOADincluded, fails. - Signature compare. The hex signature is compared in constant time, ignoring case.
- Signing-key cache. fdyno keeps one derived signing key per access key, keyed on its secret, date, Region and service. It stores a key only after that key verified a signature, so requests without the secret cannot churn the cache.
- One snapshot. The secret, scope policy and rate limiter of a request come from one credential snapshot; see rotate a key.
Authentication errors¶
Authentication errors return HTTP 400, as in DynamoDB. See the signature and clock-skew checks.
| Request | Error |
|---|---|
No Authorization header |
Missing |
| A missing signature part or date | Incomplete |
| Request time more than 15 minutes from the server clock | Invalid |
Wrong credential scope date or service, or host not signed |
Invalid |
| Unknown access key | Unrecognized |
| Wrong signature | Unrecognized (DynamoDB returns Invalid) |
When a clock is off¶
Step 3 compares the request time with the fdyno process's wall clock at the
moment the request started. The request time is X-Amz-Date, or Date when
X-Amz-Date is absent. Both headers take the same ISO 8601 forms, as in
DynamoDB: 20261019T121500Z or 2026-10-19T12:15:00Z, with an optional
. fraction and a zone of Z, +hhmm or +hh:mm (none means UTC). An HTTP
date such as Mon, 19 Oct 2026 12:15:00 GMT fails with
IncompleteSignatureException "Date must be in ISO-8601 'basic format'. Got
'InvalidSignatureException; exactly 15 minutes passes.
The message gives the server's clock, so the client can measure the
difference:
| Request time | Message |
|---|---|
| More than 15 minutes behind the server | Signature expired: <request time> is now earlier than <server time - 15 min> (<server time> - 15 min. |
| More than 15 minutes ahead of the server | Signature not yet current: <request time> is still later than <server time + 15 min> (<server time> + 15 min. |
Times are in the X-Amz-Date format, such as 20261019T121500Z. Each fdyno
process uses its own clock. With clocks that differ, a request near the
limit can pass on one process and fail on another. The 15 minutes are fixed;
no setting changes them. For the one-minute bound between fdyno processes,
see clock synchronization.
Not guaranteed¶
fdyno does not check the credential-scope Region and ignores
X-Amz-Security-Token. Static keys do not provide tenant isolation;
use separate FoundationDB databases for separate trust domains.
Operations endpoints have no authentication, including with TLS.
Fuzzing campaigns are finite and do not prove memory safety.
There has been no external audit or penetration test.
Report a vulnerability¶
Use GitHub private vulnerability reporting,
Security → Report a vulnerability. Do not open a public issue.
The security policy
defines scope and disclosure. Only main receives fixes.
How we know: security checks.