-
Notifications
You must be signed in to change notification settings - Fork 312
Replace secrets with onepassword in packer-build jenkinsfile #5608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace secrets with onepassword in packer-build jenkinsfile #5608
Conversation
Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
packer-build.withCredentials([AWS_ACCOUNT_PUBLIC], groovy.lang.Closure) | ||
packer-build.withAWS({role=opensearch-packer, roleAccount=AWS_ACCOUNT_PUBLIC, duration=3600, roleSessionName=jenkins-session, useNode=true}, groovy.lang.Closure) | ||
packer-build.withSecrets({secrets=[{envVar=vpc_id, secretRef=op://opensearch-infra-secrets/packer-build-ids/jenkins-agent-vpc-id}, {envVar=subnet_id, secretRef=op://opensearch-infra-secrets/packer-build-ids/jenkins-agent-subnet-id}, {envVar=sg_id, secretRef=op://opensearch-infra-secrets/packer-build-ids/jenkins-agent-sg-id}]}, groovy.lang.Closure) | ||
packer-build.writeJSON({file=./packer/substitute_jenkins-agent-al2-arm64.json, json={variables={name-base=Jenkins-Agent-AL2-X64, os-version=AL2, build-region=us-east-1, build-vpc=vpc_id_123, build-subnet=subnet_id_123, build-secgrp=sg_id_123, build-time={{isotime "2006-01-02T03-04-05Z"}}, aws_ami_region=us-east-1}}, pretty=2}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the secrets value be shown in the logging or this is just testing bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think onepassword will mask these secret env variables; secretRef
will be visible to everyone as it's directing to the specific credential.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no secret showing here?
It is just the name of the secret not the secret values.
packer-build.withCredentials([AWS_ACCOUNT_PUBLIC], groovy.lang.Closure) | ||
packer-build.withAWS({role=opensearch-packer, roleAccount=AWS_ACCOUNT_PUBLIC, duration=3600, roleSessionName=jenkins-session, useNode=true}, groovy.lang.Closure) | ||
packer-build.withSecrets({secrets=[{envVar=vpc_id, secretRef=op://opensearch-infra-secrets/packer-build-ids/jenkins-agent-vpc-id}, {envVar=subnet_id, secretRef=op://opensearch-infra-secrets/packer-build-ids/jenkins-agent-subnet-id}, {envVar=sg_id, secretRef=op://opensearch-infra-secrets/packer-build-ids/jenkins-agent-sg-id}]}, groovy.lang.Closure) | ||
packer-build.writeJSON({file=./packer/substitute_jenkins-agent-al2-arm64.json, json={variables={name-base=Jenkins-Agent-AL2-X64, os-version=AL2, build-region=us-east-1, build-vpc=vpc_id_123, build-subnet=subnet_id_123, build-secgrp=sg_id_123, build-time={{isotime "2006-01-02T03-04-05Z"}}, aws_ami_region=us-east-1}}, pretty=2}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think onepassword will mask these secret env variables; secretRef
will be visible to everyone as it's directing to the specific credential.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ Your project status has failed because the head coverage (0.00%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #5608 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Peter Zhu <[email protected]>
Description
Replace secrets with onepassword in packer-build jenkinsfile
Issues Resolved
#5535
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.