Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching private key from static secret fails (line 2: ***: No such file or directory Error: Process completed with exit code 127.) #13

Open
brokedba opened this issue Jun 30, 2024 · 0 comments

Comments

@brokedba
Copy link

Hi there ,
I have been trying to extract a satic secret which was made of an RSA private key but my git pipeline can't seem to read it properly

Run echo ***
  echo ***
  ***
  ***
  ***
  ***
  ***
  ***
  ***
  ***
  ***
  *** | base64 -d >> rsa.pem      
  echo '***' | jq -r 'to_entries|map("JWT_\(.key)=\(.value|tostring)")|.[]' >> $GITHUB_ENV          
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    MY_RSA: ***
    MYSQL_DYNAMIC_SECRET: ***
    token: ***
***
/home/runner/work/_temp/e58e94d7-f3f9-417c-a[2](https://github.com/brokedba/Akeyless_demo/actions/runs/9731884769/job/26856886071#step:5:2)2d-937e8b10a517.sh: line 2: ***: No such file or directory
Error: Process completed with exit code 12[7](https://github.com/brokedba/Akeyless_demo/actions/runs/9731884769/job/26856886071#step:5:7).
  • It's like GitHub runner is not showing the proper format of the content even with base64 -d command.
  • You can find the workflow here :
    and here is a little snipet of the secret fetch section:
        static-secrets: |
            - name: "/MyVault/DBs/OCI_RSA"
              output-name: "MY_RSA" 
          dynamic-secrets: |
            - name: "/MyVault/DBs/MySQLDynamicSecret"
              output-name: "MYSQL_DYNAMIC_SECRET"      
         # static-secrets: '{"/MyVault/DBs/OCI_RSA":"MY_RSA"}'   
         # dynamic-secrets:'{"/MyVault/DBs/MySQLDynamicSecret":"MYSQL_DYNAMIC_SECRET"}'
      
      - name: Create PEM File & Export Dynamic Secret to Environment
        run: |
          echo ${{ steps.fetch-secrets.outputs.MY_RSA }} | base64 -d >> rsa.pem      
          echo '${{ steps.fetch-secrets.outputs.MYSQL_DYNAMIC_SECRET }}' | jq -r 'to_entries|map("JWT_\(.key)=\(.value|tostring)")|.[]' >> $GITHUB_ENV          
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant