Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration reference

Sindri reads one file, sindri.yaml. sindri serve --config <file> names it; with no flag, serve reads ./sindri.yaml if it exists and runs on the defaults below if it does not. A file you name that is missing is an error. An empty file means “everything default”.

Check a file without a database or a server:

sindri config check -f sindri.yaml
sindri config show --expanded -f sindri.yaml

config show prints the server sections with every secret replaced by <redacted>. --expanded also prints the repositories, lifecycle, and defaults as the long-form documents the server acts on, with every preset, inference, and default written out.

The server settings tables are generated from the structs in internal/config by make reference, and a test fails when the page and the code disagree. The tables for repositories, lifecycle, defaults, and manifests are written by hand, and a test checks that they list exactly the keys the loader accepts. Where the code sets a default, the page states it; where it does not, the key is unset.

Rules that apply everywhere

  • Unknown keys are an error. A typo fails at load instead of silently keeping a default.
  • Environment references. Any string value may contain ${VAR} or ${VAR:-default}. $$ writes a literal dollar sign. Expansion happens on parsed values, so a password containing : or # cannot change the meaning of the file. An unset variable with no default is an error.
  • Durations are Go duration strings with a unit: 30s, 5m, 1h, 168h. A bare number such as 3600 is rejected, because guessing a unit is how a five minute cache becomes a one hour one. Negative durations are rejected.
  • Short and long forms. Most sections accept a one-line short form and a mapping long form. They produce the same configuration; nothing downstream can tell which was written. The tables below give both.
  • Secrets stay out of the database. The database holds the name of a credential, not its value.

Server settings

These keys configure the process. They have no manifest form: manifests describe repositories and lifecycle, so listen, storage, database, log, auth, worker, scanning, notifications, ui, credentials, and publicUrl appear in sindri.yaml only.

listen

The HTTP listener.

Short form: listen: :8080 is the same as listen: {address: ":8080"}.

KeyTypeMeaningDefault
addressstringAddress the HTTP server binds. Must not be empty.:8080
readHeaderTimeoutdurationHow long a client may take to send request headers.10s
shutdownTimeoutdurationHow long shutdown waits for requests in flight.20s

storage

Where blobs are written.

Short form: storage: ./data is the same as storage: {backend: filesystem, path: ./data}.

Short form: storage: s3://bucket/prefix is the same as storage: {backend: s3, bucket: bucket, prefix: prefix}.

KeyTypeMeaningDefault
backendstringfilesystem or s3.filesystem
pathstringDirectory for blobs. Filesystem only, and required there. A relative path is resolved against the configuration file’s directory../data
bucketstringBucket name. S3 only, and required there.unset
prefixstringKey prefix inside the bucket. S3 only.unset
regionstringS3 region. Compatible stores ignore it, but the SDK needs one.us-east-1 on S3
endpointstringURL of an S3-compatible store such as MinIO. S3 only. Credentials written into the URL are redacted by config show.unset, which is AWS
pathStylebooleanUse path-style addressing, which most S3-compatible stores need. S3 only.false
accessKeyIdstringStatic access key. Set it together with secretAccessKey, or leave both out to use the ambient AWS credential chain.unset
secretAccessKeystringStatic secret key. Redacted by config show.unset
sessionTokenstringSession token for temporary credentials. Redacted by config show.unset

Setting an S3-only key on the filesystem backend, or path on S3, is an error.

database

Postgres is the only supported store.

Short form: database: postgres://sindri.example.com/sindri is the same as database: {url: "postgres://sindri.example.com/sindri"}.

KeyTypeMeaningDefault
urlstringConnection URL. The scheme must be postgres or postgresql. The password is redacted in logs and by config show. The default is the development stack’s, with a development-only credential: never deploy it.postgres://sindri:sindri@127.0.0.1:55432/sindri?sslmode=disable
maxConnsintegerPool size. At least 1.10
minConnsintegerConnections kept open. Between 0 and maxConns.0
connectTimeoutdurationHow long to wait for a connection.10s

log

The structured logger.

Short form: log: debug is the same as log: {level: debug}.

KeyTypeMeaningDefault
levelstringdebug, info, warn, or error.info
formatstringjson or text.json

auth

Every request authenticates; there is no anonymous access. See ADR 18. Without oidc, only the bootstrap token and machine tokens authenticate, and the web UI cannot sign anyone in. Note that static_token is spelled with an underscore, unlike the camelCase keys around it.

