Skip to content

Commit 619fc4e

Browse files
committed
feat: Add Cloud Posture and Cloud Compliance resource and data sources
1 parent 6d6a396 commit 619fc4e

File tree

16 files changed

+1014
-775
lines changed

16 files changed

+1014
-775
lines changed

docs/data-sources/cloud_compliance_framework_controls.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
page_title: "crowdstrike_cloud_compliance_framework_controls Data Source - crowdstrike"
33
subcategory: "Cloud Compliance"
44
description: |-
5-
This data source retrieves all or a subset of controls within compliance benchmarks. You can search within a single benchmark using the 'benchmark', 'name', and 'requirement' fields, or across multiple benchmarks using an FQL filter. When using 'name', 'benchmark', and 'requirement', the 'benchmark' field is required.
5+
This data source retrieves all or a subset of controls within compliance benchmarks. All non-FQL fields can accept wildcards * and query Falcon using logical AND. If FQL is defined, all other fields will be ignored. For advanced queries to further narrow your search, please use a Falcon Query Language (FQL) filter. For additional information on FQL filtering and usage, refer to the official CrowdStrike documentation: Falcon Query Language (FQL) https://falcon.crowdstrike.com/documentation/page/d3c84a1b/falcon-query-language-fql
66
API Scopes
77
The following API scopes are required:
88
Cloud Security Policies | Read
99
---
1010

1111
# crowdstrike_cloud_compliance_framework_controls (Data Source)
1212

