https://github.com/mildronize/my-private-repo-secrets
https://github.com/mildronize/my-private-repo-secrets
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mildronize/my-private-repo-secrets
- Owner: mildronize
- License: mit
- Created: 2022-05-06T17:09:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-07T02:32:10.000Z (about 4 years ago)
- Last Synced: 2025-03-17T00:27:25.918Z (over 1 year ago)
- Language: Shell
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sops-with-azure-keyvault-secrets
For SOPS documentation: https://github.com/mildronize/actions-get-secret-sops
Supported Platform: WSL, Linux, Mac OS
## How to add secrets
1. Decrypt SOPS to plain text (**DO NOT PUSH PLAIN TEXT**)
```bash
./decrypt.sh thadaw/dev.enc.yaml > thadaw/dev.plain.yaml
```
2. Modify `thadaw/dev.plain.yaml` (**DO NOT PUSH THIS FILE**)
3. Encrypt and replace with same file
```bash
./modify_sops.sh thadaw/dev.plain.yaml thadaw/dev.enc.yaml
```
4. Commit & Push code
5. Release to Pipeline (GitHub Action)
```bash
./scripts/bump-and-tag-version.sh
```
It will tag version, for example:
```
Tag created and pushed: "0.0.1"
```
Using this version to next step
6. Go to GitHub Action Repo which using this project for downloading secrets.
```yaml
- name: Checkout Secrets
uses: actions/checkout@v3
with:
repository: mildronize/sops-with-azure-keyvault-secrets
ref: 0.0.1
token: ${{ secrets.GITHUB_TOKEN_FOR_ACCESS_PRIVATE_REPO }}
path: ./sops-with-azure-keyvault-secrets
```
## Create new Env
1. Create KeyVault and SOPS
```bash
./create-az-key-vault.sh ./thadaw/dev.config.yaml
```
2. Encrypt secret from plain text
```bash
./encrypt.sh ./thadaw/prod.config.yaml ./thadaw/prod.plain.yaml > ./thadaw/prod.enc.yaml
```
## Installation
```
brew install sops
brew install jq
brew install pwgen
```
Install SOPS on Ubuntu or WSL
```
wget https://github.com/mozilla/sops/releases/download/v3.7.2/sops_3.7.2_amd64.deb
sudo dpkg -i sops_3.7.2_amd64.deb
```