AWS and Cloudanix team co-authored this blog: Real-Time Threat and Anomaly Detection for Workloads on AWS

Cloudanix – Your Partner in Cloud Security Excellence

Securing GitLab CI/CD Pipelines: A Practical Checklist

  • Abhiram Shindikar Abhiram Shindikar
  • Sunday, Sep 13, 2026

A CI/CD pipeline has more standing access than almost anything else in a typical cloud environment. It can read your source code, pull your secrets, build and push container images, and often deploy directly to production — usually with far less scrutiny than an individual engineer’s own access would receive. For teams running GitLab as their SCM and pipeline platform, securing that pipeline deserves the same rigor as securing the infrastructure it deploys to.

This is a practical, GitLab-specific checklist, organized by the stages of a typical pipeline.

Runner Security

Understand your runner isolation model. GitLab.com’s shared runners run each job in an isolated, ephemeral environment. Self-hosted runners, by contrast, can be configured with varying levels of isolation — Docker executor, shell executor, Kubernetes executor — and the security properties differ substantially between them. A shell executor runner, for instance, gives jobs direct access to the runner host’s filesystem and processes, which is a meaningfully larger blast radius than a properly configured Docker or Kubernetes executor.

Avoid the shell executor for anything handling secrets or production access. If your runners use the shell executor, a malicious or compromised pipeline job has direct access to whatever else runs on that host — including other pipelines’ artifacts and any credentials cached locally.

Isolate runners by trust level. Do not run untrusted pipeline jobs (from forked merge requests, for example) on the same runners that have access to production deployment credentials. GitLab supports tagging runners and restricting which pipelines can use which runners — use this to separate “build and test” runners from “deploy” runners with elevated access.

Secrets Management

Never hardcode secrets in .gitlab-ci.yml or in repository files. This should be obvious, but it remains one of the most common findings in real pipeline audits. Use GitLab CI/CD variables, marked as “Protected” and “Masked,” for anything sensitive.

Use Protected variables for anything tied to production. A Protected variable is only exposed to pipelines running on protected branches or tags — meaning a pipeline triggered from an arbitrary feature branch cannot access it. This is a meaningful control against a compromised or malicious feature branch attempting to exfiltrate production credentials.

Prefer short-lived, scoped credentials over long-lived ones. Where your deployment target supports it (AWS, for example, via OIDC federation with GitLab), configure the pipeline to obtain short-lived, narrowly-scoped credentials at run time rather than storing a long-lived access key as a CI/CD variable. A long-lived key stored as a variable is a standing credential with the same risks as any other standing credential — if it leaks, it remains usable until someone notices and rotates it.

Run secret scanning on every commit and merge request. GitLab’s built-in secret detection (or an equivalent) should scan every push for accidentally committed credentials, API keys, and tokens. Configure the pipeline to fail, not just warn, when a genuine secret is detected — a warning that nobody acts on is functionally the same as no scanning at all.

Pipeline Permissions and Job Scoping

Apply least privilege to CI/CD job tokens. GitLab’s job token can be scoped to limit which projects and resources a given job can access. Do not leave this at the broadest default if your pipeline does not need it.

Restrict who can modify .gitlab-ci.yml. Because the pipeline configuration file defines what runs with what access, treat changes to it with the same scrutiny as a change to production infrastructure. Branch protection rules and required approvals on merge requests that modify pipeline configuration are a reasonable control here.

Separate build-and-test pipelines from deploy pipelines. A pipeline stage that only compiles and tests code does not need production deployment credentials in scope. Structure pipelines (or use separate pipelines entirely) so that credentials with deployment access are only available to the specific job that performs the deployment, not to every job in the pipeline by default.

Dependency and Static Analysis

Run Software Composition Analysis (SCA) on every build. Know which open-source dependencies your code pulls in, and whether any carry known vulnerabilities, before the build reaches a registry.

