https://github.com/robertpeteuil/get-creds-from-state
Script to parse credentials from the TFE state file & decode them
https://github.com/robertpeteuil/get-creds-from-state
Last synced: 6 months ago
JSON representation
Script to parse credentials from the TFE state file & decode them
- Host: GitHub
- URL: https://github.com/robertpeteuil/get-creds-from-state
- Owner: robertpeteuil
- License: mit
- Created: 2019-04-07T01:33:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T12:42:54.000Z (over 6 years ago)
- Last Synced: 2025-02-07T13:56:08.994Z (8 months ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Retrieve credentials from TFE state file for specified user
Parses a user / customer / partner credentials from the TFE state file & decodes them
- Works on Mac/Linux with either keybase & gpg
- Works for general credentials and binary distribution credentials## Install
Express install via `iac.sh` or `https://iac.sh` (my bootstrap server)
``` bash
curl iac.sh/getcreds | sh # run without '| sh' to view & verify script
```Manual Download
``` bash
curl -sL https://raw.github.com/robertpeteuil/get-creds-from-state/master/getcreds.sh > getcreds.sh
chmod +x getcreds.sh
```## Use
- Download state file locally, copy to script dir and rename to `statedata` (or similar)
- Run script with `./getcreds.sh`
- Defaults
- reads state data from file named `statedata`
- `-f` specifies alternate file
- finds credentials that match current user's name
- `-u` specifies alternate name
- Decoding with PGP keys - auto uses either `keybase` or `gpg`
- Defaults to `keybase` if both installed
- `-g` forces use of `gpg` if both installed
- Other Options:
- `-d` display encrypted data
- `-n` no decryption of data (includes `-d`)## To Test
- `gpg` outputs the text below to stderr which is filtered out
- `gpg: encrypted with 4096-bit RSA key, ID 23B2A5AB229679FA, created 2018-07-11`
- Need to determine if `keybase` output contains similar entranious text
- if present, need to add filter to remove it