Skip to content

Conversation

peterzhuamazon
Copy link
Member

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.

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})
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member Author

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})
Copy link
Member

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.

@peterzhuamazon peterzhuamazon merged commit edccdc7 into opensearch-project:main Jun 26, 2025
14 checks passed
@peterzhuamazon peterzhuamazon deleted the packer-build-op branch June 26, 2025 17:57
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in Engineering Effectiveness Board Jun 26, 2025
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (d2ac2e7) to head (ee84f10).
Report is 17 commits behind head on main.

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

rishabh6788 pushed a commit that referenced this pull request Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants