The PPE vector exploits permissions within a source code repository to trigger the execution of malicious commands in a build and test pipeline. Harness CI offers multiple features to help secure your build and test pipelines against PPE attacks.
Poisoned Pipeline Execution (PPE) is one of the exploits outlined in the Top 10 CI/CD Security Risks from the Open Worldwide Application Security Project (OWASP). The PPE vector exploits permissions within a source code repository to trigger the execution of malicious commands in a build and test pipeline.
In this blog post, you will learn the different types of PPE attacks, and how to minimize or eliminate the threat to your automation pipelines.
Users who can alter configuration files or other files that the pipeline relies on can inject malicious commands into these files, thereby "poisoning" the pipeline and causing it to execute the harmful instructions. Pipelines that execute unreviewed code, such as those triggered directly by pull requests or commits to arbitrary repository branches, are more vulnerable to PPE.
Once an attacker can execute malicious code in your pipeline, any sensitive data or endpoints accessible to the pipeline could be at risk:
The three types of PPE attacks are Direct, Indirect, and Public.
In a Direct PPE scenario, an attacker modifies the pipeline configuration file in a repository they have access to by either pushing changes to an unprotected branch or submitting a pull request from a branch or fork. These events trigger the pipeline, causing the malicious commands defined in the modified configuration file to execute in the build environment.
Indirect PPE happens when the attacker cannot modify the pipeline configuration file as with Direct PPE.
In these cases, the attacker can still compromise the pipeline by inserting malicious code into files referenced by the pipeline configuration file. This includes scripts called within the configuration file, code tests, or automated tools like linters and security scanners used in the pipeline.
An Indirect PPE vulnerability was exposed in the CodeBuild pipeline of a website belonging to AWS. Anonymous attackers were able to modify a script executed by the build configuration file with the creation of a pull request, resulting in the compromise of deployment credentials.
Public PPE is an attack in which anonymous internet users exploit public repositories by submitting pull requests. If the CI pipeline runs this unreviewed code, it becomes vulnerable. If the same CI instance is used for public and private repositories, this can also expose internal assets, like secrets from private projects.
Take these steps to protect against PPE attacks:
Harness CI offers multiple features to help secure your build and test pipelines against PPE attacks.