-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report telemetry metrics for Exploit Prevention (#7314)
* Report telemetry metrics for Exploit Prevention * Performance improvement * Missing test * Missing test * Performance improvement * Spotless * Performance improvement
- Loading branch information
1 parent
2e9ba7a
commit 144efa8
Showing
10 changed files
with
194 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/GatewayContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
package com.datadog.appsec.gateway; | ||
|
||
import datadog.trace.api.telemetry.RuleType; | ||
|
||
public class GatewayContext { | ||
public final boolean isTransient; | ||
public final boolean isRasp; | ||
|
||
public GatewayContext(final boolean isTransient, final boolean isRasp) { | ||
public final RuleType raspRuleType; | ||
|
||
public GatewayContext(final boolean isTransient) { | ||
this(isTransient, null); | ||
} | ||
|
||
public GatewayContext(final boolean isTransient, final RuleType raspRuleType) { | ||
this.isTransient = isTransient; | ||
this.isRasp = isRasp; | ||
this.isRasp = raspRuleType != null; | ||
this.raspRuleType = raspRuleType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
internal-api/src/main/java/datadog/trace/api/telemetry/RuleType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package datadog.trace.api.telemetry; | ||
|
||
public enum RuleType { | ||
LIF("lfi"), | ||
SQL_INJECTION("sql_injection"), | ||
SSRF("ssrf"); | ||
|
||
public final String name; | ||
private static final int numValues = RuleType.values().length; | ||
|
||
RuleType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public static int getNumValues() { | ||
return numValues; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.