Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit ae26619

Browse files
committed
add more excpetions to buildSecrets
1 parent 42a824d commit ae26619

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

pkg/worker/analyze/processors/escape.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,32 @@ func buildSecrets(vars ...string) map[string]string {
3434
}
3535
}
3636

37+
exclude := map[string]bool{
38+
"APP_NAME": true,
39+
"ADMIN_GITHUB_LOGIN": true,
40+
"GITHUB_REVIEWER_LOGIN": true,
41+
"WEB_ROOT": true,
42+
"GOROOT": true,
43+
"GOPATH": true,
44+
"FARGATE_CONTAINER": true,
45+
"PATCH_STORE_DIR": true,
46+
}
47+
3748
for _, kv := range os.Environ() {
3849
parts := strings.Split(kv, "=")
3950
if len(parts) != 2 {
4051
continue
4152
}
4253

4354
k := parts[0]
44-
if k == "APP_NAME" ||
45-
k == "ADMIN_GITHUB_LOGIN" ||
46-
k == "GITHUB_REVIEWER_LOGIN" ||
47-
k == "WEB_ROOT" ||
48-
k == "GOROOT" ||
49-
k == "GOPATH" {
50-
// not secret
55+
if exclude[k] {
5156
continue
5257
}
5358

59+
if strings.HasSuffix(k, "_OWNERS") || strings.HasSuffix(k, "_PERCENT") || strings.HasSuffix(k, "_REPOS") {
60+
continue // experiment vars
61+
}
62+
5463
v := parts[1]
5564
if len(v) >= minSecretValueLen {
5665
ret[v] = hidden

0 commit comments

Comments
 (0)