13-
This data source retrieves all or a subset of controls within compliance benchmarks. You can search within a single benchmark using the 'benchmark', 'name', and 'requirement' fields, or across multiple benchmarks using an FQL filter. When using 'name', 'benchmark', and 'requirement', the 'benchmark' field is required.
13+
This data source retrieves all or a subset of controls within compliance benchmarks. All non-FQL fields can accept wildcards `*` and query Falcon using logical AND. If FQL is defined, all other fields will be ignored. For advanced queries to further narrow your search, please use a Falcon Query Language (FQL) filter. For additional information on FQL filtering and usage, refer to the official CrowdStrike documentation: [Falcon Query Language (FQL)](https://falcon.crowdstrike.com/documentation/page/d3c84a1b/falcon-query-language-fql)
1414

1515
## API Scopes
1616

@@ -36,8 +36,7 @@ provider "crowdstrike" {
3636
3737
# retrieve all controls under a named benchmark
3838
data "crowdstrike_cloud_compliance_framework_controls" "all" {
39-
cloud_provider = "AWS"
40-
rule_name = "NLB/ALB configured publicly with TLS/SSL disabled"
39+
benchmark = "CIS 1.0.0 AWS Web Architecture"
4140
}
4241
4342
# retrieve a single control within a benchmark by name
@@ -63,24 +62,25 @@ data "crowdstrike_cloud_compliance_framework_controls" "fql" {
6362

6463
### Optional
6564

66-
- `benchmark` (String) Name of the compliance benchmark in the framework.
65+
- `benchmark` (String) Name of the compliance benchmark in the framework. Examples: `AWS Foundational Security Best Practices v1.*`, `CIS 1.2.0 GCP`, `CIS 1.8.0 GKE`
66+
- `control_name` (String) Name of the control. Examples: `Ensure security contact phone is set`, `Ensure that Azure Defender*`
67+
- `fql` (String) Falcon Query Language (FQL) filter for advanced control searches. FQL filter, allowed props: `compliance_control_name`, `compliance_control_authority`, `compliance_control_type`, `compliance_control_section`, `compliance_control_requirement`, `compliance_control_benchmark_name`, `compliance_control_benchmark_version`
68+
- `requirement` (String) Requirement of the control(s) within the framework. Examples: `2.*`, `1.1`
69+
- `section` (String) Section of the benchmark where the control(s) reside. Examples: `Data Protection`, `Data*`
70+
71+
### Read-Only
72+
6773
- `controls` (Attributes Set) Security framework and compliance rule information. (see [below for nested schema](#nestedatt--controls))
68-
- `fql` (String) Falcon Query Language (FQL) filter for advanced control searches. FQL filter, allowed props: *compliance_control_name* *compliance_control_authority* *compliance_control_type* *compliance_control_section* *compliance_control_requirement* *compliance_control_benchmark_name* *compliance_control_benchmark_version*
69-
- `name` (String) Name of the control.
70-
- `requirement` (String) Version of the control.
7174

7275
<a id="nestedatt--controls"></a>
7376
### Nested Schema for `controls`
7477

75-
Required:
78+
Read-Only:
7679

80+
- `authority` (String) The compliance authority for the framework
81+
- `benchmark` (String) The compliance benchmark within the framework.
7782
- `code` (String) The unique compliance framework rule code.
83+
- `id` (String) The id of the compliance control.
7884
- `name` (String) The name of the control.
79-
- `uuid` (String) The uuid of the compliance control.
80-
81-
Optional:
82-
83-
- `authority` (String) This compliance authority for the framework
84-
- `benchmark` (String) The compliance benchmark within the framework.
8585
- `requirement` (String) The compliance framework requirement.
8686
- `section` (String) The section within the compliance benchmark.

docs/data-sources/cloud_posture_rules.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
page_title: "crowdstrike_cloud_posture_rules Data Source - crowdstrike"
33
subcategory: "Cloud Posture"
44
description: |-
5-
This data source retrieves detailed information about a specific cloud posture rule, including its unique identifier (UUID) and associated attributes.
5+
This data source retrieves detailed information about a specific cloud posture rule, including its unique identifier (ID) and associated attributes.All non-FQL fields can accept wildcards * and query Falcon using logical AND. If FQL is defined, all other fields will be ignored. For advanced queries to further narrow your search, please use a Falcon Query Language (FQL) filter. For additional information on FQL filtering and usage, refer to the official CrowdStrike documentation: Falcon Query Language (FQL) https://falcon.crowdstrike.com/documentation/page/d3c84a1b/falcon-query-language-fql
66
API Scopes
77
The following API scopes are required:
88
Cloud Security Policies | Read & Write
99
---
1010

1111
# crowdstrike_cloud_posture_rules (Data Source)
1212

13-
This data source retrieves detailed information about a specific cloud posture rule, including its unique identifier (UUID) and associated attributes.
13+
This data source retrieves detailed information about a specific cloud posture rule, including its unique identifier (ID) and associated attributes.All non-FQL fields can accept wildcards `*` and query Falcon using logical AND. If FQL is defined, all other fields will be ignored. For advanced queries to further narrow your search, please use a Falcon Query Language (FQL) filter. For additional information on FQL filtering and usage, refer to the official CrowdStrike documentation: [Falcon Query Language (FQL)](https://falcon.crowdstrike.com/documentation/page/d3c84a1b/falcon-query-language-fql)
1414

1515
## API Scopes
1616

@@ -34,59 +34,73 @@ provider "crowdstrike" {
3434
cloud = "us-2"
3535
}
3636
37-
# return all rules for a single cloud provider
38-
data "crowdstrike_cloud_posture_rules" "all" {
39-
cloud_provider = "AWS"
40-
}
41-
4237
# return a single rule within a cloud provider
4338
data "crowdstrike_cloud_posture_rules" "specific" {
4439
cloud_provider = "AWS"
4540
rule_name = "NLB/ALB configured publicly with TLS/SSL disabled"
4641
}
42+
43+
# query by FQL filter
44+
data "crowdstrike_cloud_posture_rules" "original" {
45+
fql = "rule_name:'NLB/ALB configured publicly with TLS/SSL disabled'"
46+
}
47+
48+
# return all rules for a specific resource type within a benchmark
49+
data "crowdstrike_cloud_posture_rules" "original" {
50+
resource_type = "AWS::ElasticLoadBalancingV2::*"
51+
benchmark = "CIS 1.0.0 AWS Web Architecture"
52+
}
53+
54+
# return all rules for a specific resource type within an entire framework
55+
data "crowdstrike_cloud_posture_rules" "original" {
56+
resource_type = "AWS::ElasticLoadBalancingV2::*"
57+
framework = "CIS"
58+
}
4759
```
4860

4961
<!-- schema generated by tfplugindocs -->
5062
## Schema
5163

52-
### Required
64+
### Optional
5365

66+
- `benchmark` (String) Name of the benchmark that this rule is attached to. Note that rules can be associated with multiple benchmarks. Example: `CIS 1.0.0 AWS*`
5467
- `cloud_provider` (String) Cloud provider for where the rule resides.
68+
- `fql` (String) Falcon Query Language (FQL) filter for advanced control searches. FQL filter, allowed props: `rule_origin`, `rule_parent_uuid`, `rule_name`, `rule_description`, `rule_domain`, `rule_status`, `rule_severity`, `rule_short_code`, `rule_service`, `rule_resource_type`, `rule_provider`, `rule_subdomain`, `rule_auto_remediable`, `rule_control_requirement`, `rule_control_section`, `rule_compliance_benchmark`, `rule_compliance_framework`, `rule_mitre_tactic`, `rule_mitre_technique`, `rule_created_at`, `rule_updated_at`, `rule_updated_by`
69+
- `framework` (String) Name of the framework that this rule is attached to. Note that rules can be associated with multiple benchmarks. Examples: CIS, NIST
70+
- `resource_type` (String) Name of the resource type to search for. Examples: `AWS::IAM::CredentialReport`, `Microsoft.Compute/virtualMachines`, `container.googleapis.com/Cluster`.
71+
- `rule_name` (String) Name of the rule to search for. If no name is defined all rules in a cloud provider will be returned.
72+
- `service` (String) Name of the service within the cloud provider that rule is for. Examples: IAM, S3, Microsoft.Compute
5573

56-
### Optional
74+
### Read-Only
5775

58-
- `rule_name` (String) Name of the rule to search for. If no name is defined all rules in cloud provider will be returned.
59-
- `rules` (Attributes List) List of cloud posture rules (see [below for nested schema](#nestedatt--rules))
76+
- `rules` (Attributes Set) List of cloud posture rules (see [below for nested schema](#nestedatt--rules))
6077

6178
<a id="nestedatt--rules"></a>
6279
### Nested Schema for `rules`
6380

64-
Optional:
81+
Read-Only:
6582

66-
- `alert_info` (List of String) A list of the alert logic and detection criteria for rule violations. Parent value will be used when parent_rule_id is defined.
83+
- `alert_info` (List of String) A list of the alert logic and detection criteria for rule violations.
6784
- `attack_types` (Set of String) Specific attack types associated with the rule.
68-
- `auto_remediable` (Boolean) Autoremediation enabled for rule
85+
- `auto_remediable` (Boolean) Autoremediation enabled for the policy rule
6986
- `cloud_platform` (String) Cloud platform for the policy rule.
7087
- `cloud_provider` (String) Cloud provider for the policy rule.
7188
- `controls` (Attributes Set) Security framework and compliance rule information. (see [below for nested schema](#nestedatt--rules--controls))
7289
- `description` (String) Description of the policy rule.
73-
- `domain` (String) Timestamp of the last Terraform update of the resource.
74-
- `logic` (String) Rego logic for the rule. If this is not defined, then parent_rule_id must be defined.
90+
- `domain` (String) Domain for the policy rule.
91+
- `id` (String) Unique identifier of the policy rule.
92+
- `logic` (String) Rego logic for the policy rule.
7593
- `name` (String) Name of the policy rule.
76-
- `parent_rule_id` (String) UUID of the parent rule to inherit properties from. Required if logic is not specified.
77-
- `remediation_info` (String) Information about how to remediate issues detected by this rule.
78-
- `resource_type` (String) The full resource type. Format examples: AWS: AWS::IAM::CredentialReport, Azure: Microsoft.Compute/virtualMachines, GCP: container.googleapis.com/Cluster
79-
- `severity` (Number) Severity of the rule. Valid values are 0 (critical), 1 (high), 2 (medium), 3 (informational).
94+
- `parent_rule_id` (String) Id of the parent rule to inherit properties from.
95+
- `remediation_info` (List of String) Information about how to remediate issues detected by this rule.
96+
- `resource_type` (String) The full resource type. Format examples: `AWS::IAM::CredentialReport`, `Microsoft.Compute/virtualMachines`, `container.googleapis.com/Cluster`
97+
- `severity` (String) Severity of the rule. Valid values are `critical`, `high`, `medium`, `informational`.
8098
- `subdomain` (String) Subdomain for the policy rule. Valid values are 'IOM' (Indicators of Misconfiguration) or 'IAC' (Infrastructure as Code). IOM is only supported at this time.
8199

82-
Read-Only:
83-
84-
- `uuid` (String) Unique identifier of the policy rule.
85-
86100
<a id="nestedatt--rules--controls"></a>
87101
### Nested Schema for `rules.controls`
88102

89103
Required:
90104

91-
- `authority` (String) This compliance framework
105+
- `authority` (String) The compliance framework
92106
- `code` (String) The compliance framework rule code

docs/resources/cloud_posture_custom_rule.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
page_title: "crowdstrike_cloud_posture_custom_rule Resource - crowdstrike"
33
subcategory: "Cloud Posture"
44
description: |-
5-
This resource manages custom cloud posture rules. These rules can be created either by inheriting properties from a parent rule with minimal customization, or by fully customizing all attributes for maximum flexibility.
5+
This resource manages custom cloud posture rules. These rules can be created either by inheriting properties from a parent rule with minimal customization, or by fully customizing all attributes for maximum flexibility. To create a rule based on a parent rule, utilize the crowdstrike_cloud_posture_rules data source to gather parent rule information to use in the new custom rule. The crowdstrike_cloud_compliance_framework_controls data source can be used to query Falcon for compliance benchmark controls to associate with custom rules created with this resource.
66
API Scopes
77
The following API scopes are required:
88
Cloud Security Policies | Read & Write
99
---
1010

1111
# crowdstrike_cloud_posture_custom_rule (Resource)
1212

13-
This resource manages custom cloud posture rules. These rules can be created either by inheriting properties from a parent rule with minimal customization, or by fully customizing all attributes for maximum flexibility.
13+
This resource manages custom cloud posture rules. These rules can be created either by inheriting properties from a parent rule with minimal customization, or by fully customizing all attributes for maximum flexibility. To create a rule based on a parent rule, utilize the `crowdstrike_cloud_posture_rules` data source to gather parent rule information to use in the new custom rule. The `crowdstrike_cloud_compliance_framework_controls` data source can be used to query Falcon for compliance benchmark controls to associate with custom rules created with this resource.
1414

1515
## API Scopes
1616

@@ -37,12 +37,10 @@ provider "crowdstrike" {
3737
# Custom rule derived from a parent rule with specific modifications
3838
resource "crowdstrike_cloud_posture_custom_rule" "copy_rule" {
3939
resource_type = "AWS::EC2::Instance"
40-
subdomain = "IOM"
4140
name = "Test Terraform"
4241
description = "Test Terraform"
43-
cloud_platform = "AWS"
4442
cloud_provider = "AWS"
45-
severity = 1
43+
severity = "informational"
4644
remediation_info = [
4745
"Remediation step 1",
4846
"Remediation step 2",
@@ -67,21 +65,19 @@ resource "crowdstrike_cloud_posture_custom_rule" "copy_rule" {
6765
6866
resource "crowdstrike_cloud_posture_custom_rule" "custom_rule" {
6967
resource_type = "AWS::EC2::Instance"
70-
subdomain = "IOM"
7168
name = "Test Terraform"
7269
description = "Test Terraform"
73-
cloud_platform = "AWS"
7470
cloud_provider = "AWS"
7571
attack_types = [
76-
"this is an attack type",
77-
"this is another attack type"
72+
"Attack Type 1",
73+
"Attack Type 2"
7874
]
7975
remediation_info = [
8076
"Remediation step 1",
8177
"Remediation step 2",
8278
"Remediation step 3",
8379
]
84-
severity = 2
80+
severity = "medium"
8581
logic = <<EOF
8682
package crowdstrike
8783
default result = "pass"
@@ -111,34 +107,34 @@ EOF
111107

112108
### Required
113109

114-
- `cloud_platform` (String) Cloud platform for the policy rule.
115110
- `cloud_provider` (String) Cloud provider for the policy rule.
116111
- `description` (String) Description of the policy rule.
117112
- `name` (String) Name of the policy rule.
118-
- `resource_type` (String) The full resource type. Format examples: AWS: AWS::IAM::CredentialReport, Azure: Microsoft.Compute/virtualMachines, GCP: container.googleapis.com/Cluster.
119-
- `subdomain` (String) Subdomain for the policy rule. Valid values are 'IOM' (Indicators of Misconfiguration) or 'IaC' (Infrastructure as Code). IOM is only supported at this time.
113+
- `resource_type` (String) The full resource type. Examples: `AWS::IAM::CredentialReport`, `Microsoft.Compute/virtualMachines`, `container.googleapis.com/Cluster`
120114

121115
### Optional
122116

123-
- `alert_info` (List of String) A list of the alert logic and detection criteria for rule violations. Parent value will be used when parent_rule_id is defined.
124-
- `attack_types` (Set of String) Specific attack types associated with the rule. Note: If 'parent_rule_id' is specified, these attack types will be inherited from the parent rule, and any values provided here will be ignored.
125-
- `controls` (Attributes Set) Security framework and compliance rule information. (see [below for nested schema](#nestedatt--controls))
126-
- `logic` (String) Rego logic for the rule. If this is not defined, then parent_rule_id must be defined.
127-
- `parent_rule_id` (String) UUID of the parent rule to inherit properties from. Required if logic is not specified.
128-
- `remediation_info` (List of String) Information about how to remediate issues detected by this rule.
129-
- `severity` (Number) Severity of the rule. Valid values are 0 (critical), 1 (high), 2 (medium), 3 (informational).
117+
- `alert_info` (List of String) A list of the alert logic and detection criteria for rule violations. When `alert_info` is not defined and `parent_rule_id` is defined, this field will inherit the parent rule's `alert_info`. Do not include numbering within this list. The Falcon console will automatically add numbering.
118+
- `attack_types` (Set of String) Specific attack types associated with the rule. Note: If `parent_rule_id` is defined, attack types will be inherited from the parent rule and cannot be specified using this field.
119+
- `controls` (Attributes Set) Security framework and compliance rule information. Utilize the `crowdstrike_cloud_compliance_framework_controls` data source to obtain this information. When `controls` is not defined and `parent_rule_id` is defined, this field will inherit the parent rule's `controls`. (see [below for nested schema](#nestedatt--controls))
120+
- `logic` (String) Rego logic for the rule. If this is not defined, then parent_rule_id must be defined. When `parent_rule_id` is defined, `logic` from the parent rule is not visible, but it is used for triggering this rule.
121+
- `parent_rule_id` (String) Id of the parent rule to inherit properties from. The `crowdstrike_cloud_posture_rules` data source can be used to query Falcon for parent rule information to use in this field. Required if `logic` is not specified.
122+
- `remediation_info` (List of String) Information about how to remediate issues detected by this rule. Do not include numbering within this list. The Falcon console will automatically add numbering.
123+
- `severity` (String) Severity of the rule. Valid values are `critical`, `high`, `medium`, `informational`.
130124

131125
### Read-Only
132126

127+
- `cloud_platform` (String) Cloud platform for the policy rule.
133128
- `domain` (String) CrowdStrike domain for the custom rule. Default is CSPM
134-
- `uuid` (String) Unique identifier of the policy rule.
129+
- `id` (String) Unique identifier of the policy rule.
130+
- `subdomain` (String) Subdomain for the policy rule. Valid values are 'IOM' (Indicators of Misconfiguration) or 'IAC' (Infrastructure as Code). IOM is only supported at this time.
135131

136132
<a id="nestedatt--controls"></a>
137133
### Nested Schema for `controls`
138134

139135
Required:
140136

141-
- `authority` (String) This compliance framework
137+
- `authority` (String) The compliance framework
142138
- `code` (String) The compliance framework rule code
143139

144140
## Import

examples/data-sources/crowdstrike_cloud_compliance_framework_controls/data-source.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ provider "crowdstrike" {
1212

1313
# retrieve all controls under a named benchmark
1414
data "crowdstrike_cloud_compliance_framework_controls" "all" {
15-
cloud_provider = "AWS"
16-
rule_name = "NLB/ALB configured publicly with TLS/SSL disabled"
15+
benchmark = "CIS 1.0.0 AWS Web Architecture"
1716
}
1817

1918
# retrieve a single control within a benchmark by name

0 commit comments

Comments
 (0)