Short form: auth: ${SINDRI_TOKEN} is the same as auth: {static_token: "${SINDRI_TOKEN}"}.

KeyTypeMeaningDefault
static_tokenstringThe bootstrap administrator credential: what sindri apply uses before an identity provider is configured, and the break-glass path after. Compared in constant time, never logged, and redacted by config show. The default logs a warning while it is in use.sindri-dev-token
adminslist of stringsIdentity-provider groups whose members administer the server. Entries must not be empty. Membership is read from the caller’s token on each request and never stored.unset
oidc.issuerstringThe provider’s issuer URL. Required. Must be https, or http for a loopback address.unset
oidc.clientIdstringOAuth client id. Required.unset
oidc.clientSecretstringOAuth client secret. Redacted by config show.unset
oidc.redirectUrlstringThe browser login callback, for example https://sindri.example.com/auth/callback. Setting it enables UI sign-in. Same scheme rule as issuer. The session cookie is Secure exactly when this is https.unset
oidc.groupsClaimstringToken claim listing the caller’s groups.groups
oidc.usernameClaimstringToken claim recorded as the actor in the audit ledger.email
oidc.scopeslist of stringsScopes the browser login requests. Providers that release groups only on request, such as Dex, need groups added.openid, profile, email

publicUrl

npm packuments carry absolute tarball URLs, and a request’s Host header is not trusted to build them (see ADR 24), so a server with an npm repository needs to know its own origin. Sindri serves at the root of that origin. Loading fails when an npm repository is declared, in the short or the long form, and publicUrl is unset.

KeyTypeMeaningDefault
publicUrlstringThe origin clients reach this server at, for example https://sindri.example.com. Required when the file declares any npm repository. Must be https, or http for a loopback address, and an origin only: no credentials, path, query, or fragment. A trailing slash is removed.unset

credentials

Upstream secrets, which proxy repositories name by key. A map from a reference name to a login. Reference names are lowercase letters, digits, -, and _, at most 63 characters, and may not start with - or _. Values are normally written as ${VAR}.

credentials:
  dockerhub-login:
    username: ${DOCKERHUB_USER}
    password: ${DOCKERHUB_TOKEN}
KeyTypeMeaningDefault
<name>.usernamestringUpstream user name. Redacted by config show.unset
<name>.passwordstringUpstream password, sent as HTTP Basic with username. Set it, or token, never both. Redacted by config show.unset
<name>.tokenstringUpstream token, sent as HTTP Bearer. Set it instead of username and password. An OCI proxy cannot use one. Redacted by config show.unset

A repository refers to a credential with upstream.credentials: <name>. Naming a reference that is not defined here is refused when the repository is written. Reloading the file with SIGHUP swaps the secrets atomically.

A proxy that has credentials fails a virtual repository’s walk when its upstream refuses them, instead of reading the refusal as “no such name”. See ADR 14.

A credential is either username and password (sent as HTTP Basic) or token (sent as HTTP Bearer), never both. A private npm registry that wants a token takes the second form. Both are sent only to the upstream’s own origin, with one exception (ADR 14): an OCI proxy’s username and password also go to the registry’s token realm, but only over https or on the upstream’s own origin. An OCI proxy cannot use a token, because OCI registries exchange username and password at their token realm; naming one is refused when the repository is written. See ADR 27.

credentials:
  npm-private:
    token: ${NPM_TOKEN}

worker

The background worker evicts stale proxy cache entries and abandoned uploads, and runs scheduled garbage collection. See ADR 20.

Short form: worker: false is the same as worker: {enabled: false}.

Short form: worker: true is the same as worker: {enabled: true}.

KeyTypeMeaningDefault
enabledbooleanRun a worker inside serve. With it off, the server still enqueues work, such as sindri gc, for a worker elsewhere to claim. An absent enabled in the mapping means true.true
gc.intervaldurationHow often to schedule garbage collection. Unset never schedules it: “untagged and unpromoted is garbage” is a policy to adopt after a dry run, not one to inherit by upgrading. sindri gc works either way.unset
gc.gracedurationBlobs seen more recently than this are kept, whatever references them.24h
retention.intervaldurationHow often the cleanup jobs run.1h
retention.uploadMaxIdledurationHow long a staged upload may go unwritten before it is discarded. At least 1m.24h
retention.proxyStaleAfterdurationHow long past its TTL a proxy cache entry is kept to serve through an upstream outage, before retention evicts it. Also how long a cached file that upstream no longer lists is kept before its row is removed.168h

