SECOPS

Scan GitLab MR diffs for leaked secrets and page on a hit

Runs a secret-detection scan against each GitLab MR diff; on a verified hit it labels the MR as blocked, comments the offending lines.

CategorySecOps
Enginesim
Difficultyadvanced
Triggerwebhook
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab MR opened or updatedGitLabGitLab
  • ActionFetch MR diff (added lines)GitLabGitLab
  • LogicRun secret detection + verifier; exit if clean
  • ActionLabel MR sec::secret-leak + comment locationGitLabGitLab
  • OutputOpen PagerDuty incident for rotationPagerDutyPagerDuty

What it does

This workflow treats every merge request as a potential secret-leak surface. When an MR opens or updates, it runs a secret-scanning pass over the added lines of the diff. If a credential pattern is found and passes the verifier (entropy plus known-format checks), it labels the MR `sec::secret-leak`, comments the exact file and line, and pages on-call so the secret can be rotated immediately.

When to use it

Use it as a last-line defense when pre-commit hooks are optional or inconsistently installed, and you need server-side enforcement plus a real-time page for confirmed leaks rather than a daily report.

How it works

  1. 1A GitLab MR webhook fires on open or update.
  2. 2The flow fetches the MR diff (added lines only).
  3. 3A scan step runs detection rules and a verifier to drop false positives.
  4. 4If no verified secret is found, it exits.
  5. 5On a hit it applies the `sec::secret-leak` label and comments the offending location on the MR.
  6. 6It triggers a PagerDuty incident tagged with the repo and MR for rotation.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect PagerDutyIncidents, on-call, escalations.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.