The Simplest Way to Make Gitlab and GitLab CI Work Like They Should
Teams use gitlab and gitlab ci to store code and run build jobs in one place. Every code push starts a pipeline that tests, builds, and ships your app. This paired setup removes the need to sync webhooks between two separate tools. Your source code and your build rules live in the same project repo. When a developer opens a merge request, the runner picks up the job right away. The runner checks the code, runs the tests, and sends the status back to the repo. How roles and data move between g
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.
Teams use gitlab and gitlab ci to store code and run build jobs in one place. Every code push starts a pipeline that tests, builds, and ships your app.
This paired setup removes the need to sync webhooks between two separate tools. Your source code and your build rules live in the same project repo. When a developer opens a merge request, the runner picks up the job right away. The runner checks the code, runs the tests, and sends the status back to the repo.
How roles and data move between gitlab and gitlab ci
The source repo holds your code, branch rules, and user roles. The pipeline engine reads a build file from the root of that repo. When a user pushes a change, the main server checks their project role first. If the user has write permissions, the server queues a new pipeline run.
Next, a runner agent pulls the job from the central queue. The server gives the runner a short job token tied to that user. This token lets the runner clone the code and pull container images. During the run, the agent streams text logs back to the main server. After the job finishes, the runner uploads build files and test reports. The server then deletes the job token so nobody can reuse it later.
Secrets also flow from the project settings into the active runner job. Admins store database keys and cloud tokens in the project store. The server sends these values to the runner memory when the job starts. If a secret is marked as protected, only protected branches can read it.
Common failure modes and how to scope runner roles
Many teams fail by sharing one group runner across every single project. When projects share a runner, one build job can leave files behind for the next. A bad script on a shared host can also read local cache files. To fix this, run each job inside a fresh container that dies after the run. Give production projects their own dedicated runner hosts that other teams cannot use.
GitLab CI Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Broad secrets are another common trap in build pipelines. Teams often store one root database key at the top group level. Then every branch in every project can read and print that root key. If a developer pushes a test branch, their script can dump the key into the build log. Instead, scope your keys to specific branches and specific target stages. Mark every secret as masked so the log engine rewrites matched values in output text. If a log line contains emails or card numbers, masking rewrites those matched fields too.
Unlogged database queries during deployment jobs also create big blind spots. Build scripts often run schema changes using a shared service account. When a bad query locks a table, the database log only shows the shared account name. You cannot tell which pipeline run or which developer triggered that query. Always tie each pipeline job to the specific user identity that started the run. Scope network paths so build runners can only reach test servers, while deploy runners reach production.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
How do I stop feature branches from reading production keys?
Mark your production branches and tags as protected in the project rules. Then set your production secrets to only load on those protected branches. Feature branches will run tests without receiving any production keys.
Should we use shared runners or project runners for deploy jobs?
Use dedicated project runners for any job that ships code to production. Shared runners work well for basic code checks and unit tests. Dedicated runners let you lock down network rules and host roles.
Why did my build job fail to pull a second private repo?
The job token only grants read permissions to the main repo by default. You must add the first project to the allowlist inside the second project settings. Then the runner can pull both repos using the same job token.
Related guides
In this post