The Simplest Way to Make GitLab CI and Webauthn Work Like They Should
Using gitlab ci and webauthn together binds automated build jobs to human hardware key checks. This pair lets teams pause high-risk production runs until an approved user taps a physical key. Build systems run scripts fast, while hardware keys prove that a real person approved the run. When you join them, no sensitive job can alter live systems without a strong cryptographic check. This setup stops stolen passwords or leaked tokens from triggering unauthorized changes. How gitlab ci and webau
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Using gitlab ci and webauthn together binds automated build jobs to human hardware key checks. This pair lets teams pause high-risk production runs until an approved user taps a physical key.
Build systems run scripts fast, while hardware keys prove that a real person approved the run. When you join them, no sensitive job can alter live systems without a strong cryptographic check. This setup stops stolen passwords or leaked tokens from triggering unauthorized changes.
How gitlab ci and webauthn share identity and permissions
First, a developer pushes code or requests a deploy inside the platform. When a job targets a protected stage, the system holds the job in a waiting state. The platform asks the assigned reviewer to log in and approve the pending release.
During this step, the browser talks to the user's hardware key or built-in device sensor. The key signs a fresh challenge linked to the exact domain and user account. The identity provider checks that signature against the stored public key for that specific user.
Once the signature passes the check, the platform marks the manual gate as approved. Only then does the runner receive the job payload and temporary job token to start work. Data flows from the user check to the runner control plane without exposing private key material.
Common failure modes and how to scope roles
Many teams fail by enforcing hardware keys for humans while leaving shared runner accounts wide open. If a background runner holds a broad static token, an attacker can skip the approval gate. A weak test job could read that shared secret and push changes straight to live servers.
Another common mistake is using one shared service account for every stage of the pipeline. When all jobs use the same role, logs cannot show who approved a specific database query. Broad tokens also let low-risk build steps reach sensitive data stores by mistake.
GitLab CI Security + FIDO2 / WebAuthn: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, tie each protected stage to a strict role and a narrow network path. Give production runners their own isolated host pool that only runs jobs from protected branches. Require a fresh hardware key check before a human can trigger or approve those specific jobs.
Make sure every runner exchanges its job identity for short-lived role permissions on the target system. Do not store static database passwords or cloud keys inside shared group variables. Keep build runners on a separate network from deploy runners so test code cannot reach live hosts.
Auditing human approvals and automated tasks
Security teams need clear logs that link a hardware key tap to the final server command. Standard build logs often show which runner ran a script, but lose the human identity downstream. When a job connects to a database, the database only sees a generic app user.
You should pass the approving user's identity metadata along with the job context. Log every approval event alongside the commit hash, the target stage, and the timestamp. If a deploy reads customer tables, mask fields like emails, phone numbers, card numbers, and national IDs.
Masking rewrites matched fields in results so sensitive strings do not leak into build logs. Review your role bindings every month to ensure only active team leads can approve live runs. Also require each user to register a backup hardware key to avoid lockouts during an outage.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Can automated runners use a hardware key directly during a job?
No, WebAuthn needs a human presence check like a finger tap on a physical key. Runners use workload identity tokens after a human approves the protected stage with their key.
What happens if an approver loses their registered hardware key?
The user cannot approve protected jobs until an admin resets their factors or they use a backup. Teams should require every approver to register at least two keys to prevent deploy delays.
Does WebAuthn protect variables stored inside the CI settings?
It protects the user account that views settings, but it does not encrypt stored static variables. You should replace static secrets with short-lived tokens tied to specific protected branch runs.
Related guides
In this post