Skip to content

Commit 07dbff2

Browse files
authored
feat: Add Go script for environment variable enumeration
Added a Go script for enumerating sensitive environment variables.
1 parent a1854e4 commit 07dbff2

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Cloud.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,35 @@ kubectl create secret <secret-name>
601601
“Generic JWT”: “[A-Za-z0-9-]{20,}\.[A-Za-z0-9-]{20,}\.[A-Za-z0-9-_]{20,}”
602602
```
603603
604+
## Go Environment Variable Enumeration
605+
606+
A sample script that enumerates environment variables. This script pairs well with the regex list provided above:
607+
608+
```go
609+
package main
610+
611+
import (
612+
"fmt"
613+
"os"
614+
"strings"
615+
)
616+
617+
func main() {
618+
sensitiveKeywords := []string{"password", "secret", "key", "token", "api", "auth", "credential"}
619+
620+
envVars := os.Environ()
621+
for _, e := range envVars {
622+
envLower := strings.ToLower(e)
623+
for _, keyword := range sensitiveKeywords {
624+
if strings.Contains(envLower, keyword) {
625+
fmt.Printf("SENSITIVE: %s\n", e)
626+
break
627+
}
628+
}
629+
}
630+
}
631+
```
632+
604633
## Jira
605634

606635
### Privileges

0 commit comments

Comments
 (0)