Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohamedch7/kubectl-guard
Accidentally modifying production instead of a local cluster? kubectl-guard helps prevent such critical mistakes.
https://github.com/mohamedch7/kubectl-guard
kubernetes script security
Last synced: about 2 months ago
JSON representation
Accidentally modifying production instead of a local cluster? kubectl-guard helps prevent such critical mistakes.
- Host: GitHub
- URL: https://github.com/mohamedch7/kubectl-guard
- Owner: mohamedch7
- Created: 2024-04-26T07:37:20.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T16:53:31.000Z (5 months ago)
- Last Synced: 2024-10-26T22:45:05.161Z (3 months ago)
- Topics: kubernetes, script, security
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kubectl-guard README
## How to Use:
1. **Create a File for the Script**:
- Name the file `kubectl-guard`.2. **Change File Permissions**:
- Run the command: `chmod +x kubectl-guard`.3. **Update Your Shell Configuration File (e.g., ~/.zshrc)**:
- Open `~/.zshrc` in a text editor: `vi ~/.zshrc`.4. **Add an Alias**:
- Update `~/.zshrc` with the following line:
```bash
alias kubectl='full-path-to/kubectl-guard'
```
- Replace `full-path-to` with the actual path where the `kubectl-guard` script is located.5. **Save the File**.
6. **Close the Terminal Session**:
- Close your current terminal session.7. **Start a New Terminal Session**:
- Open a new terminal window to apply the changes.## Notes:
- This is a small demo. Exercise caution when using it.
- Always ensure that the name of the production cluster contains the word 'prod' or you can change the variable `PROD_IDENTIFIER`.