registry(auth): require auth for image pulls (audit F11)

Forgejo 16 mints an anonymous ("ghost user") registry token on /v2/token and
grants it Read on every package regardless of repo visibility, so all 18 app
images were world-downloadable — including images of private repos
(siriusdevops-site, phs-site, sirius-growth-*, sgs-leadgen).

* FORGEJO__service__REQUIRE_SIGNIN_VIEW=true: /v2/token answers UNAUTHORIZED
  to anonymous clients, anonymous manifests get 401. This is the documented
  switch in routers/api/packages/container (Authenticate) and
  services/context/package.go (determineAccessMode). Side effect: the Forgejo
  web UI/API becomes login-only for anonymous visitors.
* imagePullSecrets: [forgejo-pull] on all 18 workloads that pull from the
  registry (osint, piedmont, sirius-growth, siriusdevops). The
  kubernetes.io/dockerconfigjson Secret is per-namespace and out of band
  (never in git); docs/registry-pull-auth.md documents why, how to recreate
  it, and the verification commands. No containerd-level credential.
This commit is contained in:
Sirius DevOps 2026-11-27 00:15:20 -05:00
commit bc942e2571
20 changed files with 169 additions and 0 deletions

View file

@ -58,6 +58,17 @@ spec:
# Bot signup lockdown: admin-only account creation (web + API).
- name: FORGEJO__service__DISABLE_REGISTRATION
value: "true"
# Registry hardening (audit F11): Forgejo hands an anonymous
# ("ghost user") token to /v2/token and grants Read on every
# package, regardless of the owning repo's visibility, so all app
# images were world-downloadable. With REQUIRE_SIGNIN_VIEW the
# token endpoint answers UNAUTHORIZED to anonymous clients and
# containerd pulls need a dockerconfigjson secret per namespace
# (`forgejo-pull`, created out of band — docs/registry-pull-auth.md).
# Side effect: the Forgejo web UI/API is login-only for anonymous
# visitors, including the public repos.
- name: FORGEJO__service__REQUIRE_SIGNIN_VIEW
value: "true"
volumeMounts:
- name: data
mountPath: /data

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-app
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-camera-service
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-ingester
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-nats
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-news-scraper
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-news-summarizer
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -23,6 +23,8 @@ spec:
labels:
app: osint-db
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -15,6 +15,8 @@ spec:
labels:
app: osint-titiler
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: piedmont-contact
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: piedmont-site
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -23,6 +23,8 @@ spec:
labels:
app: sgs-leadgen-ncda
spec:
imagePullSecrets:
- name: forgejo-pull
restartPolicy: Never
nodeSelector:
kubernetes.io/hostname: siriussec

View file

@ -21,6 +21,8 @@ spec:
labels:
app: sgs-leadgen
spec:
imagePullSecrets:
- name: forgejo-pull
restartPolicy: Never
# local-path is a node-local volume: the pod must run where the PV is.
nodeSelector:

View file

@ -13,6 +13,8 @@ spec:
labels:
app: sirius-growth-contact
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: sirius-growth-blog
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: sirius-growth-portal
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: sirius-growth-site
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: siriusdevops-contact
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists

View file

@ -13,6 +13,8 @@ spec:
labels:
app: siriusdevops-site
spec:
imagePullSecrets:
- name: forgejo-pull
tolerations:
- key: dedicated
operator: Exists