Run Static Application Security Testing (SAST) as a pipeline gate, not an afterthought. Findings that surface after code has already merged and deployed are far more expensive to fix than findings caught at the merge request stage. Configure serious findings to fail the pipeline, with clear guidance in the failure message on what needs to change.

Scan Infrastructure-as-Code changes if your pipeline deploys infrastructure. Terraform, CloudFormation, or equivalent files pushed through the same pipeline deserve the same scrutiny as application code — a misconfigured security group defined in Terraform is exactly as dangerous as one created by hand in the console.

Artifact and Image Integrity

Scan container images for vulnerabilities before pushing to a registry. Catch known-vulnerable base images and dependencies before they become the thing a production ECS or Kubernetes workload runs.

Sign or pin image digests where your deployment tooling supports it. Referencing images by mutable tag rather than immutable digest means the same deployment configuration can silently run different code over time as the tag is updated upstream.

Restrict who can push to production-tagged registries or branches. Combine registry permissions with GitLab’s protected branches and tags so that only the pipeline (not an individual with direct registry credentials) can push artifacts intended for production use.

A Consolidated Checklist

  • Runners are isolated by trust level; untrusted jobs never share runners with deploy access.
  • Shell executor is avoided for anything handling secrets or production credentials.
  • No secrets are hardcoded in .gitlab-ci.yml or repository files.
  • Sensitive CI/CD variables are marked Protected and Masked.
  • Short-lived, scoped credentials (e.g., OIDC federation) are used wherever the deployment target supports them.
  • Secret scanning runs on every push and fails the pipeline on detection.
  • Job tokens are scoped to least privilege.
  • Changes to .gitlab-ci.yml require review, same as infrastructure changes.
  • Build/test and deploy pipelines are separated, with deploy credentials scoped only to deploy jobs.
  • SCA and SAST run on every build, with serious findings failing the pipeline.
  • IaC changes are scanned with the same rigor as application code.
  • Container images are scanned before registry push and referenced by digest where possible.
  • Production-tagged registries and branches restrict direct push access to humans.

The Pipeline Is Infrastructure, Treat It Like Infrastructure

The recurring theme across this checklist is that a CI/CD pipeline is not a neutral piece of tooling sitting outside your security boundary — it is privileged infrastructure that touches your source code, your secrets, and often your production environment directly. Teams that would never grant an engineer standing production access without review sometimes overlook that their pipeline has exactly that access by default, running code from a .gitlab-ci.yml file that anyone with merge access can modify. Applying the same scrutiny to pipeline configuration, credentials, and runner isolation that you already apply to human access is the single biggest mindset shift this checklist asks for.

People Also Read

What Our Users Are Saying

Customer Reviews

Cloudanix is trusted by security leaders worldwide to deliver proactive, reliable, and cutting-edge cloud security.

One day, I changed the password of a root account, and my CTO called me within less than a minute to confirm if I did so. I was not expecting a reaction this quick. He told me Cloudanix alerted him of this password change and that he wanted to confirm as it was a critical security notification. I couldn't believe it!

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Compliance is one way of staying secure, but what I want is the ability to go deeper and attain 'true security.' Cloudanix provides us the capability to do so.

Vishal Madan
Vishal Madan
Head of Engineering, iMocha

Cloudanix is building for the future of the cloud, which makes the product all the more desirable.

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Cloudanix gave us the visibility we were missing. Being able to move from permanent access to a robust Just-In-Time (JIT) workflow has fundamentally changed our security posture without slowing down our engineering velocity.

Pavan Kumar Lekkala
Pavan Kumar Lekkala
SRE Lead, HugoHub

We are excited to leverage Cloudanix's comprehensive multi-cloud DevSecOps solution to secure our production workloads on AWS. Cloudanix has demonstrated that it can solve many challenges that DevSecOps teams face while continually adding new features such as SOC2 compliance and drift detection.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Managing third-party partner access was once a major concern for our security posture. With Cloudanix JIT Cloud, we've effectively achieved zero third-party risk. We can now grant access confidently, knowing that it is temporary, audited, and automatically revoked, resulting in a 100% reduction in our privileged access exposure.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

