Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update support for crowdstrike_s2s posture rule #3156

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3156.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/cloudflare_device_posture_rule: update support for new fields for crowdstrike_s2s posture rule.
```
7 changes: 6 additions & 1 deletion docs/resources/device_posture_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ resource "cloudflare_device_posture_rule" "eaxmple" {
}
}
```

<!-- schema generated by tfplugindocs -->

## Schema

### Required
Expand All @@ -55,6 +57,7 @@ resource "cloudflare_device_posture_rule" "eaxmple" {
- `id` (String) The ID of this resource.

<a id="nestedblock--input"></a>

### Nested Schema for `input`

Optional:
Expand All @@ -74,6 +77,7 @@ Optional:
- `infected` (Boolean) True if SentinelOne device is infected.
- `is_active` (Boolean) True if SentinelOne device is active.
- `issue_count` (String) The number of issues for kolide.
- `last_seen` (String) The duration of time that the host was last seen from Crowdstrike. Must be in the format `1h` or `30m`. Valid units are `d`, `h` and `m`.
- `network_status` (String) The network status from SentinelOne. Available values: `connected`, `disconnected`, `disconnecting`, `connecting`.
- `operator` (String) The version comparison operator. Available values: `>`, `>=`, `<`, `<=`, `==`.
- `os` (String) OS signal score from Crowdstrike. Value must be between 1 and 100.
Expand All @@ -86,13 +90,14 @@ Optional:
- `running` (Boolean) Checks if the application should be running.
- `sensor_config` (String) Sensor signal score from Crowdstrike. Value must be between 1 and 100.
- `sha256` (String) The sha256 hash of the file.
- `state` (String) The host’s current online status from Crowdstrike. Available values: `online`, `offline`, `unknown`.
- `thumbprint` (String) The thumbprint of the file certificate.
- `total_score` (Number) The total score from Tanium.
- `version` (String) The operating system semantic version.
- `version_operator` (String) The version comparison operator for crowdstrike. Available values: `>`, `>=`, `<`, `<=`, `==`.


<a id="nestedblock--match"></a>

### Nested Schema for `match`

Optional:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ func setDevicePostureRuleInput(rule *cloudflare.DevicePostureRule, d *schema.Res
if versionOperator, ok := d.GetOk("input.0.version_operator"); ok {
input.VersionOperator = versionOperator.(string)
}
if state, ok := d.GetOk("input.0.state"); ok {
input.State = state.(string)
}
if last_seen, ok := d.GetOk("input.0.last_seen"); ok {
input.LastSeen = last_seen.(string)
}
if countOperator, ok := d.GetOk("input.0.count_operator"); ok {
input.CountOperator = countOperator.(string)
}
Expand Down
11 changes: 11 additions & 0 deletions internal/sdkv2provider/schema_cloudflare_device_posture_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ func resourceCloudflareDevicePostureRuleSchema() map[string]*schema.Schema {
ValidateFunc: validation.StringInSlice([]string{">", ">=", "<", "<=", "=="}, true),
Description: fmt.Sprintf("The version comparison operator for crowdstrike. %s", renderAvailableDocumentationValuesStringSlice([]string{">", ">=", "<", "<=", "=="})),
},
"last_seen": {
Type: schema.TypeString,
Optional: true,
Description: "The duration of time that the host was last seen from Crowdstrike. Must be in the format `1h` or `30m`. Valid units are `d`, `h` and `m`.",
},
"state": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"online", "offline", "unknown"}, true),
Description: fmt.Sprintf("The host’s current online status from Crowdstrike. %s", renderAvailableDocumentationValuesStringSlice([]string{"online", "offline", "unknown"})),
},
"count_operator": {
Type: schema.TypeString,
Optional: true,
Expand Down