Files
ca/etc/dev/trustyca-config.yaml

429 lines
14 KiB
YAML

---
service:
# specifies the service name (to be used in logs, metrics, etc)
name: trustyca
# specifies the Region / Datacenter where the instance is running
region: dev
# specifies the environment where the instance is running: prod|stage|dev|local
# `local` in the `local` cluster is a developer machine or the integration
# test stack: it enables the `local` identity provider (local+<user>@<domain>)
environment: local
# specifies the cluster name
cluster: local
log_levels:
- repo: "*"
level: TRACE
- repo: github.com/effective-security/trustyca
package: "*"
level: TRACE
- repo: github.com/effective-security/trustyca/internal
package: "*"
level: DEBUG
- repo: github.com/effective-security/trustyca/server
package: "*"
level: DEBUG
- repo: github.com/effective-security/trustyca/server/service
package: "*"
level: DEBUG
metrics:
# specifies if the metrics provider is disabled
disabled: false
prefix: trustyca
runtime_metrics: true
allowed_prefixes:
- trustyca
blocked_prefixes:
- promhttp
# the metrics provider: prometheus|inmem
provider: prometheus
prometheus:
expiration: 1m
addr: "127.0.0.1:29090"
auth:
auth_url: https://localhost:8880/v1/auth/authorize
jwt_provider: ${TRUSTYCA_CONFIG_DIR}/jwt-provider.yaml
oauth2_clients: ${TRUSTYCA_CONFIG_DIR}/oauth2_clients.yaml
allowed_domains:
- tbilicode.com
- effectivesecurity.pt
allowed_redirect_domains:
- app.dev.trustyca.io
- auth.dev.trustyca.io
- app.local.trustyca.io
- localhost
# reCAPTCHA v3 site key for the /login page; leave empty to disable reCAPTCHA.
# Not a secret: it is rendered into the page.
recaptcha_site_key: ${TRUSTYCA_RECAPTCHA_SITE_KEY}
sql:
# specifies the connection string. It can be prefixed with file:// or env:// to load the source from a file or environment variable.
data_source: file://${TRUSTYCA_CONFIG_DIR}/sql-conn-trustycadb.txt
# the directory that contains migrations.
migrations_dir: ${TRUSTYCA_CONFIG_DIR}/../../sql/trustycadb/migrations
# aws:
# endpoint:
# region: us-west-2
# profile: localstack
# access_key:
# id: notused
# secret: notused
# retries:
# # retries specifies the map of internal service name to retry configuration
# ebs:
# max_attempts: 10
# max_backoff_seconds: 10
# services:
# default: http://localhost:4566
cache:
provider: redis
redis:
server: redis://localhost:56379
password: redis
client_tls:
trusted_ca: ${HOME}/.trustyca/certs/trustyca_root.pem
orgs:
default_org_name: Default
default_project_name: Default
# configuration for the Certification Authority
ca:
# the authority configuration of the platform issuers and profiles,
# mirrored into platform rows at startup
bootstrap_config: ${TRUSTYCA_CONFIG_DIR}/ca-config.local.yaml
# the staleness bound of the issuers and profiles cached in memory
issuer_cache_ttl: 5m
# the number of issuers kept in memory
issuer_cache_size: 1000
# the retention of expired certificates, applied by the cert_status task:
# how long after its expiry a certificate and its revocation are deleted;
# 0 keeps them forever
retention:
expired_after: 0
# allows issuer keys that no crypto provider holds (the inmem provider,
# PEM keys of imports and bootstrap key files), stored wrapped by the data
# protection provider: the dev platform issuers are such keys. Off in
# stage and prod, where every issuer key lives in KMS or an HSM.
allow_software_keys: true
# configuration for the Authority Information Access service: the public
# routes the issued certificates point at (the issuer certificate, the CRL
# and the OCSP responder), served over plain HTTP by the aia listener
# (service `aia`). The Certificate Information Service (`cis`, the JSON
# and gRPC API of the wfe listener) needs no configuration.
aia:
# the number of OCSP responses kept in memory, each until its NextUpdate
ocsp_cache_size: 1000
# configuration for crypto providers
crypto_provider:
# the location of the configuration file for default provider
default: ${TRUSTYCA_CONFIG_DIR}/kms/aws-dev-kms.yaml
# the list of locations of the configuration files
# providers:
# - ${TRUSTYCA_CONFIG_DIR}/kms/aws-dev-kms-shaken.yaml
# the list of supported manufactures of PKCS11 tokens
pkcs11_manufacturers:
- SoftHSM
# - Gemalto NV
tasks:
# publishes the CRLs that are due: an issuer without a CRL, or a CRL
# within crl_renewal of its next update
- name: crl_renewal
schedule: "every 10 minutes"
# marks expired certificates and applies ca.retention
- name: cert_status
schedule: "every 1 hour"
servers:
# the AIA listener serves the URLs embedded in the issued certificates
# over plain HTTP, as RFC 5280 requires of AIA and CRL Distribution
# Points, to any caller: it has no identity mapping (every caller is a
# guest) and no TLS, and it serves nothing else
aia:
description: Authority Information Access service
disabled: false
listen_urls:
- http://0.0.0.0:8888
services:
- status
- aia
timeout:
request: 3s
# configuration for the authorization module
authz:
# the listener denies by default: no root path here, so that only
# the AIA routes and the status routes are reachable
allow_any:
- /healthz
- /pb.Status
- /v1/status
- /v1/cert
- /v1/crl
- /v1/ocsp
- /v1/ocspi
# specifies to log denied access
log_denied: true
wfe:
description: Web Front End service
disabled: false
listen_urls:
- https://0.0.0.0:8880
server_tls:
cert: ${HOME}/.trustyca/certs/trustyca_server.pem
key: ${HOME}/.trustyca/certs/trustyca_server.key
trusted_ca: ${HOME}/.trustyca/certs/trustyca_root.pem
# accept but not require client certificate
client_cert_auth: false
services:
- status
- auth
- orgs
- ca
- ui
- cis
timeout:
request: 3s
cors: &cors
enabled: true
max_age: 600
allow_credentials: true
# full origins (scheme://host[:port]), matched exactly against the
# Origin header; "*" cannot be combined with allow_credentials
allowed_origins:
# the console in bearer mode (Angular dev server)
- http://localhost:4200
# the console in cookie mode: it must be served over https on a host
# under identity_map.cookies.domain, to read the CSRF cookie
- https://app.local.trustyca.io:4200
allowed_methods:
- HEAD
- OPTIONS
- GET
- POST
- DELETE
# the REST responses; gRPC-Web responses expose their own headers to an
# allowed origin. No "*": a credentialed response never honors it
exposed_headers:
- Grpc-Status
- Grpc-Message
- X-Correlation-ID
allowed_headers:
- Accept
- Accept-Encoding
- Accept-Language
- Authorization
- Content-Length
- Content-Type
- Grpc-Timeout
- Link
- Location
- Referer
- Replay-Nonce
- sec-ch-ua
- sec-ch-ua-mobile
- sec-fetch-dest
- sec-fetch-mode
- User-Agent
- X-Device-ID
- X-CSRF-Token
- X-Correlation-ID
- X-Grpc-Stream
- X-Grpc-Web
- X-User-Agent
# configuration for the authorization module
authz:
# allow any non-authenticated request access to this path and its children
# /v1/* is allowed
allow_any:
- /
- /favicon.ico
- /v1
- /metrics
- /healthz
- /pb.Status
- /v1/webhooks
# allow any authenticated request that includes a non empty role
allow_any_role:
- /pb.Orgs
# the CIS reads the public views of the CA for authenticated callers;
# the AIA routes of the issued certificates are the aia listener's
- /pb.CIS
# the CA of the tenants: every method requires its roles and scopes
# (authctx.CheckAccess), and runs in the backend with the org of the
# token
- /pb.CA
# allow the specified roles access to this path and its children, in format: ${path}:${role},${role}
allow:
- /privpb.Admin:trustyca-admin
# specifies to log allowed access to Any role
log_allowed_any: true
# specifies to log allowed access
log_allowed: true
# specifies to log denied access
log_denied: true
# configuration for the Identity mappers: users and API keys only. The
# wfe maps no TLS client certificate, so that no service role
# (trustyca-*) is reachable on the listener of the internet
identity_map:
debug_logs: false
strict: true
skip_auth:
- /
- /favicon.ico
- /healthz
- /metrics
- /login
- /authenticated
- /payment
- /v1/auth/authorize
- /v1/auth/callback
- /v1/auth/providers
- /v1/auth/removecookie
- /v1/status/node
- /v1/status/server
- /v1/status/version
cookies:
auth: avn_trustyca_access_token
csrf: avn_trustyca_csrf_token
domain: .local.trustyca.io
jwt:
enabled: true
issuer: https://localhost:8880
audience: https://localhost:8880
default_authenticated_role: user
subject_claim: sub
tenant_claim: org
role_claim: email
# the DPoP tokens of the wfe, which the backend maps too: the
# operators are the trustyca-admin role of both listeners, and no
# client certificate maps to it
jwt_dpop: &jwt_dpop
enabled: true
issuer: https://localhost:8880
audience: https://localhost:8880
default_authenticated_role: user
subject_claim: sub
tenant_claim: org
role_claim: email
roles:
trustyca-admin:
- [email protected]
- [email protected]
# the signing plane (DESIGN.md section 2.1): the backend service holds the
# issuer keys and is the CA of the service identities: the RA and the
# operator call it with the org of every request, the WFE forwards the CA
# calls of its tenants, the AIA its OCSP requests. The services
# authenticate with mTLS, the operator with a DPoP token.
backend:
description: Backend service
disabled: false
listen_urls:
- https://0.0.0.0:8881
server_tls:
cert: ${HOME}/.trustyca/certs/trustyca_peer.pem
key: ${HOME}/.trustyca/certs/trustyca_peer.key
trusted_ca: ${HOME}/.trustyca/certs/trustyca_root.pem
# a client certificate is verified when given; the authz rules below
# admit a mapped service role only, and the status routes stay open
# to a health probe
client_cert_auth: false
services:
- status
- admin
- backend
timeout:
request: 3s
cors: *cors
# configuration for the authorization module
authz:
# allow any non-authenticated request access to this path and its children
# the backend denies by default: no root path here, so that a service
# without a rule is refused to every identity; the status routes are
# the only public ones
allow_any:
- /favicon.ico
- /v1/status
- /metrics
- /healthz
- /pb.Status
# allow any authenticated request that includes a non empty role
allow_any_role:
# allow the specified roles access to this path and its children, in format: ${path}:${role},${role}
allow:
- /privpb.Admin:trustyca-admin,trustyca-peer
# the CA of the service identities: the WFE forwards the calls of its
# callers, the RA signs and reads for its tenants, the admin operates
# it, and the AIA forwards OCSP requests only. A deeper path replaces
# the roles of /privpb.Backend, so the OCSP method lists all four.
- /privpb.Backend:trustyca-peer,trustyca-ra,trustyca-admin
- /privpb.Backend/SignOCSP:trustyca-aia,trustyca-peer,trustyca-ra,trustyca-admin
# specifies to log allowed access to Any role
log_allowed_any: true
# specifies to log allowed access
log_allowed: true
# specifies to log denied access
log_denied: true
# configuration for the Identity mappers
identity_map:
debug_logs: false
strict: true
# the operator: a DPoP token of the wfe whose email is listed under
# trustyca-admin; any other token is the default role, which the authz
# rules above refuse. Bearer tokens are not mapped.
jwt_dpop: *jwt_dpop
# the TLS client certificate is the identity of a service caller; the
# mapping is off unless enabled, and a caller is then a guest. A
# certificate is a service identity only: none maps to trustyca-admin
tls:
enabled: true
default_authenticated_role: user
roles:
# the WFE, which forwards the key operations of its callers
trustyca-peer:
- spiffe://trustyca/peer
trustyca-client:
- spiffe://trustyca/client
# the service identities of the CA API (DESIGN.md section 10): the
# Registration Authority and the Authority Information Access service
trustyca-ra:
- spiffe://trustyca/ra
trustyca-aia:
- spiffe://trustyca/aia
# the service clients a process dials the other listeners with, one per
# identity (DESIGN.md section 2.2): a service selects its client by name
clients:
# the CA service of a process without the backend service forwards the
# calls of its tenants to the backend: the WFE identity, trustyca-peer
- name: ca
client_tls:
cert: ${HOME}/.trustyca/certs/trustyca_peer.pem
key: ${HOME}/.trustyca/certs/trustyca_peer.key
trusted_ca: ${HOME}/.trustyca/certs/trustyca_root.pem
server_url:
backend: https://localhost:8881
dial_timeout: 30s
dial_keep_alive_time: 300s
dial_keep_alive_timeout: 30s
# the AIA forwards OCSP requests to the backend when the backend service
# does not run in its process: trustyca-aia, allowed SignOCSP only
- name: aia
client_tls:
cert: ${HOME}/.trustyca/certs/trustyca_aia.pem
key: ${HOME}/.trustyca/certs/trustyca_aia.key
trusted_ca: ${HOME}/.trustyca/certs/trustyca_root.pem
server_url:
backend: https://localhost:8881
dial_timeout: 30s
dial_keep_alive_time: 300s
dial_keep_alive_timeout: 30s