Skip to content

Commit e581279

Browse files
feat(aap): endpoint discovery for Django (#14113)
This PR introduces a new feature for API Protection: - Discovery of Django endpoints at startup of the tracer - Report through a new telemetry payload - Add max_length and time checks to ensure collection of endpoints is memory and time bounded - Add telemetry test with minimalist django application to test the feature. APPSEC-58374 Note: This new feature is completely independent from security features. ## 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 1b7d929 commit e581279

File tree

22 files changed

+431
-193
lines changed

22 files changed

+431
-193
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ mypy.ini @DataDog/python-guild @DataDog/apm-core-pyt
3737
ddtrace/internal/_file_queue.py @DataDog/python-guild
3838
ddtrace/internal/_unpatched.py @DataDog/python-guild
3939
ddtrace/internal/compat.py @DataDog/python-guild @DataDog/apm-core-python
40+
ddtrace/internal/endpoints.py @DataDog/python-guild @DataDog/asm-python
4041
ddtrace/settings/config.py @DataDog/python-guild @DataDog/apm-sdk-api-python
4142
docs/ @DataDog/python-guild
4243
tests/utils.py @DataDog/python-guild

.riot/requirements/10505cf.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/10505cf.in
6+
#
7+
asgiref==3.9.1
8+
attrs==25.3.0
9+
certifi==2025.7.14
10+
charset-normalizer==3.4.2
11+
click==7.1.2
12+
coverage[toml]==7.9.2
13+
django==5.2.4
14+
flask==1.1.4
15+
gunicorn==23.0.0
16+
httpretty==1.0.5
17+
hypothesis==6.45.0
18+
idna==3.10
19+
iniconfig==2.1.0
20+
itsdangerous==1.1.0
21+
jinja2==2.11.3
22+
markupsafe==1.1.1
23+
mock==5.2.0
24+
opentracing==2.4.0
25+
packaging==25.0
26+
pluggy==1.6.0
27+
pygments==2.19.2
28+
pytest==8.4.1
29+
pytest-cov==6.2.1
30+
pytest-mock==3.14.1
31+
pytest-randomly==3.16.0
32+
requests==2.32.4
33+
sortedcontainers==2.4.0
34+
sqlparse==0.5.3
35+
urllib3==2.5.0
36+
werkzeug==1.0.1

.riot/requirements/1153ad9.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

.riot/requirements/118cb50.txt

Lines changed: 0 additions & 34 deletions
This file was deleted.

.riot/requirements/135aac0.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

.riot/requirements/15235b0.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

.riot/requirements/17a929f.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

.riot/requirements/1ac71d3.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1ac71d3.in
6+
#
7+
asgiref==3.9.1
8+
attrs==25.3.0
9+
certifi==2025.7.14
10+
charset-normalizer==3.4.2
11+
click==7.1.2
12+
coverage[toml]==7.9.2
13+
django==5.2.4
14+
flask==1.1.4
15+
gunicorn==23.0.0
16+
httpretty==1.0.5
17+
hypothesis==6.45.0
18+
idna==3.10
19+
iniconfig==2.1.0
20+
itsdangerous==1.1.0
21+
jinja2==2.11.3
22+
markupsafe==1.1.1
23+
mock==5.2.0
24+
opentracing==2.4.0
25+
packaging==25.0
26+
pluggy==1.6.0
27+
pygments==2.19.2
28+
pytest==8.4.1
29+
pytest-cov==6.2.1
30+
pytest-mock==3.14.1
31+
pytest-randomly==3.16.0
32+
requests==2.32.4
33+
sortedcontainers==2.4.0
34+
sqlparse==0.5.3
35+
urllib3==2.5.0
36+
werkzeug==1.0.1

.riot/requirements/1bd7fc4.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1bd7fc4.in
6+
#
7+
asgiref==3.9.1
8+
attrs==25.3.0
9+
certifi==2025.7.14
10+
charset-normalizer==3.4.2
11+
click==7.1.2
12+
coverage[toml]==7.9.2
13+
django==5.2.4
14+
exceptiongroup==1.3.0
15+
flask==1.1.4
16+
gunicorn==23.0.0
17+
httpretty==1.0.5
18+
hypothesis==6.45.0
19+
idna==3.10
20+
iniconfig==2.1.0
21+
itsdangerous==1.1.0
22+
jinja2==2.11.3
23+
markupsafe==1.1.1
24+
mock==5.2.0
25+
opentracing==2.4.0
26+
packaging==25.0
27+
pluggy==1.6.0
28+
pygments==2.19.2
29+
pytest==8.4.1
30+
pytest-cov==6.2.1
31+
pytest-mock==3.14.1
32+
pytest-randomly==3.16.0
33+
requests==2.32.4
34+
sortedcontainers==2.4.0
35+
sqlparse==0.5.3
36+
tomli==2.2.1
37+
typing-extensions==4.14.1
38+
urllib3==2.5.0
39+
werkzeug==1.0.1

.riot/requirements/2e24172.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/2e24172.in
6+
#
7+
asgiref==3.9.1
8+
attrs==25.3.0
9+
certifi==2025.7.14
10+
charset-normalizer==3.4.2
11+
click==7.1.2
12+
coverage[toml]==7.9.2
13+
django==4.2.23
14+
exceptiongroup==1.3.0
15+
flask==1.1.4
16+
gunicorn==23.0.0
17+
httpretty==1.0.5
18+
hypothesis==6.45.0
19+
idna==3.10
20+
importlib-metadata==8.7.0
21+
iniconfig==2.1.0
22+
itsdangerous==1.1.0
23+
jinja2==2.11.3
24+
markupsafe==1.1.1
25+
mock==5.2.0
26+
opentracing==2.4.0
27+
packaging==25.0
28+
pluggy==1.6.0
29+
pygments==2.19.2
30+
pytest==8.4.1
31+
pytest-cov==6.2.1
32+
pytest-mock==3.14.1
33+
pytest-randomly==3.16.0
34+
requests==2.32.4
35+
sortedcontainers==2.4.0
36+
sqlparse==0.5.3
37+
tomli==2.2.1
38+
typing-extensions==4.14.1
39+
urllib3==2.5.0
40+
werkzeug==1.0.1
41+
zipp==3.23.0

0 commit comments

Comments
 (0)