Skip to content

Commit b6e28d6

Browse files
fix: OB-37389 Obfuscate secrets in YAML body (#101)
Add whole processor framework to modify an event body in place. The set of actions that do that are also type-specific, meaning that we only run relevant actions on any given event, based on the object type. These actions modify the unmarshalled object IN PLACE and BEFORE the attributes-computing actions do their thing. This is mainly to allow secrets' obfuscation, where we want to prevent secret stuff to end up in the attributes by mistake. Add secret "body" actions that obfuscate the secrets in "data". ### Description OB-XXX Please explain the changes you made here. ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
1 parent b1f3be5 commit b6e28d6

20 files changed

+198
-19
lines changed

components/processors/observek8sattributesprocessor/configmapactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func TestConfigMapActions(t *testing.T) {
1212
},
1313
},
1414
} {
15-
runTest(t, testCase)
15+
runTest(t, testCase, LogLocationAttributes)
1616
}
1717
}

components/processors/observek8sattributesprocessor/cronjobactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ func TestCronJobActions(t *testing.T) {
1919
},
2020
},
2121
} {
22-
runTest(t, testCase)
22+
runTest(t, testCase, LogLocationAttributes)
2323
}
2424
}

components/processors/observek8sattributesprocessor/daemonsetactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func TestDaemonSetActions(t *testing.T) {
1212
},
1313
},
1414
} {
15-
runTest(t, testCase)
15+
runTest(t, testCase, LogLocationAttributes)
1616
}
1717
}

components/processors/observek8sattributesprocessor/deploymentactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func TestDeploymentActions(t *testing.T) {
1212
},
1313
},
1414
} {
15-
runTest(t, testCase)
15+
runTest(t, testCase, LogLocationAttributes)
1616
}
1717
}

components/processors/observek8sattributesprocessor/endpointsactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func TestEndpointsActions(t *testing.T) {
1212
},
1313
},
1414
} {
15-
runTest(t, testCase)
15+
runTest(t, testCase, LogLocationAttributes)
1616
}
1717
}

components/processors/observek8sattributesprocessor/ingressactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ func TestIngressActions(t *testing.T) {
1919
},
2020
},
2121
} {
22-
runTest(t, testCase)
22+
runTest(t, testCase, LogLocationAttributes)
2323
}
2424
}

components/processors/observek8sattributesprocessor/jobactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ func TestJobActions(t *testing.T) {
3333
},
3434
},
3535
} {
36-
runTest(t, testCase)
36+
runTest(t, testCase, LogLocationAttributes)
3737
}
3838
}

components/processors/observek8sattributesprocessor/nodeactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestNodeActions(t *testing.T) {
6262
},
6363
},
6464
} {
65-
runTest(t, testCase)
65+
runTest(t, testCase, LogLocationAttributes)
6666
}
6767

6868
}

components/processors/observek8sattributesprocessor/persistentvolumeactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ func TestPersistentVolumeActions(t *testing.T) {
1919
},
2020
},
2121
} {
22-
runTest(t, testCase)
22+
runTest(t, testCase, LogLocationAttributes)
2323
}
2424
}

components/processors/observek8sattributesprocessor/persistentvolumeclaimactions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func TestPersistentVolumeClaimActions(t *testing.T) {
1212
},
1313
},
1414
} {
15-
runTest(t, testCase)
15+
runTest(t, testCase, LogLocationAttributes)
1616
}
1717
}

0 commit comments

Comments
 (0)