Skip to content
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

Update user lifecycle tracking to V3 #8108

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

manuel-alvarez-alvarez
Copy link
Member

@manuel-alvarez-alvarez manuel-alvarez-alvarez commented Dec 18, 2024

What Does This Do

This pull request updates the user lifecycle tracking logic to align with the latest specifications. The key changes include:

  1. Refactored Business Logic: Consolidated all handling of trace tags and WAF (Web Application Firewall) interactions within the com.datadog.appsec.gateway.GatewayBridge. This centralization enhances maintainability and clarity.

  2. New Address for User Login Property: Introduced a new address dedicated to the usr.login property.

  3. Renamed Telemetry Metric: The metric previously named instrum.user_auth.missing_user_id has been renamed to instrum.user_auth.missing_user_login. Additionally, two new tags have been integrated: one for the framework and another for the event type, providing more granular telemetry data.

Motivation

This pull request is driven by the need to implement changes based on a newly issued RFC that consolidates all previous specifications. The RFC introduces several minor modifications, including a crucial distinction between user IDs and user logins. By adhering to this updated specification, we aim to enhance our system's accuracy and consistency in tracking user lifecycle events.

Additional Notes

Contributor Checklist

Jira ticket: APPSEC-55579
RFC: Automated user lifecycle tracking

@manuel-alvarez-alvarez manuel-alvarez-alvarez added the comp: asm waf Application Security Management (WAF) label Dec 18, 2024
@pr-commenter
Copy link

pr-commenter bot commented Dec 18, 2024

Benchmarks

Startup

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-12-20T10:44:57 2024-12-20T10:51:54
git_branch master malvarez/waf-ato-v3
git_commit_date 1734688094 1734690751
git_commit_sha ab205f6 f3a9382
release_version 1.45.0-SNAPSHOT~ab205f6a56 1.45.0-SNAPSHOT~f3a938277a
start_time 2024-12-20T10:44:44 2024-12-20T10:51:41
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1734692267 1734692267
ci_job_id 746831286 746831286
ci_pipeline_id 51644495 51644495
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics.

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~f3a938277a, baseline=1.45.0-SNAPSHOT~ab205f6a56
    dateFormat X
    axisFormat %s
