Skip to content

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

@brokedba

Description

@brokedba

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          

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions