SECRET.*PASSW.*D.*VERSION: "password", generated using pwqgen
SECRET.*KEY.*VERSION: "key", generated using pwgen
can specify # length=30 on the end of it to get a length injected
Working on https://git.autonomic.zone/coop-cloud/abra/issues/32#issuecomment-1828.
Rules are:
- `SECRET.*PASSW.*D.*VERSION`: "password", generated using `pwqgen`
- `SECRET.*KEY.*VERSION`: "key", generated using `pwgen`
- can specify `# length=30` on the end of it to get a length injected
Instead of the lolz `PASSW.*D` hack, I'm gonna include the rewrite of env vars under https://git.autonomic.zone/coop-cloud/gardening/issues/1 along with this PR so we can go on with a cleaner slate.
Then I will just grep for PASSWORD/KEY to determine pwgen/pwqgen` use.
Sorry for the nightmarish regex but I couldn't figure it out any simpler.
New parsing logic seems to be working. For passwords:
```
➜ ~ SECRET="SECRET_DB_PASSWORD_VERSION=v1 # length=15"
➜ ~ LENGTH=$(echo $SECRET | sed -e 's/.*[^0-9]([0-9]+)[^0-9]*$/1/')
➜ ~ SECRET=${SECRET%_VERSION=*}
➜ ~ SECRET=${SECRET#SECRET_}
➜ ~ echo $SECRET $LENGTH
DB_PASSWORD 15
```
And keys with same logic:
```
➜ ~ SECRET="SECRET_DB_KEY_VERSION=v1 # length=60"
➜ ~ LENGTH=$(echo $SECRET | sed -e 's/.*[^0-9]([0-9]+)[^0-9]*$/1/')
➜ ~ SECRET=${SECRET%_VERSION=*}
➜ ~ SECRET=${SECRET#SECRET_}
➜ ~ echo $SECRET $LENGTH
DB_KEY 60
```
Then I will just `grep` for `PASSWORD/KEY` to determine `pwgen/`pwqgen` use.
Sorry for the nightmarish regex but I couldn't figure it out any simpler.
decentral1se
changed title from WIP: Use new PASSWORD/KEY distinction+match for secret generation to PASSWORD/KEY distinction+match for secret generation2020-11-05 14:57:00 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Working on https://git.autonomic.zone/coop-cloud/abra/issues/32#issuecomment-1828.
Rules are:
SECRET.*PASSW.*D.*VERSION: "password", generated usingpwqgenSECRET.*KEY.*VERSION: "key", generated usingpwgen# length=30on the end of it to get a length injectedInstead of the lolz
PASSW.*Dhack, I'm gonna include the rewrite of env vars under https://git.autonomic.zone/coop-cloud/gardening/issues/1 along with this PR so we can go on with a cleaner slate.New parsing logic seems to be working. For passwords:
And keys with same logic:
Then I will just
grepforPASSWORD/KEYto determinepwgen/pwqgen` use.Sorry for the nightmarish regex but I couldn't figure it out any simpler.
WIP: Use new PASSWORD/KEY distinction+match for secret generationto PASSWORD/KEY distinction+match for secret generation