This project processes authenticated GitLab webhooks and dispatches agent automation. The following guidance summarizes the expected security posture prior to a public release and highlights the controls implemented in this audit.
- Base image is pinned to
python:3.12.6-slim-bullseyeto reduce drift. The build also pinspip,uv, and the GitLab CLI version (GLAB_VERSIONbuild arg). - Runtime user:
docker-entrypoint.shdrops privileges to theappuseraccount by default. When mapping host UIDs/GIDs, set theLOCAL_UID/LOCAL_GIDenvironment variables or run the container with--user. - Minimal packages: only required OS packages (curl, git, nodejs/npm for agent tooling, tini) remain.
aptcaches are removed after install. - Logs directory: application writes to
/work/run-logs(bind mount recommended). Fallback log directory uses the system temp directory rather than hard-coded/tmp.
When deploying, prefer:
docker run \
--read-only \
--cap-drop ALL \
--security-opt no-new-privileges \
--tmpfs /tmp \
--user $(id -u):$(id -g) \
robot-dev-team-appAdjust tmpfs and writable volumes as needed for prompts/config/logs.
- Python dependencies are pinned in
pyproject.toml. pip installis version locked;uvinstalls pinned dev tooling.- Add
pip-auditorsafetyto CI (tracked in issue #14) to continuously scan for vulnerabilities. - Generate an SBOM (e.g.,
syft packages docker:robot-dev-team-app) for release artifacts.
- Webhook requests must provide the
X-Gitlab-Tokenshared secret; setGITLAB_WEBHOOK_SECRETvia environment. - Agent PATs are read from
CLAUDE/GEMINI/CODEX_AGENT_GITLAB_TOKENenvironment variables and are not logged. Ensure these are injected via secret stores (Docker secrets, Kubernetes secrets, etc.). - Git credential rotation is handled by
glab-usr; tokens are written to the container-local credential store and reconfigured on each authentication. - Never commit
.envfiles or run-log payloads containing sensitive data.
Agent CLIs authenticate to LLM providers using the host user's personal account credentials, which are bind-mounted from ~/.claude, ~/.gemini, and ~/.codex into the container. These directories are mounted read-write because the entrypoint also writes glab-token files into them for GitLab CLI authentication.
- Restrict host directory permissions (e.g.,
chmod 700 ~/.claude ~/.gemini ~/.codex) to prevent unauthorized access. - The container never extracts or logs LLM provider tokens; authentication is delegated entirely to the CLI binaries.
- If using a shared or multi-user host, consider pointing
*_CONFIG_PATHvariables to dedicated directories with restricted ownership rather than mounting personal home directories.
- The application listens on
127.0.0.1by default. In container environments, uvicorn binds to0.0.0.0via the command arguments. Prefer terminating TLS at a trusted reverse proxy (nginx, Traefik) and forwarding to the container over an internal network. - Enforce HTTPS externally, enable HSTS, and configure mutual TLS where possible for webhook ingestion.
- Apply rate limiting and IP allowlists in the reverse proxy to mitigate brute-force or replay attempts.
- Review logs for potential secret leakage before enabling central aggregation.
- Instrument Falco/Trivy runtime scanning and OWASP ZAP DAST (tracked in issue #17).
- Enable webhook replay detection/deduplication (existing
_DEDUPservice covers UUIDs) and monitor for repeated failures.
- Configure
GITLAB_WEBHOOK_SECRETand agent tokens via a secret manager. - Front the service with TLS termination, rate limiting, and IP filtering.
- Run
bandit -r app,pip-audit, andtrivy imageduring CI. - Regenerate SBOMs for each release artifact.
- Verify container runs with dropped privileges and minimal writable paths.
- Review
run-logs/directory and rotate tokens on incident.
For coordinated vulnerability disclosure, file a confidential issue in this project's GitLab repository.