Files
agent-identity-provisioning/Dockerfile
T
TSYS Group COO 04ece5234a feat: non-root container, reusable SSO flow, OIDC access detection
Security:
- Container now runs as non-root user 'provision' (CMMC/STIG audit
  requirement). Root execution would fail security audits.
- BW state persisted in named volume at /home/provision/.config/
  Bitwarden CLI to avoid slow re-auth on every run.

SSO refactoring:
- cloudron_panel_login(): establishes Cloudron panel session once,
  shared across all subsequent app SSO flows
- sso_login(): clicks app-specific SSO/OAuth button, handles Cloudron
  OIDC login + consent redirect, properly detects failures
- Detects "You do not have access" OIDC rejections (access control
  issue, not a selector bug)
- Per-app SSO button selectors passed as parameters for extensibility
  to future Cloudron apps (Dolibarr, Paperless, Firefly, etc.)

Debug:
- _debug_dump() captures screenshot + DOM at failure points
- Added dumps at Gitea token, Redmine key, and SSO failure locations

Current blocker: vp-techops Cloudron user not yet granted access to
Gitea/Redmine/Discourse apps. Cloudron 2FA confirmation pending.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
2026-08-13 14:01:22 -05:00

38 lines
1.2 KiB
Docker

FROM mcr.microsoft.com/playwright:v1.52.0-noble
RUN apt-get update && \
apt-get install -y --no-install-recommends \
jq \
unzip \
wget \
python3-pip \
libzbar0 \
libzbar-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Bitwarden CLI — native Rust binary (no Node.js/npm)
# Same CLI interface as the npm package but zero runtime dependencies.
ARG BW_CLI_VERSION=2026.7.0
RUN wget -q -O /tmp/bw.zip \
"https://github.com/bitwarden/clients/releases/download/cli-v${BW_CLI_VERSION}/bw-linux-${BW_CLI_VERSION}.zip" && \
unzip -o /tmp/bw.zip -d /usr/local/bin/ && \
chmod +x /usr/local/bin/bw && \
rm /tmp/bw.zip
# Install Python dependencies
COPY requirements.txt /tmp/
RUN python3 -m pip install --no-cache-dir --break-system-packages -r /tmp/requirements.txt
# Create non-root user for Playwright
RUN groupadd -r provision && useradd -r -g provision -G audio,video -m -d /home/provision provision \
&& mkdir -p /home/provision/.config \
&& chown -R provision:provision /home/provision
WORKDIR /app
COPY . .
RUN chown -R provision:provision /app
USER provision
ENTRYPOINT ["python3", "/app/provision-agent.py"]