Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
80 lines (79 loc) · 3.85 KB
/
Copy pathcompose.yaml
File metadata and controls
80 lines (79 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# ./bugwarden.env must exist or compose refuses to start. ./policy.toml and
# ./bugzilla-key must exist as FILES: docker creates a directory for a missing
# bind source and the container then fails to start on what looks like a parse
# error (podman refuses the mount outright).
services:
bugwarden:
image: ghcr.io/plusky/bugwarden:latest
# build: .
ports:
# Loopback only: the bearer token authenticates callers, it does not
# make the endpoint safe to expose to the internet.
- "127.0.0.1:8000:8000"
environment:
BUGZILLA_SERVER: https://bugzilla.example.org
# Server-held key mode; drop this to have each client send its own
# Bugzilla key in the ApiKey header instead.
BUGZILLA_API_KEY_FILE: /run/secrets/bugzilla-key
# BUGWARDEN_AUDIT_CONFIG: /etc/bugwarden/audit.toml
# OTLP export to the sidecar below. A configured collector is
# load-bearing: delivery is probed at startup and an outage engages
# fail_mode. Pair it with BUGWARDEN_AUDIT_CONFIG (a file, or `none`
# for collector-only); an endpoint with no file decision is a
# startup error. The service name resolves on compose's network,
# which is why the collector must not bind loopback — see the note
# on its own receiver in examples/otel-collector.yaml.
# OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
# Deny-by-default: without a token the server refuses to start. Kept in a
# file rather than the shell environment so the value stays out of argv.
env_file:
- ./bugwarden.env
volumes:
# The image presets BUGWARDEN_POLICY, so a missing mount is a startup
# error; read-only because the guard reads it once and nothing may
# reach it afterwards (I1).
- ./policy.toml:/etc/bugwarden/policy.toml:ro
# Must be readable by uid 65532: `chown 65532 ./bugzilla-key`.
- ./bugzilla-key:/run/secrets/bugzilla-key:ro
# Audit stream. A bind mount, not a named volume: docker creates those
# root:root 0755, which uid 65532 cannot write, and startup then fails.
# Run `mkdir -p ./audit && chown 65532:65532 ./audit` first.
# - ./audit.toml:/etc/bugwarden/audit.toml:ro
# - ./audit:/var/log/bugwarden
# Defense in depth: bugwarden handles SIGTERM itself, so compose down
# without an init is a graceful stop. An init process still reaps
# unexpected children if the runtime ever grows any.
init: true
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# Sidecar collector, commented out because its destination is a policy
# decision (see examples/otel-collector.yaml): the stream carries guard
# verdicts, rule names and withheld bug ids, so it is at least as
# sensitive as the bugs it describes.
#
# Two ways records reach it, and the example config takes both: the OTLP
# endpoint above, and the filelog receiver tailing the shared audit
# volume. The tail is the tamper-evidence path — once the lines are off
# the host, the host cannot rewrite its own history.
#
# bugwarden writes the audit file 0600 and its directory 0700 as uid
# 65532, so the collector has to run as the SAME uid to read it. Do not
# loosen the file, and do not run the collector as root: that would swap
# a permission problem for a collector that can rewrite the record it
# exists to preserve.
# otel-collector:
# image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
# user: "65532:65532"
# command: ["--config=/etc/otelcol/config.yaml"]
# volumes:
# - ./examples/otel-collector.yaml:/etc/otelcol/config.yaml:ro
# # The same directory bugwarden writes, read-only on this side.
# - ./audit:/var/log/bugwarden:ro
# read_only: true
# cap_drop:
# - ALL
# security_opt:
# - no-new-privileges:true