scanning

Vulnerability scanning is off by default. When it is on, the worker scans hosted publishes only; proxied content is never scanned. It needs a trivy executable, which the -trivy release image ships. See Scanning and the severity gate and ADR 29.

Short form: scanning: false is the same as scanning: {enabled: false}.

Short form: scanning: true is the same as scanning: {enabled: true}.

KeyTypeMeaningDefault
enabledbooleanScan hosted publishes for known vulnerabilities and attach the result to the artifact. Off when the section is absent. An absent enabled in the mapping means true, because writing the section signals intent.false
trivystringThe Trivy executable. A bare name is looked up on the PATH. Sindri runs it as a separate process and never links it in.trivy
dbRepositorystringA mirror of the Trivy vulnerability database, passed as --db-repository, for a server that cannot reach the public one. Cannot be combined with skipDBUpdate. Credentials written into the reference are redacted by config show.unset
javaDbRepositorystringA mirror of Trivy’s Java vulnerability database, passed as --java-db-repository. Trivy fetches that database separately, and only when a scanned image or package holds a jar. An air-gapped install that scans jar-containing images sets this, or pre-seeds the Java database in cacheDir; otherwise, with skipDBUpdate, such a scan fails (fail closed). Cannot be combined with skipDBUpdate. Credentials written into the reference are redacted by config show.unset
cacheDirstringWhere Trivy keeps its database and caches between scans. Empty uses sindri/trivy under the user’s cache directory ($XDG_CACHE_HOME, or ~/.cache on Linux). The -trivy release image sets $XDG_CACHE_HOME to /var/cache, so there it is /var/cache/sindri/trivy.unset
timeoutdurationHow long one scan may run before it is cancelled and retried. At least 1m.10m
jobTimeoutdurationHow long one whole scan job may run, across every platform of an image index and the staging in front of them, before it is cancelled, attaches nothing, and is retried with backoff. Must be at least timeout. Default 1h, or timeout when that is longer; 0s means the default, not no limit.1h
skipDBUpdatebooleanNever download the vulnerability database, and scan with the one already in cacheDir, including the Java database that Trivy fetches separately when it finds a jar. For an air-gapped server with a pre-seeded cache; a jar-containing subject fails to scan if the Java database is not in it. Cannot be combined with dbRepository or javaDbRepository.false
offlineScanbooleanPass --offline-scan to Trivy, so it makes no package lookups while scanning. Sindri always passes --skip-version-check and --disable-telemetry, so with this set Trivy makes no network request of its own. A server with a pre-seeded cache is offline, so this follows skipDBUpdate. Unlike skipDBUpdate it may be combined with dbRepository and javaDbRepository, for an air-gapped server that reaches only a mirror. Default false, or true when skipDBUpdate is set.false
maxUnpackedBytesintegerThe most bytes unpacked from one wheel or tarball while scanning it, so that an archive bomb cannot fill the disk. At least 1048576 (1 MiB).1073741824
rescanIntervaldurationHow often every approved subject is scanned again, so a vulnerability published after approval is noticed (ADR 31). Default 24h; 0s disables the schedule, and the on-demand re-scan route still works. Otherwise at least 1m.24h

notifications

Webhooks tell a receiver about a new finding on an approved artifact and about a promotion. They are server-level settings with no manifest form. Each delivery is signed and goes through the job queue. See ADR 34.

KeyTypeMeaningDefault
webhooks[].namestringThe webhook’s name, which keys its delivery log. Lower-case letters, digits, and hyphens, at most 63 characters, and unique in the list.unset
webhooks[].urlstringWhere deliveries are POSTed. https, or http for a loopback address, and without credentials in the URL. config show, the API, and the UI print only its scheme and host, because the path often carries a token.unset
webhooks[].secretstringThe key that signs each delivery with HMAC-SHA256. At least 32 bytes; use ${VAR} to keep it out of the file. Redacted by config show.unset
webhooks[].eventslist of stringsThe events to send: finding.new, lifecycle.promoted, or both. At least one, with no repeats.unset
webhooks[].repositorieslist of stringsSend only events for subjects in these repositories. Empty means every repository.unset
webhooks[].timeoutdurationHow long one delivery attempt may take before it is cancelled and retried. More than 0 and at most 1m.10s
maxAttemptsintegerHow many times one delivery is attempted before it is recorded as failed, with the queue’s exponential backoff between attempts. Between 1 and 50.8

