https://github.com/perbu/kubernetes-secret-extractor
https://github.com/perbu/kubernetes-secret-extractor
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/perbu/kubernetes-secret-extractor
- Owner: perbu
- License: bsd-3-clause
- Created: 2024-01-31T09:40:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-31T09:41:45.000Z (over 2 years ago)
- Last Synced: 2025-03-13T06:44:10.393Z (over 1 year ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Kubernetes Secret Extractor
## Description
This utility processes the output of kubectl get secret -o json commands, extracting the keys from the data section, decoding them from base64, and writing the results to files. It is designed to facilitate the handling of Kubernetes secrets in a local environment.
## Build & install
Clone the Repository:
```bash
git clone https://github.com/perbu/kubernetes-secret-extractor.git
cd kubernetes-secret-extractor
go build -o k8s-secret-extractor
```
## Usage
### Basic Command:
To use the utility, pipe the output of a kubectl get secret -o json command into it:
```bash
kubectl get secret -o json | ./k8s-secret-extractor
```
### Overwriting Existing Files:
If you want to overwrite existing files with the same names as the keys in the secret, use the --overwrite flag:
```bash
kubectl get secret -o json | ./k8s-secret-extractor --overwrite
```
### Security Note
This utility writes sensitive data to files on your local filesystem. Ensure that:
- Your local environment is secure.
- Files containing sensitive data are adequately protected.
- Secrets are handled in compliance with your organization's security policies.