Skip to content

Commit 5ef7a94

Browse files
authored
[CWS] Remove applied status in network isolation (#45275)
### What does this PR do? Replace `applied` status in network isolation by `performed` so the status are the same between kill and isolation actions. Now, the status for an isolation actions are : - performed - error Co-authored-by: theo.putegnat <theo.putegnat@datadoghq.com>
1 parent 6577ac0 commit 5ef7a94

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/security/probe/actions_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ type RawPacketActionReport struct {
111111
type RawPacketActionStatus string
112112

113113
const (
114-
RawPacketActionStatusApplied RawPacketActionStatus = "applied"
115-
RawPacketActionStatusError RawPacketActionStatus = "error"
114+
RawPacketActionStatusPerformed RawPacketActionStatus = "performed"
115+
RawPacketActionStatusError RawPacketActionStatus = "error"
116116
)
117117

118118
// IsResolved return if the action is resolved

pkg/security/probe/probe_ebpf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3453,7 +3453,7 @@ func (p *EBPFProbe) HandleActions(ctx *eval.Context, rule *rules.Rule) {
34533453
seclog.Errorf("failed to setup raw packet action programs: %s", err)
34543454
reportStatus = RawPacketActionStatusError
34553455
} else {
3456-
reportStatus = RawPacketActionStatusApplied
3456+
reportStatus = RawPacketActionStatusPerformed
34573457
}
34583458
}
34593459

pkg/security/tests/network_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func TestRawPacketAction(t *testing.T) {
267267
if el, err := jsonpath.JsonPathLookup(obj, `$.agent.rule_actions[?(@.filter == 'port 53')]`); err != nil || el == nil || len(el.([]interface{})) == 0 {
268268
t.Errorf("element not found %s => %v", string(msg.Data), err)
269269
}
270-
if el, err := jsonpath.JsonPathLookup(obj, `$.agent.rule_actions[?(@.status == 'applied')]`); err != nil || el == nil || len(el.([]interface{})) == 0 {
270+
if el, err := jsonpath.JsonPathLookup(obj, `$.agent.rule_actions[?(@.status == 'performed')]`); err != nil || el == nil || len(el.([]interface{})) == 0 {
271271
t.Errorf("element not found %s => %v", string(msg.Data), err)
272272
}
273273

0 commit comments

Comments
 (0)