Enterprise AI, cloud modernization, cybersecurity and platform engineering.
Resources › Guide

CI/CD Pipeline Security on AWS, Azure and Google Cloud: 7 Controls for the Pipeline That Ships Your Cloud

iNET SYSTEMS Cloud Practice • Published • Last updated • 8 min read
Reviewed by iNET SYSTEMS Architecture Practice

Key takeaway: continuous integration and continuous delivery (CI/CD) pipeline security decides how safe your Amazon Web Services (AWS), Azure and Google Cloud estate is, because the pipeline holds the keys that deploy it. In 2026, attackers went after pipelines for cloud keys. Replace static secrets with OpenID Connect (OIDC) federation, pin third-party actions to commit Secure Hash Algorithm digests (SHAs), restrict runner egress, separate deploy roles per environment and log data events.

When teams modernize applications on AWS, Azure and Google Cloud, they move them onto cloud-native platforms such as containers, serverless and managed databases, and rebuild delivery around CI/CD automation so they can ship faster. That automation is the part attackers now target first, because a pipeline holds the credentials to deploy, and often to delete, everything you’ve modernized.

Pipeline hardening is the first workstream we scope in every AWS-led engagement, and here’s why. This year the industry watched a mass GitHub Actions campaign, a hijacked security scanner, and fresh AWS credential-theft cases disclosed only this week. Below are the controls we build in and how they map across AWS, Azure and Google Cloud Platform (GCP). For the platform choice itself, see our AWS vs Azure vs GCP modernization comparison.

Why is the CI/CD pipeline the weakest point in a cloud estate?

A modern pipeline can create, change and delete production infrastructure, so it holds more cloud privilege than almost any person. If its credentials are long-lived or its third-party steps aren’t pinned, one compromised dependency becomes a cloud-wide breach.

Modernization adds to this exposure in three ways:

  • More automation: Infrastructure as Code (we use Terraform) means the pipeline, not a person, applies changes to AWS accounts, Azure subscriptions and Google Cloud projects.
  • More dependencies: Every marketplace action, container base image and package registry becomes code that runs with your secrets.
  • More environments: Dev, test and prod accounts, subscriptions and projects multiply quickly. Pipelines often get one broad role that reaches all of them.

What happened to CI/CD pipelines in 2026?

Several large incidents this year targeted the build system to steal AWS, Azure and GCP credentials. None of them needed a zero-day in the cloud providers themselves.

  • trivy-action (March 2026): CrowdStrike found that 76 of the 77 release tags of the popular Trivy GitHub Action had been repointed to malicious commits (CrowdStrike). The script stole runner secrets and, on self-hosted runners, cloud credentials for AWS, Google Cloud and Azure, along with Kubernetes and infrastructure as code (IaC) secrets. CrowdStrike’s main advice was to pin actions by full commit Secure Hash Algorithm (SHA).
  • Megalodon (May 18, 2026): StepSecurity reported that attackers pushed malicious workflow files directly to the default branches of 5,561 repositories in about six hours (StepSecurity). The workflows harvested AWS keys, Azure instance credentials, GCP tokens and GitHub OIDC tokens.
  • LiteLLM on Python Package Index (PyPI) (March 2026): a backdoored release was downloaded about 47,000 times in around three hours, according to Help Net Security’s summary of Open Worldwide Application Security Project (OWASP)’s agentic security report (as cited by AI Superior).
  • AWS credential theft (reported this week): Arctic Wolf described intrusions where attackers used stolen customer credentials to make hundreds of mostly denied AWS application programming interface (API) calls. One GetSecretValue call still succeeded (The Hacker News). AWS said its services weren’t compromised. The reporting notes that Amazon Simple Storage Service (S3) object-level CloudTrail data events aren’t logged by default.

The pattern is clear. Attackers want the keys your pipeline holds, and long-lived secrets give them more time to use those keys.

“When we review a pipeline, we ask one question first: if this runner were fully compromised for an hour, what could it delete in AWS or Azure? If the answer is ‘everything in every environment,’ the modernization isn’t finished, whatever the architecture diagram says.”

iNET SYSTEMS Cloud Practice

How do you secure a CI/CD pipeline on AWS, Azure and Google Cloud? (7 controls)

