Skip to content

Commit

Permalink
Merge pull request #188 from step-security/varunsh-coder-patch-2
Browse files Browse the repository at this point in the history
Create secret-in-build-log.yml
  • Loading branch information
varunsh-coder authored Jul 24, 2024
2 parents 1a80023 + 03bf98c commit 9010da0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/secret-in-build-log.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Secret in Build Log

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: harden-runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Extract and use GCP private key
env:
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
run: |
# Extracting the private key from the GCP service account key
PRIVATE_KEY=$(echo $GCP_SERVICE_ACCOUNT_KEY | jq -r '.private_key')
# Simulate using the private key
echo "Using the private key for some operation"
# Log the private key (simulating a mistake)
echo "GCP Private Key: $PRIVATE_KEY"
- name: Run a script
run: |
sleep 2

0 comments on commit 9010da0

Please sign in to comment.