Skip to content

Commit c630fbb

Browse files
chore(asm): remove deprecated env var (#12120)
remove deprecated env var DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING for 3.0 release. ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 8a5477a commit c630fbb

File tree

4 files changed

+5
-38
lines changed

4 files changed

+5
-38
lines changed

ddtrace/appsec/_constants.py

-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ class APPSEC(metaclass=Constant_Class):
9292
] = "_dd.appsec.events.users.login.failure.auto.mode"
9393
BLOCKED: Literal["appsec.blocked"] = "appsec.blocked"
9494
EVENT: Literal["appsec.event"] = "appsec.event"
95-
AUTOMATIC_USER_EVENTS_TRACKING: Literal[
96-
"DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING"
97-
] = "DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING"
9895
AUTO_USER_INSTRUMENTATION_MODE: Literal[
9996
"DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE"
10097
] = "DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE"

ddtrace/settings/asm.py

-34
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
from ddtrace.appsec._constants import LOGIN_EVENTS_MODE
1717
from ddtrace.appsec._constants import TELEMETRY_INFORMATION_NAME
1818
from ddtrace.constants import APPSEC_ENV
19-
from ddtrace.internal.utils.deprecations import DDTraceDeprecationWarning
2019
from ddtrace.settings._core import report_telemetry as _report_telemetry
21-
from ddtrace.vendor.debtcollector import deprecate
2220

2321

2422
def _validate_non_negative_int(r: int) -> None:
@@ -75,34 +73,6 @@ class ASMConfig(Env):
7573
_appsec_standalone_enabled = Env.var(bool, APPSEC.STANDALONE_ENV, default=False)
7674
_use_metastruct_for_triggers = True
7775

78-
_automatic_login_events_mode = Env.var(str, APPSEC.AUTOMATIC_USER_EVENTS_TRACKING, default="", parser=str.lower)
79-
# Deprecation phase, to be removed in ddtrace 3.0.0
80-
if _automatic_login_events_mode is not None:
81-
if _automatic_login_events_mode == "extended":
82-
deprecate(
83-
"Using DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING=extended is deprecated",
84-
message="Please use 'DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE=identification instead",
85-
removal_version="3.0.0",
86-
category=DDTraceDeprecationWarning,
87-
)
88-
_automatic_login_events_mode = LOGIN_EVENTS_MODE.IDENT
89-
elif _automatic_login_events_mode == "safe":
90-
deprecate(
91-
"Using DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING=safe is deprecated",
92-
message="Please use 'DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE=anonymisation instead",
93-
removal_version="3.0.0",
94-
category=DDTraceDeprecationWarning,
95-
)
96-
_automatic_login_events_mode = LOGIN_EVENTS_MODE.ANON
97-
elif _automatic_login_events_mode == "disabled":
98-
deprecate(
99-
"Using DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING=disabled is deprecated",
100-
message="Please use 'DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE=disabled"
101-
" instead or DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING_ENABLED=false"
102-
" to disable the feature and bypass Remote Config",
103-
removal_version="3.0.0",
104-
category=DDTraceDeprecationWarning,
105-
)
10676
_auto_user_instrumentation_local_mode = Env.var(
10777
str,
10878
APPSEC.AUTO_USER_INSTRUMENTATION_MODE,
@@ -209,7 +179,6 @@ class ASMConfig(Env):
209179
"_iast_telemetry_report_lvl",
210180
"_ep_enabled",
211181
"_use_metastruct_for_triggers",
212-
"_automatic_login_events_mode",
213182
"_auto_user_instrumentation_local_mode",
214183
"_auto_user_instrumentation_rc_mode",
215184
"_auto_user_instrumentation_enabled",
@@ -250,9 +219,6 @@ def __init__(self):
250219
super().__init__()
251220
# Is one click available?
252221
self._eval_asm_can_be_enabled()
253-
# Only for deprecation phase
254-
if self._automatic_login_events_mode and APPSEC.AUTO_USER_INSTRUMENTATION_MODE not in os.environ:
255-
self._auto_user_instrumentation_local_mode = self._automatic_login_events_mode
256222
if not self._asm_libddwaf_available:
257223
self._asm_enabled = False
258224
self._asm_can_be_enabled = False
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
deprecations:
3+
- |
4+
ASM: deprecated env var DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING is now removed.
5+
Please use the new env var DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE instead.

tests/telemetry/test_writer.py

-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ def test_app_started_event_configuration_override(test_agent_session, run_python
291291
{"name": "DD_API_SECURITY_ENABLED", "origin": "default", "value": True},
292292
{"name": "DD_API_SECURITY_PARSE_RESPONSE_BODY", "origin": "default", "value": True},
293293
{"name": "DD_API_SECURITY_SAMPLE_DELAY", "origin": "default", "value": 30.0},
294-
{"name": "DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING", "origin": "default", "value": ""},
295294
{"name": "DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING_ENABLED", "origin": "default", "value": True},
296295
{"name": "DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE", "origin": "default", "value": "identification"},
297296
{"name": "DD_APPSEC_ENABLED", "origin": "env_var", "value": True},

0 commit comments

Comments
 (0)