Skip to content

Commit 881ee42

Browse files
NouemanKHALclaude
andauthored
Onboard integrations to security validation (DataDog#23109)
* Allow require_trusted_provider as a valid value-level field in spec.yaml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * changelog * lint * Generate SECURE_FIELD_NAMES and security validation in config models from require_trusted_provider spec fields Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Apply original require_trusted_provider implementation from pre-revert state Use module-level SECURE_FIELD_NAMES constant and field-level _validate security check (mode='before'), with require_trusted_providers tracked in ModelInfo. Also restore spec.py validator, template yaml annotations, and changelog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * update changelog * reset datadog_checks_base test file * mark all integrations with command or filepath properties with require_trusted_provider: true * Bump datadog-checks-base minimum version to 37.33.0 for integrations with require_trusted_provider fields Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * regenerate models with require_trusted_provider * sync models * changelog * ensure bump datadog_checks_base minimum version to 37.33.0 in all integrations --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fb1f14e commit 881ee42

664 files changed

Lines changed: 2531 additions & 293 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

active_directory/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
"Private :: Do Not Upload",
2929
]
3030
dependencies = [
31-
"datadog-checks-base>=37.24.0",
31+
"datadog-checks-base>=37.33.0",
3232
]
3333
dynamic = [
3434
"version",

activemq/changelog.d/23109.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for security validation in models

activemq/datadog_checks/activemq/config_models/instance.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
from . import defaults, validators
2020

2121

22+
SECURE_FIELD_NAMES = frozenset(['java_bin_path', 'key_store_path', 'tools_jar_path', 'trust_store_path'])
23+
24+
2225
class InstanceConfig(BaseModel):
2326
model_config = ConfigDict(
2427
validate_default=True,
@@ -59,6 +62,11 @@ def _validate(cls, value, info):
5962
field_name = field.alias or info.field_name
6063
if field_name in info.context['configured_fields']:
6164
value = getattr(validators, f'instance_{info.field_name}', identity)(value, field=field)
65+
66+
if info.field_name in SECURE_FIELD_NAMES:
67+
validation.security.check_field_trusted_provider(
68+
info.field_name, value, info.context.get('security_config')
69+
)
6270
else:
6371
value = getattr(defaults, f'instance_{info.field_name}', lambda: value)()
6472

activemq/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
"Private :: Do Not Upload",
2929
]
3030
dependencies = [
31-
"datadog-checks-base>=37.24.0",
31+
"datadog-checks-base>=37.33.0",
3232
]
3333
dynamic = [
3434
"version",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for security validation in models

activemq_xml/datadog_checks/activemq_xml/config_models/instance.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
from . import defaults, validators
2222

2323

24+
SECURE_FIELD_NAMES = frozenset(
25+
['auth_token', 'kerberos_cache', 'kerberos_keytab', 'tls_ca_cert', 'tls_cert', 'tls_private_key']
26+
)
27+
28+
2429
class AuthToken(BaseModel):
2530
model_config = ConfigDict(
2631
arbitrary_types_allowed=True,
@@ -113,6 +118,11 @@ def _validate(cls, value, info):
113118
field_name = field.alias or info.field_name
114119
if field_name in info.context['configured_fields']:
115120
value = getattr(validators, f'instance_{info.field_name}', identity)(value, field=field)
121+
122+
if info.field_name in SECURE_FIELD_NAMES:
123+
validation.security.check_field_trusted_provider(
124+
info.field_name, value, info.context.get('security_config')
125+
)
116126
else:
117127
value = getattr(defaults, f'instance_{info.field_name}', lambda: value)()
118128

activemq_xml/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
"Private :: Do Not Upload",
2929
]
3030
dependencies = [
31-
"datadog-checks-base>=37.24.0",
31+
"datadog-checks-base>=37.33.0",
3232
]
3333
dynamic = [
3434
"version",

aerospike/changelog.d/23109.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for security validation in models

aerospike/datadog_checks/aerospike/config_models/instance.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
from . import defaults, validators
2222

2323

24+
SECURE_FIELD_NAMES = frozenset(
25+
['auth_token', 'kerberos_cache', 'kerberos_keytab', 'tls_ca_cert', 'tls_cert', 'tls_private_key']
26+
)
27+
28+
2429
class AuthToken(BaseModel):
2530
model_config = ConfigDict(
2631
arbitrary_types_allowed=True,
@@ -172,6 +177,11 @@ def _validate(cls, value, info):
172177
field_name = field.alias or info.field_name
173178
if field_name in info.context['configured_fields']:
174179
value = getattr(validators, f'instance_{info.field_name}', identity)(value, field=field)
180+
181+
if info.field_name in SECURE_FIELD_NAMES:
182+
validation.security.check_field_trusted_provider(
183+
info.field_name, value, info.context.get('security_config')
184+
)
175185
else:
176186
value = getattr(defaults, f'instance_{info.field_name}', lambda: value)()
177187

aerospike/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
"Private :: Do Not Upload",
2828
]
2929
dependencies = [
30-
"datadog-checks-base>=37.24.0",
30+
"datadog-checks-base>=37.33.0",
3131
]
3232
dynamic = [
3333
"version",

0 commit comments

Comments
 (0)