Don’t Let Your GitOps Agent Become a Backdoor: Practical Guide to Secure GitOps CD Systems

user profileexternal writer image
Security Researcher, Security Researcher

GitOps has completely changed how we manage deployments, offering speed and efficiency to our cloud environments. But are you overlooking critical security risks? Our latest research at Cycode reveals alarming security flaws of various GitOps tools that could leave your entire cluster exposed.

What’s the risk?

GitOps is a methodology where Git repositories act as the single source of truth for managing infrastructure and application deployments, typically using GitOps tools like Argo CD to automate the process. So, by nature, Argo CD or any other GitOps tool manages Kubernetes clusters and has the capability to deploy resources. If misconfigured or exposed to the public, these tools can become vulnerable and be exploited by malicious actors. Attackers could then inject malicious resources directly into the Kubernetes environment, potentially allowing them to:

  • Hijack your applications: Modify production application logic for malicious purposes by injecting harmful code into the production environment.
  • Steal sensitive data: Gain access to confidential secrets within your production environment.
  • Compromise your database: Steal sensitive client information.

How can you protect yourself?

The presentation below features Cycode’s security researchers, Oreen Livni Shein and Elad Pticha, who dive deep into these vulnerabilities and provide actionable steps to secure your GitOps pipelines.

Key takeaways from the presentation:

  • Understand the attack vectors: Learn how attackers exploit GitOps & Argo CD vulnerabilities.
  • Implement essential security measures: Discover best practices to mitigate these risks.
  • Leverage open-source tools: Explore “GitOps Security Champion”, an open-source project we released to enhance GitOps security.
  • Prioritize code security: Identify critical changes in your code to ensure you’re always delivering secure applications.

Beyond the presentation

Introducing 

  1. Check out GitOps Security Champion, a curated guide of best practices for securing GitOps technologies. This resource is designed to help organizations strengthen their GitOps implementations and address critical risks. We welcome contributions from the community to enhance this resource even further. Resources:
  2. Here are some additional best practices to consider:
    • Cluster Separation: Deploy the GitOps agent in a separate Kubernetes cluster from the one it manages to protect against application-level compromises.
    • Network Policies Enforcement: Implement network policies to restrict access to GitOps Kubernetes resources, ensuring that a CNI plugin enforces these rules correctly.
    • Branch Protection: Set up code review requirements, CI/CD checks, and restrict access to critical branches in the GitOps repository to control deployments.
    • Strict RBAC Policies: Enforce strict RBAC policies to ensure only authorized users can manage the GitOps system, granting appropriate permissions based on roles.
  1. Don’t wait for a breach to happen. Take proactive steps to secure your GitOps pipelines today. By following these best practices and leveraging the insights from our video and open-source tools, you can significantly reduce your risk and ensure the integrity of your deployments.

Want to learn more about securing your software supply chain? Visit Cycode.com for more resources and solutions.