The snooze feature and responsible alerts have helped us save time and prioritize what to tackle first.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Implementing Cloudanix JIT internally allowed us to practice what we preach. By eliminating permanent access to our own clouds and databases, we've neutralized the risk of standing privileges, ensuring our own 'keys to the kingdom' are never left exposed.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

The problem with permissions is a lot of times, the gaps are left open due to oversights from inside the organization itself. With Cloudanix's CIEM, we get a complete view of user permissions and access. This enables us to update the permissions, reducing the attack surface.

Nilesh Pethani
Nilesh Pethani
Application Architect, iMocha

In the world of Fintech, trust is our currency. Cloudanix provided the frictionless visibility we needed to secure our EKS workloads across AWS, ensuring we stay audit-ready for SOC2 and GDPR without slowing down our engineering velocity.

Amol Naik
Amol Naik
Head of Security & Infrastructure, HugoHub

Cloudanix delivered value within 5 minutes of onboarding. Continuous monitoring, timely detection, and excellent documentation helped us attain a great cloud security posture.

Divyanshu Shukla
Senior DevSecOps, Meesho

Technology strategies and business strategies are in a state of constant change which includes centralization and decentralization of responsibilities. Regardless of strategic shift, we still have intellectual property to protect. Cloudanix are critical partners for us in our public cloud security posture across our three cloud providers.

Jerry Locke
Jerry Locke
Senior Director Global Solutions Engineering, Eversana

Cloudanix has been amazing. They opened up a common Slack channel with us — and it feels like we are talking to our own team and getting things done with Cloud security. The support team is always available, friendly, helpful, and ready to go out of their way.

Satish Mohan
Satish Mohan
CTO, Airgap Networks

Beyond just access management, Cloudanix CSPM has given us a unified view of our AWS environment. The real-time alerting and anomaly detection allow us to prevent any untoward activity before it happens, which is critical for a marketplace connecting 50+ financial institutions.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

For a Fintech company, data is our most valuable — and most sensitive — asset. Cloudanix DAM hasn't just improved our visibility; it has given us control. The ability to mask data and prevent unauthorized queries in real-time is a game-changer for our compliance and customer trust.

Jiten Gala
Jiten Gala
President Engineering and Product, Kapittx

Our clients, especially in the Middle East financial sector, demand absolute accountability. Cloudanix JIT Cloud has been a competitive differentiator for us, allowing us to provide secure, governed access to customer accounts that meet their strictest audit and compliance requirements.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

Cloudanix is always on my team's lips because of its exceptional support. Be it a small or big query, Cloudanix has gone above and beyond to resolve them. This one's a keeper for us.

Sujit Karpe
Sujit Karpe
CTO, iMocha

For a long-lasting partnership, great support goes a long way. Cloudanix has delivered exceptional support whenever required. Their edge is their team is always ready to go beyond to solve any issues that we have. This speaks volumes about the culture at Cloudanix.

Akash Maheshwari
Akash Maheshwari
Co-founder, MoveInSync

Beyond the technology, Cloudanix feels like an extension of our own team. Their willingness to stand up a dedicated Middle East tenant for us and provide exceptional support at a sensible price makes them a long-term partner for Hugosave.

Surya Tamada
Surya Tamada
CTO, HugoHub

The real-time notifications that Cloudanix provides are a real lifesaver. Their adaptive notifications ensure that my team stays productive and doesn't get interrupted all the time.

Digvijay Singh
Staff Security Engineer, Meesho

The whole point in technological evolution is to help improve the world we live in. We must protect that and to do so requires an effective and efficient security strategy. The Cloudanix team helped make our public cloud security posture management strategy a reality. The symbiotic relationship we have allows for a continuous feedback loop which is how business should operate.

Larry Wheat
Larry Wheat
Staff Solutions Engineer, Eversana

Ready to see your graph?

Connect a cloud account in under 30 minutes. See every finding rooted in identity, asset, and blast radius — with a fix path attached.

Book a Demo