Apply these seven controls in order. Federation and pinning remove most of the 2026 attack paths, and the rest limit blast radius and make detection possible. On most estates they fit into the first two sprints of a modernization program, and they are the baseline of our CI/CD automation work.

  1. Replace static keys with OIDC federation. On AWS, trust GitHub’s OIDC provider in an identity and access management (IAM) role (AWS documentation) and restrict the sub claim to specific repos, branches and environments. On Azure, use workload identity federation for GitHub Actions or Azure Pipelines service connections. On Google Cloud, use Workload Identity Federation with an attribute condition on the repository, and have it impersonate a narrowly scoped service account. Delete the old access keys, client secrets and service account key files.
  2. Pin every third-party action and image by digest. Tags can be moved, as the trivy-action incident showed, but commit SHAs and image digests can’t. Use a dependency bot to propose updates instead of floating tags.
  3. Protect branches and workflow files. Require reviews on default branches and use code owners for .github/workflows. Megalodon pushed straight to default branches, and StepSecurity calls branch protection the primary structural control (see also GitHub’s security hardening guide).
  4. Grant id-token: write only where needed. Limit OIDC token minting to deploy jobs, and keep it away from untrusted triggers such as pull_request_target.
  5. Separate deploy roles by environment. Use one role per AWS account, Azure subscription or Google Cloud project, scoped to the services that environment deploys. Production deploys should also need an environment approval.
  6. Restrict runner egress. Use deny-by-default outbound rules on self-hosted runners, or an egress-filtering agent on hosted ones. Both trivy-action and Megalodon exfiltrated over plain Hypertext Transfer Protocol Secure (HTTPS).
  7. Log and alert on the cloud side. Turn on CloudTrail data events for sensitive S3 buckets and Secrets Manager use, and enable GuardDuty. On Azure, send activity and Key Vault logs to Microsoft Sentinel. On Google Cloud, turn on Data Access audit logs for Secret Manager and Cloud Storage, since most of them are off by default, and use Security Command Center. Alert when a pipeline role is used outside its expected repo or network.

AWS vs Azure vs Google Cloud: which pipeline security controls map to which?

All three clouds support the same pattern under different names. The table below is the mapping we use when one pipeline deploys to more than one of them, a common setup for clients that pair an AWS application estate with an Azure landing zone and GCP data or artificial intelligence (AI) workloads. For the wider Google Cloud foundation, see our guide to securing enterprise cloud services on Google Cloud.

CI/CD pipeline security controls on AWS, Azure and Google Cloud
Control AWS Azure Google Cloud (GCP)
Keyless pipeline auth IAM OIDC identity provider + role trust policy Workload identity federation (Entra ID app or managed identity) Workload Identity Federation pool + service account impersonation
Scope per environment One IAM role per account; service control policies (SCPs) in AWS Organizations One federated credential per subscription; Azure Policy at management group One service account per project; Organization Policy constraints
Secret storage AWS Secrets Manager Azure Key Vault Secret Manager
Control-plane audit CloudTrail management events Azure Activity Log Cloud Audit Logs (Admin Activity, always on)
Data-access audit CloudTrail data events (not on by default for S3) Key Vault and Storage diagnostic logs Data Access audit logs (off by default for most services)
Threat detection Amazon GuardDuty Microsoft Defender for Cloud Security Command Center
Security information and event management (SIEM) Security Lake / third-party SIEM Microsoft Sentinel (can ingest all three) Google Security Operations / Sentinel
Native pipeline option AWS CodePipeline / CodeBuild Azure Pipelines (Azure DevOps) Cloud Build (+ Binary Authorization for deploy gating)

On AWS, data-event logging is the gap we find most often. In Azure estates without a landing zone, the most common gap is federated credentials scoped to a whole subscription when they should be scoped to one resource group. On Google Cloud, the usual finding is downloaded service account key files still sitting in CI secrets. The iam.disableServiceAccountKeyCreation organization policy stops new ones being created.

How do AI coding agents change pipeline risk?

AI coding agents and their tool servers are now part of the software supply chain. They can open pull requests, run commands and call cloud application programming interfaces (APIs). Treat them like any other pipeline principal, with their own identity, least privilege and review gates, as in our National Institute of Standards and Technology (NIST) Special Publication (SP) 800-53 control map for AI agents.

There’s already a public example. In July 2025, a malicious pull request added data-wiping instructions to Amazon’s Q Developer extension for VS Code, which reached close to a million installs before it was caught (TechSpot). This week, AWS fixed a server-side request forgery flaw (CVE-2026-125926) in its open-source mcp-gateway-registry (Cybersecurity News). Users with registration rights could point the gateway at internal services. If agents in your delivery process use Model Context Protocol (MCP) tools, put those servers under the same patching and egress rules as your runners.

