HUB
Sign inSign up
oauth2-proxy logo

dgcosenza/oauth2-proxy

By dgcosenza

•Updated about 4 hours ago

Hardened rootless OAuth2 Proxy identity-aware reverse proxy on Debian 13 (multi-arch, 0 CVEs).

Image
0

305

dgcosenza/oauth2-proxy repository overview

⁠OAuth2 Proxy — Hardened Debian 13 (trixie-slim) Container Image

Daily CI OpenSSF Scorecard Workflow Gitleaks Secret Scan Public Content Check OpenSSF Scorecard OpenSSF Best Practices

Trivy + Grype: 0 Fixable CVEs Signed: Cosign OIDC SLSA Build L3 SBOM: SPDX + CycloneDX Base OS Architectures Healthcheck: CI Verified Renovate Enabled Dependabot Enabled Daily Rebuilds

Latest Release Release Date Last Commit Docker Pulls Docker Image Size Registries: Docker Hub + GHCR Packaging License: MIT Upstream License GitHub Issues FNX Labs Catalog

A hardened, rootless, read-only-rootfs OAuth2 Proxy identity-aware reverse proxy built from official upstream source on Debian 13 (trixie-slim) with patched Go modules and 0 fixable CVEs. Maintained by Daniel G. Cosenza from FNX Labs.

⁠Overview

dgcosenza/oauth2-proxy is a hardened, drop-in replacement for quay.io/oauth2-proxy/oauth2-proxy. It compiles official oauth2-proxy/oauth2-proxy releases from source with patched Go modules (golang.org/x/crypto, golang.org/x/net, golang.org/x/sys), supports Docker secret files (OAUTH2_PROXY_CLIENT_SECRET_FILE, OAUTH2_PROXY_COOKIE_SECRET_FILE) and /config/oauth2-proxy.cfg, and runs strictly as non-root UID/GID 1000:1000 with read_only: true and cap_drop: [ALL].

⁠Current Versions

ComponentResolved Version
OAuth2 Proxy7.15.6
Base OSDebian 13.8 (trixie-slim)
Architectureslinux/amd64, linux/arm64
Uncompressed size (per arch)amd64: 48.3 MB, arm64: 150.0 MB
Last verified build (UTC)2026-11-29
Published multi-arch digestdgcosenza/oauth2-proxy@sha256:97ca1ddca2d71368457d6b15fa5b573e22062adb417c5cc5b5fb39fc74578037
GHCR mirrorghcr.io/dgcosenza/oauth2-proxy@sha256:97ca1ddca2d71368457d6b15fa5b573e22062adb417c5cc5b5fb39fc74578037
Supply chainCosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance
Security gate (Trivy + Grype on SBOM)0 fixable findings of any severity (15 upstream-unfixed)

⁠Supported Tags

TagPolicyDescription
latestMovingLatest verified multi-arch build passing all CVE, Dive, and smoke gates.
<version> (e.g. 7.15.6)MovingLatest verified build for that upstream release.
<version>-<YYYYMMDD>ImmutableDate-stamped daily security rebuild.
sha-<short>ImmutableGit commit tag from this repository.

Pin production deployments by immutable digest: dgcosenza/oauth2-proxy@sha256:<digest> or ghcr.io/dgcosenza/oauth2-proxy@sha256:<digest>.

⁠Supported Architectures

ArchitectureStatusVerification
linux/amd64Published & natively testedNative x86_64 build, smoke test, Dive >= 95%, Trivy + Grype 0 fixable CVEs, Cosign OIDC, SLSA L3.
linux/arm64Published & natively testedNative ARM64 build, smoke test, Dive >= 95%, Trivy + Grype 0 fixable CVEs, Cosign OIDC, SLSA L3.

⁠Quick Start

Volume ownership note: docker-compose.example.yml defaults to a named Docker volume so non-root runtime permissions (1000:1000) are initialized automatically; if switching to a host bind mount, pre-create the directory owned by 1000:1000 before docker compose up -d.

docker run -d --name oauth2-proxy --restart unless-stopped \
  --read-only --tmpfs /tmp:uid=1000,gid=1000 \
  --cap-drop ALL --security-opt no-new-privileges:true \
  -p 127.0.0.1:4180:4180 \
  -e OAUTH2_PROXY_PROVIDER=google \
  -e OAUTH2_PROXY_CLIENT_ID=your-client-id \
  -e OAUTH2_PROXY_CLIENT_SECRET_FILE=/run/secrets/oauth2_proxy_client_secret \
  -e OAUTH2_PROXY_COOKIE_SECRET_FILE=/run/secrets/oauth2_proxy_cookie_secret \
  -e OAUTH2_PROXY_EMAIL_DOMAINS="*" \
  -e OAUTH2_PROXY_UPSTREAMS="http://upstream:8080" \
  dgcosenza/oauth2-proxy:latest

⁠Compose Example

See docker-compose.example.yml⁠:

