-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[v1.13] bugtool: Avoid sensitive data in envoy config dump #32966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
acc0201
to
c08c3b1
Compare
/test-backport-1.13 |
c08c3b1
to
89379db
Compare
/test-backport-1.13 |
89379db
to
621417f
Compare
/test-backport-1.13 Job 'Cilium-PR-K8s-1.26-kernel-net-next' failed: Click to show.Test Name
Failure Output
Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/1375/ If it is a flake and a GitHub issue doesn't already exist to track it, comment Then please upload the Jenkins artifacts to that issue. |
/test-runtime |
I read this as the Go version being too old to use |
[upstream commit 568dbc5] This commit is to add a generic json field masking based on the field name. [ Quentin: Replaced the use of slices.Contains(), unsupported with the Go version used with v1.13. ] Signed-off-by: Tam Mach <tam.mach@cilium.io> Signed-off-by: Quentin Monnet <qmo@qmon.net>
[upstream commit 48a9976] This commit is to explicitly mask the below fields from Envoy config dump: - api_key (used in kafka L7 policy) - TLSContext (used in Cilium NetworkPolicy) One round of scanning on existing Cilium protobuf was done. Related docs: https://www.envoyproxy.io/docs/envoy/latest/operations/admin#get--config_dump Signed-off-by: Tam Mach <tam.mach@cilium.io>
621417f
to
e869c11
Compare
I added the following change to the first commit: diff --git a/bugtool/cmd/mask.go b/bugtool/cmd/mask.go
index 4a6a32961d03..77847895d503 100644
--- a/bugtool/cmd/mask.go
+++ b/bugtool/cmd/mask.go
@@ -5,7 +5,6 @@ package cmd
import (
"encoding/json"
- "slices"
)
const (
@@ -34,9 +33,18 @@ func maskFields(b []byte, fieldNames []string) ([]byte, error) {
return json.MarshalIndent(data, "", ident)
}
+func contains(names []string, name string) bool {
+ for _, n := range names {
+ if n == name {
+ return true
+ }
+ }
+ return false
+}
+
func mask(data map[string]interface{}, fieldNames []string) {
for k, v := range data {
- if slices.Contains(fieldNames, k) {
+ if contains(fieldNames, k) {
data[k] = redacted
continue
} |
/test-backport-1.13 Job 'Cilium-PR-K8s-1.21-kernel-4.19' hit: #30802 (90.53% similarity) |
/test-1.21-4.19 |
/test-1.19-4.19 |
No description provided.