CI/CD pipeline security checklist

  • No long-lived AWS access keys, Azure client secrets or GCP service account keys in CI/CD
  • OIDC trust restricted to named repos, branches and environments
  • All third-party actions pinned to full commit SHAs; images pinned by digest
  • Branch protection and code-owner review on workflow files
  • id-token: write limited to deploy jobs
  • Separate deploy role per account, subscription or project; prod requires approval
  • Runner egress restricted
  • CloudTrail data events, GuardDuty, Key Vault logging and GCP Data Access audit logs enabled and sent to the SIEM
  • AI agents and MCP servers in the dependency inventory and patch cycle

Find out what your pipeline could delete

Book a cloud security assessment with iNET SYSTEMS. We’ll review your AWS, Azure and GCP CI/CD pipelines, federation setup, deploy roles and logging. You’ll get a prioritized, Terraform-ready plan to bring them up to the controls above. Book your assessment.

Questions about this article

What are cloud modernization services?

Cloud modernization services move legacy applications and infrastructure onto cloud-native platforms such as containers, serverless and managed databases on AWS, Azure, Google Cloud or other clouds. They usually include re-architecture, Infrastructure as Code and CI/CD automation, plus security and governance controls so the modernized estate can be deployed and operated safely at scale.

Why is CI/CD security important in cloud modernization?

Because the pipeline holds the credentials that create, change and delete cloud resources. If a build step or dependency is compromised, attackers can take those credentials. In 2026, the Megalodon and trivy-action incidents both stole AWS, Azure and GCP credentials from CI/CD runners rather than attacking the cloud providers directly.

How do I remove static AWS keys from GitHub Actions?

Create an IAM OIDC identity provider for GitHub, then an IAM role whose trust policy allows only your specific repository, branch or environment through the token's sub claim. Use the official credentials action in the workflow to assume the role, grant id-token: write only to that job, and delete the old access keys.

What is workload identity federation in Azure?

Workload identity federation lets an external workload, such as a GitHub Actions job or an Azure Pipelines run, exchange its own OIDC token for a Microsoft Entra ID access token. You don't store a client secret. Each federated credential is bound to a specific repository, branch or environment, so tokens are short-lived and tightly scoped.

What is Workload Identity Federation on Google Cloud?

Workload Identity Federation lets a CI/CD job, such as GitHub Actions or GitLab CI, exchange its own OIDC token for short-lived Google Cloud credentials instead of using a downloaded service account key. You add an attribute condition so only named repositories or branches qualify, and the job impersonates a service account limited to that project.

Should GitHub Actions be pinned to a commit SHA?

Yes. Tags and branches are mutable pointers that a compromised maintainer account can move, as happened when 76 of 77 trivy-action tags were redirected in March 2026. A full commit SHA is fixed. Pin third-party actions to SHAs and use an automated dependency tool to review and update them.

How long does it take to secure a CI/CD pipeline during modernization?

In our experience, federation, SHA pinning, branch protection and per-environment roles fit into the first one or two sprints for a typical estate. Egress restriction and data-event logging can take longer if networking and SIEM integration aren't in place yet, so plan them alongside the landing zone work.

Related service

CI/CD Automation for Secure, Repeatable Releases

CI/CD automation for builds, tests, security scans, approvals and deployment. Create repeatable releases with documented rollback procedures.

Explore CI/CD Automation for Secure, Repeatable Releases

Further reading

Source and what it covers
What is an Azure landing zone?
Microsoft. The environment design that every Azure workload is deployed into.
Enterprise foundations blueprint
Google Cloud. Google Cloud's reference design for a secure enterprise foundation.
What is AWS Control Tower?
AWS. AWS's service for setting up and governing a multi-account environment.
What is Terraform?
HashiCorp. An infrastructure-as-code tool for defining and provisioning cloud resources.
Microsoft Cloud Adoption Framework for Azure
Microsoft. Microsoft's guidance for planning, adopting, governing and managing Azure.
Talk to us

Want help putting this to work?

We can help you turn these steps into a plan that fits your team.

New to iNET SYSTEMS? Meet our founder, see how we work, read the FAQs or start with an AI Security Readiness Assessment.

Book a 30-minute Call
Contact us