ui

The read-only web interface under /ui. It is a server-level setting with no manifest form. Restart the server to change it.

KeyTypeMeaningDefault
docsUrlstringWhere the “Docs” link in the web interface footer, and the sign-in help, point. Set it to an internal copy of the documentation in an air-gapped install. An absolute http or https URL without credentials.https://spjdevops.github.io/sindri/

Repositories, lifecycle, and defaults

These three sections describe desired state. serve reconciles them against the database on start and on SIGHUP. sindri apply converges the same documents from CI. A file with none of these sections leaves repositories API-managed. See ARCHITECTURE.md section 8 and ADR 17.

The short form below desugars into the long form (enveloped manifests) one way and completely. testdata/config/sindri.yaml and testdata/manifests/ spell one setup both ways, and a golden test keeps them identical.

repos

A map from repository name to its entry. A hosted, proxy, or virtual repository is distinguished by what the entry contains, not by a flag.

KeyTypeMeaningDefault
protocolstringoci, pypi, or npm. Required for a hosted repository, and for a proxy with an explicit url. A proxy with a preset takes the preset’s protocol; a virtual repository takes its members’.inferred, as described
upstreampreset name or mappingMakes the repository a proxy. A preset name, or a mapping (below).unset
memberslist of stringsMakes the repository virtual: an ordered list of repository names. Every member must share one protocol.unset
typestringhosted, proxy, or virtual. Optional; if written it must agree with what members and upstream imply.inferred
readlist of stringsGroups that may read. Entries are group names as the identity provider reports them, or authenticated for any signed-in caller.defaults.<type>.read, else administrators, and machine tokens scoped to it
writelist of stringsGroups that may write. Write implies read.defaults.<type>.write, else administrators, and machine tokens scoped to it
lifecyclelist of strings, or mappingHosted repositories only: the stages artifacts may be promoted into, as a list, or as a mapping with stages.defaults.hosted.lifecycle, else every stage
lifecycle.stageslist of stringsThe same list, in the mapping spelling.every stage

An entry with neither members nor upstream is hosted. An entry with both is an error: declare two repositories. A member written in another namespace needs its type as a prefix, such as hosted/org/internal-py.

upstream takes a preset name or a mapping. A preset is an upstream built into the binary, so nobody hand-types the URL, and it sets these values:

PresetProtocolURLttlnegativeTtl
dockerhubocihttps://registry-1.docker.io1h5m
ghcrocihttps://ghcr.io1h5m
maven-centralmaven, reserved: this build does not serve ithttps://repo.maven.apache.org/maven21h5m
npmnpmhttps://registry.npmjs.org1h5m
pypipypihttps://pypi.org/simple1h5m

A preset names an upstream, not a repository: the repository’s name is its key under repos:, so public-js: { upstream: npm } is as valid as npm: { upstream: npm }. sindri config show --expanded prints what each preset became.

The mapping takes these keys:

KeyTypeMeaningDefault
presetstringA preset name, as above.unset
urlstringThe upstream’s URL. Needed when there is no preset.the preset’s
ttldurationHow long a cached answer is fresh. 0 never expires, so the cache is never refreshed and Sindri never notices upstream removing a file. Always set it for an explicit url.the preset’s; else defaults.proxy.ttl; else 0
negativeTtldurationHow long “not found” is remembered. 0 means it is not cached.the preset’s; else defaults.proxy.negativeTtl; else 0
credentialsstringA key of the top-level credentials: map.unset

Precedence, lowest first: the preset, then defaults.proxy, then what the repository writes. A mapping with an explicit url, and no ttl or negativeTtl here or in defaults.proxy, leaves both at 0. An unset ttl of 0 never expires: a cached hit is always fresh and never revalidated, so that proxy never refreshes its cache, and since SIN-54 never notices upstream removing a file, because a refresh is what flags it. An unset negativeTtl of 0 means “not found” is not cached. Always set ttl for an explicit url.

lifecycle

The ordered stages and the evidence each requires.