services:
  oauth2-proxy:
    image: dgcosenza/oauth2-proxy:latest
    container_name: oauth2-proxy
    restart: unless-stopped
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    tmpfs:
      - /tmp:uid=1000,gid=1000
    ports:
      - "127.0.0.1:4180:4180"
    environment:
      TZ: "Etc/UTC"
      OAUTH2_PROXY_PROVIDER: "oidc"
      OAUTH2_PROXY_OIDC_ISSUER_URL: "https://idp.example.com"
      OAUTH2_PROXY_CLIENT_ID: "oauth2-proxy"
      OAUTH2_PROXY_CLIENT_SECRET_FILE: "/run/secrets/oauth2_proxy_client_secret"
      OAUTH2_PROXY_COOKIE_SECRET_FILE: "/run/secrets/oauth2_proxy_cookie_secret"
      OAUTH2_PROXY_EMAIL_DOMAINS: "*"
      OAUTH2_PROXY_UPSTREAMS: "http://127.0.0.1:8080"
      OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:4180"
    secrets:
      - oauth2_proxy_client_secret
      - oauth2_proxy_cookie_secret
    volumes:
      - oauth2_proxy_config:/config

secrets:
  oauth2_proxy_client_secret:
    file: ./secrets/oauth2_proxy_client_secret.txt
  oauth2_proxy_cookie_secret:
    file: ./secrets/oauth2_proxy_cookie_secret.txt

volumes:
  oauth2_proxy_config:

⁠Configuration

VariableDefaultDescription
OAUTH2_PROXY_HTTP_ADDRESS0.0.0.0:4180HTTP listening address and port.
OAUTH2_PROXY_PROVIDERgoogleOAuth2 / OIDC provider (oidc, google, github, entra-id, keycloak-oidc, etc.).
OAUTH2_PROXY_CLIENT_ID(required)OAuth2 client ID.
OAUTH2_PROXY_CLIENT_SECRET_FILE/run/secrets/oauth2_proxy_client_secretPath to file containing the OAuth2 client secret.
OAUTH2_PROXY_COOKIE_SECRET_FILE/run/secrets/oauth2_proxy_cookie_secretPath to file containing the 16/24/32-byte cookie secret.
OAUTH2_PROXY_EMAIL_DOMAINS*Allowed email domains.
OAUTH2_PROXY_UPSTREAMS(optional)Upstream HTTP URLs or static://200.

Ports: 4180/tcp (OAuth2 Proxy HTTP endpoint and /ping health probe). Volumes: /config (optional oauth2-proxy.cfg and custom templates). User: oauth2proxy (UID/GID 1000:1000). PID 1: tini.

⁠Healthcheck

HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
  CMD ["/usr/local/bin/oauth2-proxy-healthcheck"]

Probes http://127.0.0.1:4180/ping and verifies an exact OK response.

⁠Upgrade / Migration from quay.io/oauth2-proxy/oauth2-proxy

  1. Replace image with dgcosenza/oauth2-proxy@sha256:<digest>.
  2. Keep existing CLI flags or OAUTH2_PROXY_* environment variables (binary remains at /bin/oauth2-proxy).

⁠Supply-Chain Verification

cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/oauth2-proxy-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/oauth2-proxy:latest

gh attestation verify oci://ghcr.io/dgcosenza/oauth2-proxy:latest --owner dgcosenza

⁠Security

  • 0 fixable vulnerabilities of any severity: Hard-gated in CI by Trivy (UNKNOWN–CRITICAL, --ignore-unfixed, exit 1) and Grype on the Syft SPDX SBOM (--only-fixed --fail-on negligible) on both amd64 and arm64.
  • Hardened runtime: Runs under tini PID 1 with least-privilege capabilities and no-new-privileges:true.
  • Report issues via SECURITY.md⁠.

⁠Build Locally

docker buildx build --platform linux/amd64 --load -t dgcosenza/oauth2-proxy:local .
./tests/smoke.sh dgcosenza/oauth2-proxy:local

⁠Update Policy

.github/workflows/daily.yml⁠ runs daily at 42 5 UTC with --no-cache: refreshes the debian:13.8-slim digest and OS security patches, runs smoke + Dive + Trivy + Grype gates on amd64 and arm64, publishes identical Cosign-signed SLSA L3 digests to Docker Hub and GHCR (plus optional Quay.io, GitLab, Codeberg, and Amazon ECR Public mirrors when configured), creates a signed GitHub Release, syncs docs & Docker Hub overview, and manages a single ci-failure issue.

⁠Design Decisions

  • Source-built with patched Go modules: Eliminates Go stdlib and golang.org/x/crypto vulnerabilities.
  • Secret-file native: Supports OAUTH2_PROXY_CLIENT_SECRET_FILE and OAUTH2_PROXY_COOKIE_SECRET_FILE out of the box.

⁠License

Packaging, scripts, workflows, and documentation (packaging: MIT, upstream: MIT) are licensed under the MIT License⁠ — copyright Daniel G. Cosenza from FNX Labs. Third-party upstream notices: THIRD-PARTY-NOTICES.md⁠.

⁠Credits

Maintained by Daniel G. Cosenza from FNX Labs. Upstream project: oauth2-proxy/oauth2-proxy⁠.

Tag summary

Content type

Image

Digest

sha256:97ca1ddca…

Size

46 MB

Last updated

about 4 hours ago

docker pull dgcosenza/oauth2-proxy