Skip to content

Conversation

@jnahuelperez
Copy link

@jnahuelperez jnahuelperez commented Dec 4, 2025

Note

Add Jenkins pipeline that tags/pushes a version and logs env/user details plus EC2 IMDSv2 metadata.

  • CI/CD:
    • Add Jenkinsfile pipeline:
      • Tags and pushes git tag from version.
      • Prints environment variables and user info.
      • Retrieves AWS EC2 IMDSv2 token and queries meta-data/identity-credentials/ec2/.

Written by Cursor Bugbot for commit 1ed2be8. This will update automatically on new commits. Configure here.

}
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Pipeline exposes environment variables and AWS credentials

This Jenkinsfile contains code that harvests sensitive information: the set command dumps all environment variables (potentially exposing secrets, API keys, and credentials), and the script accesses the EC2 metadata service at 169.254.169.254 to retrieve AWS identity credentials. Accessing /latest/meta-data/identity-credentials/ec2/ is a known technique for credential theft from cloud instances. Even if intended as an infosec test, this code exposes sensitive data in build logs and poses serious security risks if merged.

Fix in Cursor Fix in Web

sshagent(credentials: ['jenkins-github']) {
script {
sh "git tag '${version}'"
sh "git push origin '${version}'"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Undefined version variable used for git tagging

The ${version} variable is referenced in the git tag and git push commands but is never defined anywhere in the pipeline. There's no parameters block, environment block, or script variable assignment for version. This will either create a git tag with an empty/null value or cause the pipeline to fail, potentially corrupting the repository's tag history.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant