Skip to content

Commit 5ad682b

Browse files
Add missing address for signup event (#8469)
1 parent 47c4eb3 commit 5ad682b

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

dd-java-agent/appsec/src/main/java/com/datadog/appsec/event/data/KnownAddresses.java

+5
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ public interface KnownAddresses {
133133
/** Login success business event */
134134
Address<String> LOGIN_SUCCESS = new Address<>("server.business_logic.users.login.success");
135135

136+
/** Signup business event */
137+
Address<String> SIGN_UP = new Address<>("server.business_logic.users.signup");
138+
136139
/** The Exec command being executed */
137140
Address<String> EXEC_CMD = new Address<>("server.sys.exec.cmd");
138141

@@ -215,6 +218,8 @@ static Address<?> forName(String name) {
215218
return LOGIN_SUCCESS;
216219
case "server.business_logic.users.login.failure":
217220
return LOGIN_FAILURE;
221+
case "server.business_logic.users.signup":
222+
return SIGN_UP;
218223
case "server.sys.exec.cmd":
219224
return EXEC_CMD;
220225
case "server.sys.shell.cmd":

dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/GatewayBridge.java

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class GatewayBridge {
7777
static {
7878
EVENT_MAPPINGS.put(LoginEvent.LOGIN_SUCCESS, KnownAddresses.LOGIN_SUCCESS);
7979
EVENT_MAPPINGS.put(LoginEvent.LOGIN_FAILURE, KnownAddresses.LOGIN_FAILURE);
80+
EVENT_MAPPINGS.put(LoginEvent.SIGN_UP, KnownAddresses.SIGN_UP);
8081
}
8182

8283
private static final String METASTRUCT_EXPLOIT = "exploit";

dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/event/data/KnownAddressesSpecification.groovy

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class KnownAddressesSpecification extends Specification {
4040
'usr.session_id',
4141
'server.business_logic.users.login.failure',
4242
'server.business_logic.users.login.success',
43+
'server.business_logic.users.signup',
4344
'server.io.net.url',
4445
'server.io.fs.file',
4546
'server.sys.exec.cmd',
@@ -50,7 +51,7 @@ class KnownAddressesSpecification extends Specification {
5051

5152
void 'number of known addresses is expected number'() {
5253
expect:
53-
Address.instanceCount() == 38
54+
Address.instanceCount() == 39
5455
KnownAddresses.WAF_CONTEXT_PROCESSOR.serial == Address.instanceCount() - 1
5556
}
5657
}

dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/gateway/GatewayBridgeSpecification.groovy

+1
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@ class GatewayBridgeSpecification extends DDSpecification {
10821082
then:
10831083
1 * eventDispatcher.publishDataEvent(nonEmptyDsInfo, ctx.data, _ as DataBundle, _ as GatewayContext) >> { a, b, DataBundle db, GatewayContext gw ->
10841084
assert db.get(KnownAddresses.USER_LOGIN) == USER_ID
1085+
assert db.get(KnownAddresses.SIGN_UP) != null
10851086
assert !gw.isTransient
10861087
return NoopFlow.INSTANCE
10871088
}

0 commit comments

Comments
 (0)