KeyTypeMeaningDefault
stageslistAn ordered list. Each entry is a stage name, or a mapping with name and gates.no stages
stages[].namestringThe stage name, in the mapping spelling.
stages[].gateslist of gatesRules to promote into the stage, in the mapping spelling. Each entry is an evidence type (a string) or a scan mapping.no gates
gatesmap of stage to list of gatesA map from a stage name to the rules to promote into it, for example prod: [sbom, signature, {scan: {maxSeverity: high}}]. The stage must be declared in stages, and a stage’s gates are written in one place, not both.no gates

A gate is an evidence type, or a scan mapping that refuses a subject whose newest Sindri scan of any platform holds a finding above a severity ceiling. A stage takes at most one scan rule.

KeyTypeMeaningDefault
scanmappingA scan rule, written in place of an evidence type.
scan.maxSeveritystringThe ceiling: critical, high, medium, or low. high refuses only critical findings; an unrated (UNKNOWN) finding is refused at every ceiling.
lifecycle:
  stages: [dev, integration, prod]
  gates:
    prod:
      - sbom
      - signature
      - scan: {maxSeverity: high}

The rule is a ceiling read from the scan evidence the worker records; ADR 30 gives the reasoning.

Lifecycle applies to hosted repositories only. Stages are organisation-wide.

defaults

Values applied to every repository of a type that does not set them itself. There is no extends:; YAML anchors cover the rest. The keys are the repository types, and each takes the fields of the same name on a repository.

KeyFields it may set
hostedread, write, lifecycle
proxyread, write, ttl, negativeTtl, credentials
virtualread, write

Long form: manifests

sindri apply -f <file-or-directory> and sindri diff read enveloped documents, several per file separated by ---. Every document has kind, metadata, and spec. All three kinds describe repositories and lifecycle, so none of them has a place for server settings.

kind: Repository

A namespaced repository’s full name is namespace/name.

KeyTypeMeaningDefault
kindstringRepository.
metadata.namestringThe repository’s name. Required.
metadata.namespacestringThe owning team. Omit it for an organisation repository.unset
spec.typestringhosted, proxy, or virtual. Required.
spec.protocolstringoci, pypi, or npm. Required.
spec.upstream.urlstringProxy only. The upstream URL.
spec.upstream.ttldurationProxy only. Fresh time. Unset is 0, which never expires and never refreshes the cache, so always set it.0
spec.upstream.negativeTtldurationProxy only. How long “not found” is remembered. Unset is 0: not cached.0
spec.upstream.credentialsstringProxy only. A key of the server’s credentials: map.unset
spec.members[].refstringVirtual only. <type>/<name>, for example hosted/internal-js; org/<name> or <team>/<name> reaches across a namespace.
spec.access.readlist of stringsGroups that may read, or authenticated.administrators, and machine tokens scoped to it
spec.access.writelist of stringsGroups that may write.administrators, and machine tokens scoped to it
spec.lifecycle.stageslist of stringsHosted only. The stages artifacts may be promoted into.every stage

The long form has no presets and no inference: what is written is what the server acts on. sindri config show --expanded prints a short-form file in this spelling.

kind: Lifecycle

KeyTypeMeaningDefault
kindstringLifecycle.
metadata.namestringA name for the document. Optional.unset
spec.stages[].namestringThe stage name.
spec.stages[].gateslist of gatesRules to promote into the stage: evidence types (strings) or scan mappings, as in the short form.no gates

kind: OrgPolicy

Optional. Absent means every team declares freely. Only one may exist.

KeyTypeMeaningDefault
kindstringOrgPolicy.
metadata.namestringA name for the document. Optional.unset
spec.modestringcentralized (only organisation documents declare repositories), delegated (teams declare freely), or hybrid (teams declare their own, and the mandatory repositories must exist).delegated
spec.mandatoryRepos[].namestringAn organisation repository that must exist.
spec.mandatoryRepos[].lockedbooleanTeams may reference it and never override it.false
spec.namespaces[].namestringA team namespace.
spec.namespaces[].adminslist of stringsGroups that may apply that namespace’s manifests.administrators only

Ownership

The reconciler owns rows marked managed_by = config, and records which trigger owns each: serve --config or sindri apply. The API, the reconciler, and the two triggers never change a row another owns. The reconciler never deletes without --prune. See ADR 17.