GitHub Actions
Enable just-in-time access to your targets through a Github Actions workflow
Add an authorized Github Action to your organization
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
custom-name-of-your-action:
runs-on: your-chosen-image
steps:
- run: |
export IDT=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://api.bastionzero.com" | jq -r '.value')
curl -v -H "Authorization: Bearer $IDT" https://cloud.bastionzero.com/api/v2/policies/github-expiring-policy -H "Accept: application/json;" -H "Content-Type: application/json" -d '{"subjectEmail": "[email protected]","environmentName": "Default","targetUser": {"userName": "root"},"verb": {"type": "Shell"},"clusterUser": "cluster-admin"}'Example YAML file
Last updated