section baseline
no_agent (375.019 µs) : 355, 395
.   : milestone, 375,
iast (489.899 µs) : 468, 511
.   : milestone, 490,
iast_FULL (643.73 µs) : 622, 665
.   : milestone, 644,
iast_GLOBAL (511.959 µs) : 491, 533
.   : milestone, 512,
iast_HARDCODED_SECRET_DISABLED (485.837 µs) : 464, 507
.   : milestone, 486,
iast_INACTIVE (445.538 µs) : 425, 466
.   : milestone, 446,
iast_TELEMETRY_OFF (480.853 µs) : 459, 503
.   : milestone, 481,
tracing (453.911 µs) : 432, 475
.   : milestone, 454,
section candidate
no_agent (370.057 µs) : 350, 390
.   : milestone, 370,
iast (483.614 µs) : 462, 505
.   : milestone, 484,
iast_FULL (652.519 µs) : 631, 674
.   : milestone, 653,
iast_GLOBAL (506.762 µs) : 486, 528
.   : milestone, 507,
iast_HARDCODED_SECRET_DISABLED (485.812 µs) : 464, 507
.   : milestone, 486,
iast_INACTIVE (449.882 µs) : 428, 471
.   : milestone, 450,
iast_TELEMETRY_OFF (481.205 µs) : 460, 503
.   : milestone, 481,
tracing (446.113 µs) : 425, 468
.   : milestone, 446,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 375.019 µs [355.355 µs, 394.683 µs] -
iast 489.899 µs [468.314 µs, 511.484 µs] 114.88 µs (30.6%)
iast_FULL 643.73 µs [622.174 µs, 665.286 µs] 268.711 µs (71.7%)
iast_GLOBAL 511.959 µs [490.603 µs, 533.315 µs] 136.94 µs (36.5%)
iast_HARDCODED_SECRET_DISABLED 485.837 µs [464.495 µs, 507.178 µs] 110.818 µs (29.5%)
iast_INACTIVE 445.538 µs [424.751 µs, 466.325 µs] 70.519 µs (18.8%)
iast_TELEMETRY_OFF 480.853 µs [459.195 µs, 502.51 µs] 105.834 µs (28.2%)
tracing 453.911 µs [432.432 µs, 475.391 µs] 78.892 µs (21.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 370.057 µs [350.113 µs, 390.001 µs] -
iast 483.614 µs [462.185 µs, 505.042 µs] 113.557 µs (30.7%)
iast_FULL 652.519 µs [631.07 µs, 673.969 µs] 282.462 µs (76.3%)
iast_GLOBAL 506.762 µs [485.582 µs, 527.941 µs] 136.705 µs (36.9%)
iast_HARDCODED_SECRET_DISABLED 485.812 µs [464.264 µs, 507.36 µs] 115.755 µs (31.3%)
iast_INACTIVE 449.882 µs [428.384 µs, 471.38 µs] 79.825 µs (21.6%)
iast_TELEMETRY_OFF 481.205 µs [459.575 µs, 502.835 µs] 111.148 µs (30.0%)
tracing 446.113 µs [424.583 µs, 467.642 µs] 76.056 µs (20.6%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~f3a938277a, baseline=1.45.0-SNAPSHOT~ab205f6a56
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.354 ms) : 1334, 1374
.   : milestone, 1354,
appsec (1.732 ms) : 1709, 1756
.   : milestone, 1732,
appsec_no_iast (1.743 ms) : 1719, 1768
.   : milestone, 1743,
iast (1.493 ms) : 1470, 1516
.   : milestone, 1493,
profiling (1.531 ms) : 1505, 1556
.   : milestone, 1531,
tracing (1.493 ms) : 1465, 1521
.   : milestone, 1493,
section candidate
no_agent (1.348 ms) : 1328, 1367
.   : milestone, 1348,
appsec (1.731 ms) : 1707, 1754
.   : milestone, 1731,
appsec_no_iast (1.755 ms) : 1731, 1779
.   : milestone, 1755,
iast (1.499 ms) : 1477, 1521
.   : milestone, 1499,
profiling (1.551 ms) : 1526, 1577
.   : milestone, 1551,
tracing (1.485 ms) : 1461, 1509
.   : milestone, 1485,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.354 ms [1.334 ms, 1.374 ms] -
appsec 1.732 ms [1.709 ms, 1.756 ms] 377.991 µs (27.9%)
appsec_no_iast 1.743 ms [1.719 ms, 1.768 ms] 388.7 µs (28.7%)
iast 1.493 ms [1.47 ms, 1.516 ms] 138.536 µs (10.2%)
profiling 1.531 ms [1.505 ms, 1.556 ms] 176.34 µs (13.0%)
tracing 1.493 ms [1.465 ms, 1.521 ms] 138.339 µs (10.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.348 ms [1.328 ms, 1.367 ms] -
appsec 1.731 ms [1.707 ms, 1.754 ms] 383.037 µs (28.4%)
appsec_no_iast 1.755 ms [1.731 ms, 1.779 ms] 407.792 µs (30.3%)
iast 1.499 ms [1.477 ms, 1.521 ms] 151.598 µs (11.2%)
profiling 1.551 ms [1.526 ms, 1.577 ms] 203.898 µs (15.1%)
tracing 1.485 ms [1.461 ms, 1.509 ms] 137.363 µs (10.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master malvarez/waf-ato-v3
git_commit_date 1734688094 1734690751
git_commit_sha ab205f6 f3a9382
release_version 1.45.0-SNAPSHOT~ab205f6a56 1.45.0-SNAPSHOT~f3a938277a
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1734692991 1734692991
ci_job_id 746831287 746831287
ci_pipeline_id 51644495 51644495
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~f3a938277a, baseline=1.45.0-SNAPSHOT~ab205f6a56
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.234 s) : 15234000, 15234000
.   : milestone, 15234000,
appsec (15.061 s) : 15061000, 15061000
.   : milestone, 15061000,
iast (18.904 s) : 18904000, 18904000
.   : milestone, 18904000,
iast_GLOBAL (17.885 s) : 17885000, 17885000
.   : milestone, 17885000,
profiling (14.736 s) : 14736000, 14736000
.   : milestone, 14736000,
tracing (15.066 s) : 15066000, 15066000
.   : milestone, 15066000,
section candidate
no_agent (15.625 s) : 15625000, 15625000
.   : milestone, 15625000,
appsec (14.57 s) : 14570000, 14570000
.   : milestone, 14570000,
iast (19.062 s) : 19062000, 19062000
.   : milestone, 19062000,
iast_GLOBAL (17.774 s) : 17774000, 17774000
.   : milestone, 17774000,
profiling (15.302 s) : 15302000, 15302000
.   : milestone, 15302000,
tracing (14.869 s) : 14869000, 14869000
.   : milestone, 14869000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.234 s [15.234 s, 15.234 s] -
appsec 15.061 s [15.061 s, 15.061 s] -173.0 ms (-1.1%)
iast 18.904 s [18.904 s, 18.904 s] 3.67 s (24.1%)
iast_GLOBAL 17.885 s [17.885 s, 17.885 s] 2.651 s (17.4%)
profiling 14.736 s [14.736 s, 14.736 s] -498.0 ms (-3.3%)
tracing 15.066 s [15.066 s, 15.066 s] -168.0 ms (-1.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.625 s [15.625 s, 15.625 s] -
appsec 14.57 s [14.57 s, 14.57 s] -1.055 s (-6.8%)
iast 19.062 s [19.062 s, 19.062 s] 3.437 s (22.0%)
iast_GLOBAL 17.774 s [17.774 s, 17.774 s] 2.149 s (13.8%)
profiling 15.302 s [15.302 s, 15.302 s] -323.0 ms (-2.1%)
tracing 14.869 s [14.869 s, 14.869 s] -756.0 ms (-4.8%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~f3a938277a, baseline=1.45.0-SNAPSHOT~ab205f6a56
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.467 ms) : 1455, 1478
.   : milestone, 1467,
appsec (2.327 ms) : 2286, 2368
.   : milestone, 2327,
iast (2.075 ms) : 2023, 2128
.   : milestone, 2075,
iast_GLOBAL (2.122 ms) : 2069, 2175
.   : milestone, 2122,
profiling (1.969 ms) : 1926, 2012
.   : milestone, 1969,
tracing (1.929 ms) : 1889, 1970
.   : milestone, 1929,
section candidate
no_agent (1.468 ms) : 1456, 1479
.   : milestone, 1468,
appsec (2.333 ms) : 2291, 2374
.   : milestone, 2333,
iast (2.077 ms) : 2025, 2130
.   : milestone, 2077,
iast_GLOBAL (2.122 ms) : 2069, 2175
.   : milestone, 2122,
profiling (1.957 ms) : 1915, 1999
.   : milestone, 1957,
tracing (1.925 ms) : 1885, 1965
.   : milestone, 1925,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.455 ms, 1.478 ms] -
appsec 2.327 ms [2.286 ms, 2.368 ms] 859.889 µs (58.6%)
iast 2.075 ms [2.023 ms, 2.128 ms] 608.412 µs (41.5%)
iast_GLOBAL 2.122 ms [2.069 ms, 2.175 ms] 654.991 µs (44.7%)
profiling 1.969 ms [1.926 ms, 2.012 ms] 502.148 µs (34.2%)
tracing 1.929 ms [1.889 ms, 1.97 ms] 462.394 µs (31.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.468 ms [1.456 ms, 1.479 ms] -
appsec 2.333 ms [2.291 ms, 2.374 ms] 865.013 µs (58.9%)
iast 2.077 ms [2.025 ms, 2.13 ms] 609.957 µs (41.6%)
iast_GLOBAL 2.122 ms [2.069 ms, 2.175 ms] 654.267 µs (44.6%)
profiling 1.957 ms [1.915 ms, 1.999 ms] 489.316 µs (33.3%)
tracing 1.925 ms [1.885 ms, 1.965 ms] 457.445 µs (31.2%)

Copy link
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: asm waf Application Security Management (WAF)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants