Skip to content

Commit c9a1f2f

Browse files
committed
auth pipelines: fully qualify GCS metadata server name
Builds that use the auth pipelines are failing in QEMU because the google metadata server cannot be resolved; e.g. with the auth/github pipeline: running step "auth/github" Using OctoSTS to get a token for chainguard-dev/iamguarded-tools as elastic-build curl: (6) Could not resolve host: metadata This is likely because the QEMU guest in melange is not getting the google.internal domain to search by default set in its resolv.conf Signed-off-by: Steve Beattie <steve.beattie@chainguard.dev> Ref: chainguard-dev/prodsec#271
1 parent fd8cff7 commit c9a1f2f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pipelines/auth/github.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pipeline:
3232
ghtoken=$(cat .github-token)
3333
else
3434
echo "Using OctoSTS to get a token for ${{inputs.repo}} as ${{inputs.identity}}"
35-
idtoken=$(curl --fail-with-body -sSL -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/service-accounts/default/identity?audience=octo-sts.dev)
35+
idtoken=$(curl --fail-with-body -sSL -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=octo-sts.dev)
3636
ghtoken=$(curl --fail-with-body -sSL -H "Authorization: Bearer ${idtoken}" "https://octo-sts.dev/sts/exchange?scope=${{inputs.repo}}&identity=${{inputs.identity}}" | jq -r .token)
3737
fi
3838

pipelines/auth/gradle.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pipeline:
2424
if [ -f /var/cache/melange/.libraries_token.txt ]; then
2525
cgtoken=$(cat /var/cache/melange/.libraries_token.txt)
2626
else
27-
idtoken=$(curl --fail-with-body -sSL -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/service-accounts/default/identity?audience=issuer.enforce.dev)
27+
idtoken=$(curl --fail-with-body -sSL -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=issuer.enforce.dev)
2828
cgtoken=$(curl --fail-with-body -sSL -H "Authorization: Bearer ${idtoken}" 'https://issuer.enforce.dev/sts/exchange?aud=libraries.cgr.dev&scope=${{inputs.group}}&identity=${{inputs.identity}}' | jq -r '.token')
2929
fi
3030

pipelines/auth/maven.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pipeline:
2424
if [ -f /var/cache/melange/.libraries_token.txt ]; then
2525
cgtoken=$(cat /var/cache/melange/.libraries_token.txt)
2626
else
27-
idtoken=$(curl --fail-with-body -sSL -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/service-accounts/default/identity?audience=issuer.enforce.dev)
27+
idtoken=$(curl --fail-with-body -sSL -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=issuer.enforce.dev)
2828
cgtoken=$(curl --fail-with-body -sSL -H "Authorization: Bearer ${idtoken}" 'https://issuer.enforce.dev/sts/exchange?aud=libraries.cgr.dev&scope=${{inputs.group}}&identity=${{inputs.identity}}' | jq -r '.token')
2929
fi
3030

0 commit comments

Comments
 (0)