Skip to content

Commit 1c92482

Browse files
mrafi97shanelhuangrtrieu
authored
Add Windows Certificate Store Integration Tile (#20337)
* adding Windows Certificate Store check * Update README.md * updating manifest, dashboard, and changelog * fixing monitor and manifest * Update windows_certificate_expiration.json * Updating README Co-authored-by: Shanel Huang <shanel.huang@datadoghq.com> * updating dashboard with new logo * Update README Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com> --------- Co-authored-by: Shanel Huang <shanel.huang@datadoghq.com> Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>
1 parent 5735a60 commit 1c92482

File tree

9 files changed

+370
-0
lines changed

9 files changed

+370
-0
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ datadog_checks_base/datadog_checks/base/checks/windows/ @DataDog/wi
194194
/win32_event_log/ @DataDog/windows-agent @DataDog/agent-integrations
195195
/win32_event_log/*.md @DataDog/windows-agent @DataDog/agent-integrations @DataDog/documentation
196196
/win32_event_log/manifest.json @DataDog/windows-agent @DataDog/agent-integrations @DataDog/documentation
197+
/windows_certificate/ @DataDog/windows-agent @DataDog/agent-integrations
198+
/windows_certificate/*.md @DataDog/windows-agent @DataDog/agent-integrations @DataDog/documentation
199+
/windows_certificate/manifest.json @DataDog/windows-agent @DataDog/agent-integrations @DataDog/documentation
197200
/windows_performance_counters/ @DataDog/windows-agent @DataDog/agent-integrations
198201
/windows_performance_counters/*.md @DataDog/windows-agent @DataDog/agent-integrations @DataDog/documentation
199202
/windows_performance_counters/manifest.json @DataDog/windows-agent @DataDog/agent-integrations @DataDog/documentation

.github/workflows/config/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ integration/win32_event_log:
693693
- win32_event_log/**/*
694694
integration/wincrashdetect:
695695
- wincrashdetect/**/*
696+
integration/windows_certificate:
697+
- windows_certificate/**/*
696698
integration/windows_performance_counters:
697699
- windows_performance_counters/**/*
698700
integration/windows_registry:

windows_certificate/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CHANGELOG - windows_certificate
2+
3+
## 1.0.0 / 2025-05-20
4+
5+
***Added***:
6+
7+
* Initial Release

windows_certificate/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Agent Check: Windows Certificate Store
2+
3+
## Overview
4+
5+
This integration monitors the Local Machine certificates in the [Windows Certificate Store][1] to check whether any of have expired.
6+
7+
## Setup
8+
9+
### Installation
10+
11+
The Windows Certificate Store integration is included in the [Datadog Agent][2] package but requires configuration (see instructions below).
12+
13+
### Configuration
14+
15+
Edit the `windows_certificate.d/conf.yaml` file, in the `conf.d/` folder at the root of your [Agent's configuration directory][10]. See the [`sample windows_certificate.d/conf.yaml`][4] for all available configuration options. When you are done editing the configuration file, [restart the Agent][5] to load the new configuration.
16+
17+
The integration can monitor the expiration of all certificates in a given store or selectively monitor specific certificates from a given list of strings matching with the certificate subjects. The store names that are available for monitoring are listed in `HKEY_LOCAL_MACHINE\Software\Microsoft\SystemCertificates`.
18+
19+
This example configuration monitors all certificates in the local machine's `ROOT` store:
20+
21+
```yaml
22+
instances:
23+
- certificate_store: ROOT
24+
```
25+
This example configuration monitors certificates in `ROOT` that have `microsoft` or `verisign` in the subject:
26+
```yaml
27+
instances:
28+
- certificate_store: ROOT
29+
certificate_subjects:
30+
- microsoft
31+
- verisign
32+
```
33+
The parameters `days_warning` and `days_critical` are used to specify the number of days before certificate expiration from which the service check `windows_certificate.cert_expiration` begins emitting WARNING/CRITICAL alerts. In the below example the service check emits a WARNING alert when a certificate is 10 days from expiring and CRITICAL when it is 5 days away from expiring:
34+
```yaml
35+
instances:
36+
- certificate_store: ROOT
37+
certificate_subjects:
38+
- microsoft
39+
- verisign
40+
days_warning: 10
41+
days_critical: 5
42+
```
43+
44+
### Validation
45+
46+
[Run the Agent's status subcommand][6] and look for `windows_certificate` under the Checks section.
47+
48+
## Data Collected
49+
50+
### Metrics
51+
52+
See [metadata.csv][7] for a list of metrics provided by this integration.
53+
54+
### Events
55+
56+
The windows_certificate integration does not include any events.
57+
58+
### Service Checks
59+
60+
See [service_checks.json][8] for a list of service checks provided by this integration.
61+
62+
## Troubleshooting
63+
64+
Need help? Contact [Datadog support][9].
65+
66+
67+
[1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/install/certificate-stores
68+
[2]: https://app.datadoghq.com/account/settings/agent/latest
69+
[3]: https://docs.datadoghq.com/agent/kubernetes/integrations/
70+
[4]: https://github.com/DataDog/datadog-agent/blob/main/cmd/agent/dist/conf.d/windows_certificate.d/conf.yaml.example
71+
[5]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
72+
[6]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
73+
[7]: https://github.com/DataDog/integrations-core/blob/master/windows_certificate/metadata.csv
74+
[8]: https://github.com/DataDog/integrations-core/blob/master/windows_certificate/assets/service_checks.json
75+
[9]: https://docs.datadoghq.com/help/
76+
[10]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{
2+
"author_name": "Datadog",
3+
"description": "## Windows Certificate Store Integration Dashboard\n\nThis is an example Windows Certificate Store dashboard demonstrating the information that the integration collects.",
4+
"layout_type": "ordered",
5+
"template_variables": [
6+
{
7+
"available_values": [],
8+
"default": "*",
9+
"name": "certificate_store",
10+
"prefix": "certificate_store"
11+
},
12+
{
13+
"available_values": [],
14+
"default": "*",
15+
"name": "subject_common_name",
16+
"prefix": "subject_cn"
17+
}
18+
],
19+
"title": "Windows Certificate Store Overview",
20+
"widgets": [
21+
{
22+
"definition": {
23+
"has_background": true,
24+
"has_border": true,
25+
"horizontal_align": "center",
26+
"sizing": "contain",
27+
"type": "image",
28+
"url": "https://static.datadoghq.com/static/images/logos/windows-certificate_large.svg",
29+
"vertical_align": "center"
30+
},
31+
"id": 4652925140828556,
32+
"layout": {
33+
"height": 5,
34+
"width": 4,
35+
"x": 0,
36+
"y": 0
37+
}
38+
},
39+
{
40+
"definition": {
41+
"background_color": "vivid_blue",
42+
"layout_type": "ordered",
43+
"show_title": true,
44+
"title": "Certificate Expiration",
45+
"type": "group",
46+
"widgets": [
47+
{
48+
"definition": {
49+
"check": "windows_certificate.cert_expiration",
50+
"group_by": [],
51+
"grouping": "cluster",
52+
"tags": [
53+
"$certificate_store",
54+
"$subject_common_name"
55+
],
56+
"title": "Certificate Expiration",
57+
"title_align": "center",
58+
"title_size": "16",
59+
"type": "check_status"
60+
},
61+
"id": 5168903633321084,
62+
"layout": {
63+
"height": 2,
64+
"width": 4,
65+
"x": 0,
66+
"y": 0
67+
}
68+
},
69+
{
70+
"definition": {
71+
"background_color": "yellow",
72+
"content": "Included service check:\n\n* `windows_certificate.cert_expiration` - Returns CRITICAL if the certificate has expired or expires in less than `days_critical`, returns WARNING if the certificate expires in less than `days_warning`, otherwise returns OK.",
73+
"font_size": "14",
74+
"has_padding": true,
75+
"show_tick": true,
76+
"text_align": "left",
77+
"tick_edge": "left",
78+
"tick_pos": "50%",
79+
"type": "note",
80+
"vertical_align": "center"
81+
},
82+
"id": 6717423497232037,
83+
"layout": {
84+
"height": 2,
85+
"width": 3,
86+
"x": 4,
87+
"y": 0
88+
}
89+
},
90+
{
91+
"definition": {
92+
"legend_columns": [
93+
"avg",
94+
"min",
95+
"max",
96+
"value",
97+
"sum"
98+
],
99+
"legend_layout": "auto",
100+
"requests": [
101+
{
102+
"display_type": "line",
103+
"formulas": [
104+
{
105+
"formula": "query1"
106+
}
107+
],
108+
"queries": [
109+
{
110+
"data_source": "metrics",
111+
"name": "query1",
112+
"query": "avg:windows_certificate.days_remaining{$certificate_store, $subject_common_name} by {subject_cn}"
113+
}
114+
],
115+
"response_format": "timeseries",
116+
"style": {
117+
"line_type": "solid",
118+
"line_width": "normal",
119+
"order_by": "values",
120+
"palette": "dog_classic"
121+
}
122+
}
123+
],
124+
"show_legend": true,
125+
"title": "Days Till Expiration",
126+
"title_align": "left",
127+
"title_size": "16",
128+
"type": "timeseries"
129+
},
130+
"id": 4514519614660249,
131+
"layout": {
132+
"height": 2,
133+
"width": 4,
134+
"x": 0,
135+
"y": 2
136+
}
137+
},
138+
{
139+
"definition": {
140+
"background_color": "yellow",
141+
"content": "Days until certificate(s) expire",
142+
"font_size": "14",
143+
"has_padding": true,
144+
"show_tick": true,
145+
"text_align": "left",
146+
"tick_edge": "left",
147+
"tick_pos": "50%",
148+
"type": "note",
149+
"vertical_align": "center"
150+
},
151+
"id": 3226539913664578,
152+
"layout": {
153+
"height": 1,
154+
"width": 3,
155+
"x": 4,
156+
"y": 2
157+
}
158+
}
159+
]
160+
},
161+
"id": 3432759619201891,
162+
"layout": {
163+
"height": 5,
164+
"width": 7,
165+
"x": 4,
166+
"y": 0
167+
}
168+
}
169+
]
170+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": 2,
3+
"created_at": "2025-05-13",
4+
"last_updated_at": "2025-05-13",
5+
"title": "A certificate is expired or about to expire",
6+
"description": "This monitor alerts when there are certificates in the Windows Certificate Store that are expired or close to expiring.",
7+
"tags": [
8+
"integration:windows-certificate"
9+
],
10+
"definition": {
11+
"name": "A certificate is expired or about to expire",
12+
"type": "service check",
13+
"query": "\"windows_certificate.cert_expiration\".over(\"*\").by(\"certificate_store\",\"host\",\"subject_cn\").last(2).count_by_status()",
14+
"message": "The Windows Certificate integration is reporting the following for Certificate: {{subject_cn.name}} in Store: {{certificate_store.name}}\n\n{{#is_warning}}\n\nWarning: {{check_message}}\n\n{{/is_warning}}\n\n{{#is_alert}}\n\nAlert: {{check_message}}\n\n{{/is_alert}}",
15+
"tags": [
16+
"integration:windows_certificate"
17+
],
18+
"options": {
19+
"thresholds": {
20+
"critical": 1,
21+
"warning": 1,
22+
"ok": 1
23+
},
24+
"notify_audit": false,
25+
"notify_no_data": false,
26+
"renotify_interval": 0,
27+
"timeout_h": 0,
28+
"threshold_windows": null,
29+
"include_tags": true,
30+
"new_group_delay": 60,
31+
"avalanche_window": 10
32+
},
33+
"priority": null
34+
}
35+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"agent_version": "7.67.0",
4+
"integration": "Windows Certificate Store",
5+
"groups": [
6+
"certificate_store",
7+
"subject_cn",
8+
"subject_ou",
9+
"subject_c",
10+
"subject_o",
11+
"subject_l"
12+
],
13+
"check": "windows_certificate.cert_expiration",
14+
"statuses": [
15+
"ok",
16+
"critical",
17+
"warning"
18+
],
19+
"name": "Certificate validation",
20+
"description": "Returns `CRITICAL` if the certificate has expired or expires in less than `days_critical`, returns `WARNING` if the certificate expires in less than `days_warning`, otherwise returns `OK`."
21+
}
22+
]

windows_certificate/manifest.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"manifest_version": "2.0.0",
3+
"app_uuid": "67feed3c-1676-4d6b-9d72-3ca8c0a6e3dc",
4+
"app_id": "windows-certificate",
5+
"display_on_public_website": false,
6+
"tile": {
7+
"overview": "README.md#Overview",
8+
"configuration": "README.md#Setup",
9+
"support": "README.md#Support",
10+
"changelog": "CHANGELOG.md",
11+
"description": "Monitor your Windows hosts' certificates stores for certificate expiration.",
12+
"title": "Windows Certificate Store",
13+
"media": [],
14+
"classifier_tags": [
15+
"Supported OS::Windows",
16+
"Category::OS & System",
17+
"Category::Windows",
18+
"Offering::Integration",
19+
"Submitted Data Type::Metrics"
20+
]
21+
},
22+
"assets": {
23+
"integration": {
24+
"auto_install": true,
25+
"source_type_id": 46050783,
26+
"source_type_name": "Windows Certificate Store",
27+
"configuration": {},
28+
"events": {
29+
"creates_events": false
30+
},
31+
"metrics": {
32+
"prefix": "windows_certificate.",
33+
"check": "windows_certificate.days_remaining",
34+
"metadata_path": "metadata.csv"
35+
},
36+
"service_checks": {
37+
"metadata_path": "assets/service_checks.json"
38+
}
39+
},
40+
"dashboards": {
41+
"Windows Certificate Store Overview": "assets/dashboards/windows_certificate_overview.json"
42+
},
43+
"monitors": {
44+
"A certificate is expired or about to expire": "assets/monitors/windows_certificate_expiration.json"
45+
}
46+
},
47+
"author": {
48+
"support_email": "help@datadoghq.com",
49+
"name": "Datadog",
50+
"homepage": "https://www.datadoghq.com",
51+
"sales_email": "info@datadoghq.com"
52+
}
53+
}

windows_certificate/metadata.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric,sample_tags
2+
windows_certificate.days_remaining,gauge,,day,,Days until certificate expiration,1,windows_certificate_store,Days until expiration,,

0 commit comments

Comments
 (0)