Commit ca5e7d2
* log source and provider and call pdb debugger
* remove pdb call and source field
* log both source and provider
* log provider only
* inject provider as property
* add security module to read integration security agent configs
* add secure_field property in the spec and the models
* update SecurityConfig module, and improve security_field validation logic and model generation
* rename secure_field to require_trusted_provider
* improve models generation to be more concise
* mark http and jmx filepath properties as protected
* improve model generation to be more concise
* generate new models
* improve tests and fix security config default allowlist behavior
* add fallback security validation in the base check
* ddev validate config and models
* add require_trusted_provider to the set of allowed value fields
* code cleanup
* ddev validate models -s
* changelog
* Fix path traversal and sibling-directory bypass in is_file_path_allowed
Bare startswith allowed bypasses like /allowed-extra/ matching /allowed
and /allowed/../etc/passwd traversing outside. Now resolves symlinks
with os.path.realpath and enforces os.sep boundary checks.
* Make DEFAULT_TRUSTED_PROVIDERS immutable
Change from mutable list to tuple to prevent accidental mutation of
shared module-level state across SecurityConfig instances.
* Add type hints to core.py and utils.py
Per AGENTS.md guidelines, new code should include type hints using
modern syntax.
* fix tests models/spec to include tls_cert param
* Catch ValueError in GLOBAL_SECURE_FIELDS fallback
ValueError from check_field_trusted_provider was escaping the
except ValidationError handler. Add explicit ValueError catch
to wrap it as ConfigurationError.
* Remove phantom certificate_path from GLOBAL_SECURE_FIELDS
certificate_path doesn't exist in any integration spec.
* Add missing JMX fields to GLOBAL_SECURE_FIELDS
Add java_bin_path, trust_store_path, key_store_path, and
tools_jar_path for fallback coverage of JMX template fields.
* Resolve allowlist paths in is_file_path_allowed
Apply os.path.realpath() to allowlist entries so symlinks in
the allowlist are resolved before comparison.
* Remove dead branch in check_field_trusted_provider
security_config cannot be None when the error raises, since
validate_require_trusted_provider returns True for None.
* Use list[str] in model_info.py
Replace List[str] with modern list[str] syntax and remove
unused typing import.
* Add test coverage for fallback, allowlist, and excluded_checks
Cover three security-critical code paths that had zero test
coverage: GLOBAL_SECURE_FIELDS fallback blocking, allowlist
bypass, and excluded_checks bypass.
* Assert ConfigurationError instead of Exception in tests
Use specific ConfigurationError in pytest.raises to avoid
masking unexpected exceptions.
* Match ConfigurationError in exception message instead of Exception
dd_run_check wraps all errors as Exception, so match on
ConfigurationError in the traceback string to verify the
correct exception type is raised internally.
* Fix regex patterns to match multiline exception messages
Add (?s) dotall flag so ConfigurationError match works across
newlines in dd_run_check's traceback output.
* Add auth_token to test model and test for non-string secure field blocking
Add an object-typed `auth_token` field with `require_trusted_provider: true`
to the test spec/model and a test asserting that non-string secure fields
are blocked from untrusted providers.
* Enforce trusted-provider checks for non-string secure fields
Remove the `isinstance(value, str)` early return that let non-string values
bypass validation. Non-string values (e.g. object-typed auth_token) from
untrusted providers are now blocked; the allowlist escape is applied only to
string file paths.
* fix validation for non-string fields such as auth_token, add more tests
* ddev validate models -s
* remove ValueError catch from base.py
* fix fallback security validation placement
* fix license headers year from 2024 to 2026
* address review: fix a bug where empty trusted_providers list would default to default providers
* Revert all changes outside datadog_checks_base/ to origin/master
Reset integration model regenerations, changelogs, and unrelated
dependency changes so the branch only contains datadog_checks_base/ diffs.
* revert datadog_checks_base models regeneration
* address juanpe review
---------
(cherry picked from commit 31eda08)
Co-authored-by: NouemanKHAL <noueman.khalikine@datadoghq.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bfbebd7 commit ca5e7d2
File tree
9 files changed
+442
-7
lines changed- datadog_checks_base
- changelog.d
- datadog_checks/base
- checks
- utils/models/validation
- tests/models
- config_models
- data
9 files changed
+442
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
78 | 104 | | |
79 | 105 | | |
80 | 106 | | |
| |||
195 | 221 | | |
196 | 222 | | |
197 | 223 | | |
| 224 | + | |
198 | 225 | | |
199 | 226 | | |
200 | 227 | | |
| |||
299 | 326 | | |
300 | 327 | | |
301 | 328 | | |
| 329 | + | |
302 | 330 | | |
303 | 331 | | |
304 | 332 | | |
| |||
401 | 429 | | |
402 | 430 | | |
403 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
404 | 454 | | |
405 | 455 | | |
406 | 456 | | |
| |||
604 | 654 | | |
605 | 655 | | |
606 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
607 | 669 | | |
608 | 670 | | |
609 | 671 | | |
610 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
611 | 678 | | |
612 | 679 | | |
613 | 680 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | | - | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
Lines changed: 92 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | | - | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | | - | |
17 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
| |||
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
| 58 | + | |
48 | 59 | | |
49 | 60 | | |
50 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
0 commit comments