Skip to content

Report effective AppSec state in app-started telemetry - #12741

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
report-the-effective-appsec-state-in-w4pn84
Oct 19, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
report-the-effective-appsec-state-in-w4pn84

Conversation

@jandro996

@jandro996 jandro996 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What Does This Do

  • TelemetryRequest.writeProducts() reads ActiveSubsystems.APPSEC_ACTIVE for products.appsec.enabled in app-started, instead of getAppSecActivation() != FULLY_DISABLED.
  • appStartedMustIncludeActivatedProductsInfo now varies both the AppSec config and the active state, and shows that only the active state is reported (inactive + not active -> false, inactive + activated by RC -> true, enabled + startup failed -> false).
  • TelemetryServiceTest pins APPSEC_ACTIVE to false per test, and TestTelemetryRouter.products() defaults appsec to false.

Motivation

With the default DD_APPSEC_ENABLED (inactive), app-started reported appsec.enabled=true while AppSec was not active.
When remote config is enabled, AppSecSystem.setActive(false) queues an app-product-change that is sent right after app-started. But no correction is ever sent when AppSec never reaches setActive:

  • remote config disabled and DD_APPSEC_ENABLED unset (AppSec is not started at all),
  • startup aborted with AbortStartupException (e.g. user rules file fails to load),
  • reflection / class loading failure when starting AppSec.

In those cases apm_tables.asm_enabled stayed true. AppSec starts before telemetry on the same thread (Agent.InstallDatadogTracerCallback.execute), so APPSEC_ACTIVE already holds the effective state when app-started is built. This matches the .NET tracer and the Python fix (DataDog/dd-trace-py#20674).

Additional Notes

  • Behavior change: services in the default inactive mode now report appsec: false at startup until remote config activates AppSec. system-tests Test_ProductsDisabled uses DD_APPSEC_ENABLED=false and is not affected.
  • Tests: ./gradlew :telemetry:test (269 tests, 0 failures), :telemetry:spotlessCheck passes.

Contributor Checklist

Jira ticket: APPSEC-70505

@jandro996 jandro996 added comp: asm waf Application Security Management (WAF) comp: telemetry Telemetry tag: ai generated Largely based on code generated by an AI or LLM type: bug labels Oct 5, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 58.69% (-1.13%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7316f0f | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.88 s 13.91 s [-0.9%; +0.5%] (no difference)
startup:insecure-bank:tracing:Agent 12.84 s 12.92 s [-1.2%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.81 s 17.73 s [-0.7%; +1.5%] (no difference)
startup:petclinic:iast:Agent 17.48 s 17.66 s [-1.9%; -0.2%] (maybe better)
startup:petclinic:profiling:Agent 17.42 s 17.53 s [-1.8%; +0.6%] (no difference)
startup:petclinic:sca:Agent 17.76 s 17.71 s [-0.6%; +1.2%] (no difference)
startup:petclinic:tracing:Agent 16.62 s 16.80 s [-2.3%; +0.1%] (no difference)

Commit: 7316f0ff · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@jandro996
jandro996 force-pushed the report-the-effective-appsec-state-in-w4pn84 branch from d0e7445 to f52dc02 Compare October 15, 2026 14:13
@jandro996 jandro996 added type: bug fix Bug fix and removed type: bug labels Oct 15, 2026
app-started derived products.appsec.enabled from the configured activation, so the
default inactive mode reported true while AppSec was not active. When AppSec never
reaches AppSecSystem.setActive (remote config disabled, aborted startup) no
app-product-change corrects it. Read ActiveSubsystems.APPSEC_ACTIVE instead: AppSec
starts before telemetry, so the flag holds the effective state.
@jandro996
jandro996 force-pushed the report-the-effective-appsec-state-in-w4pn84 branch from a18765b to 7316f0f Compare October 16, 2026 08:10
@jandro996

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T09:55:32.709042Z 7316f0f Draft marked ready
🔒 Security Review ✅ Completed 2026-10-16T09:55:57.658303Z 7316f0f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 7316f0ffa0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 7316f0ffa0

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@jandro996
jandro996 marked this pull request as ready for review October 16, 2026 09:53
@jandro996
jandro996 requested a review from a team as a code owner October 16, 2026 09:53
@jandro996
jandro996 requested review from claponcet and dougqh and removed request for a team October 16, 2026 09:53

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Startup telemetry reflects AppSec’s effective activation state, including inactive configurations and startup failures, while preserving subsequent remote-config updates.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 7316f0f

@jandro996
jandro996 requested a review from avara1986 October 16, 2026 09:58
@jandro996
jandro996 added this pull request to the merge queue Oct 19, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-19 12:57:40 UTC ℹ️ Start processing command /merge


2026-10-19 12:57:45 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-10-19 14:01:42 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 19, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit d281b7b into master Oct 19, 2026
612 of 613 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the report-the-effective-appsec-state-in-w4pn84 branch October 19, 2026 14:01
@github-actions github-actions Bot added this to the 1.68.0 milestone Oct 19, 2026
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) comp: telemetry Telemetry tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants