You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a Sysdig Secure Vulnerability Rule Bundle to define custom rules for vulnerability management, supporting various types of rules.
11
+
Creates a Sysdig Secure Vulnerability Rule Bundle.
12
+
13
+
A **Rule Bundle** is a collection of rules that can be reused across multiple [Vulnerability Policies](https://docs.sysdig.com/en/docs/sysdig-secure/policies/vulnerability_policies/). Rule bundles allow you to define a standardized set of conditions for evaluating vulnerabilities, which can then be applied consistently to different policies. For more details, see the official documentation on [Rule Bundles](https://docs.sysdig.com/en/sysdig-secure/vm_policies/rule_bundles/).
12
14
13
15
-> **Note:** Sysdig Terraform Provider is under rapid development at this point. If you experience any issue or discrepancy while using it, please make sure you have the latest version. If the issue persists, or you have a Feature Request to support an additional set of resources, please open a [new issue](https://github.com/sysdiglabs/terraform-provider-sysdig/issues/new) in the GitHub repository.
14
16
15
17
## Example Usage
16
18
19
+
### Image Label Example
20
+
21
+
This example defines a rule bundle that checks for the presence or absence of specific image labels.
*`rule` - (Required) List of rule definitions. Each rule supports multiple types (e.g., `image_label`). Each type may have different required attributes:
94
+
## Argument Reference
51
95
52
-
### Rule Types
96
+
*`name` - (Required) The name of the vulnerability rule bundle.
53
97
54
-
#### image_label
98
+
*`description` - (Optional) A description for the rule bundle.
55
99
56
-
Defines label-based matching rules for image configuration. Only one of the following attributes must be specified:
100
+
*`rule` - (Required) A list of rule definitions. Each `rule` block must define exactly one of the available rule types. For more details on rule types, see the [Rules documentation](https://docs.sysdig.com/en/sysdig-secure/policies/vulnerability_policies/rules).
57
101
58
-
*`label_must_exist` - (Optional) Label key that must exist in the image configuration.
59
-
*`label_must_not_exist` - (Optional) Label key that must not exist in the image configuration.
60
-
*`label_must_exist_and_contain_value` - (Optional) List of required label-value pairs, each containing:
102
+
---
61
103
62
-
*`required_label` - (Required) Label key required in the image configuration.
63
-
*`required_value` - (Required) Value that the label must contain.
104
+
### `rule` block
105
+
106
+
Each `rule` block defines a single condition. A bundle can contain multiple rules.
107
+
108
+
#### `image_label`
109
+
110
+
Defines rules based on image labels to evaluate image configuration. Only one of the following attributes can be specified within a single `image_label` block.
111
+
112
+
*`label_must_exist` - (Optional) The rule matches if an image contains a label with this key.
113
+
*`label_must_not_exist` - (Optional) The rule matches if an image does not contain a label with this key.
114
+
*`label_must_exist_and_contain_value` - (Optional) A block specifying a label key and value that must exist in the image configuration.
115
+
*`required_label` - (Required) The label key that must exist.
116
+
*`required_value` - (Required) The expected value for the given label key.
117
+
118
+
#### `severities_and_threats`
119
+
120
+
Defines rules based on vulnerability severity, threat intelligence, and other risk factors.
121
+
122
+
*`severity_at_least` - (Optional) Matches if the vulnerability severity is at least this level. Valid values: `critical`, `high`, `medium`, `low`, `negligible`.
123
+
*`severity_equals` - (Optional) Matches if the vulnerability severity is exactly this level. Valid values: `critical`, `high`, `medium`, `low`, `negligible`.
124
+
*`cvss_at_least` - (Optional) Matches if the vulnerability's CVSS score is at least this value (e.g., `7.5`).
125
+
*`disclosure_older_than_days` - (Optional) Matches if the vulnerability was publicly disclosed more than this number of days ago.
126
+
*`disclosure_date` - (Optional) A block specifying that the vulnerability was disclosed within a specific date range.
127
+
*`from` - (Required) Start of the date range in `YYYY-MM-DD` format.
128
+
*`to` - (Required) End of the date range in `YYYY-MM-DD` format.
129
+
*`package_type` - (Optional) Matches if the vulnerability is in a package of this type. Valid values: `os`, `nonOs`.
130
+
*`in_use` - (Optional) If `true`, the rule matches only if the vulnerable package is loaded in memory at runtime.
131
+
*`fix_available` - (Optional) If `true`, a fix is available for the vulnerability.
132
+
*`fix_available_since_days` - (Optional) Matches if a fix has been available for at least this number of days.
133
+
*`public_exploit_available` - (Optional) If `true`, a public exploit is known to exist for the vulnerability.
134
+
*`public_exploit_available_since_days` - (Optional) Matches if a public exploit has been available for at least this number of days.
135
+
*`exploit_no_admin_privileges` - (Optional) If `true`, the exploit does not require administrator privileges.
136
+
*`exploit_no_user_interaction` - (Optional) If `true`, the exploit does not require user interaction.
137
+
*`exploit_network_attack_vector` - (Optional) If `true`, the exploit has a network attack vector.
138
+
*`cisa_kev_in_ransomware_campaign` - (Optional) If `true`, the vulnerability is part of a CISA KEV (Known Exploited Vulnerabilities) ransomware campaign.
139
+
*`cisa_kev_available_since_days` - (Optional) Matches if the vulnerability has been in the CISA KEV catalog for at least this number of days.
140
+
*`cisa_kev_due_date_in_days` - (Optional) Matches if the CISA KEV remediation due date is within this number of days.
141
+
*`epss_score_at_least_percentage` - (Optional) Matches if the EPSS (Exploit Prediction Scoring System) score is at least this percentage (0-100).
142
+
*`epss_percentile_at_least_percentage` - (Optional) Matches if the EPSS percentile is at least this percentage (0-100).
143
+
144
+
-> **Note on mutually exclusive fields:**
145
+
> - Within a `severities_and_threats` block, only one of `severity_at_least`, `severity_equals`, or `cvss_at_least` can be set.
146
+
> -`disclosure_older_than_days` and `disclosure_date` are mutually exclusive.
147
+
> -`public_exploit_available` and `public_exploit_available_since_days` are mutually exclusive.
148
+
> -`fix_available` and `fix_available_since_days` are mutually exclusive.
64
149
65
150
## Attributes Reference
66
151
67
152
In addition to all arguments above, the following attributes are exported:
68
153
69
-
*`identifier` - External identifier computed after creation. Not to be used with the `secure_vulnerability_policy.bundles` field, use `id` for that.
154
+
*`id` - The internal identifier of the vulnerability rule bundle. This is the ID to be used in the `sysdig_secure_vulnerability_policy.bundles` field.
155
+
*`identifier` - The external identifier of the vulnerability rule bundle.
70
156
71
157
## Import
72
158
73
159
Vulnerability rule bundles can be imported using their bundle ID, for example:
0 commit comments