-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1842 from dhens/patch-1
- Loading branch information
Showing
11 changed files
with
251 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:note | ||
resource/device_posture_rule: update device posture rule to reflect new linux posture fields | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,91 @@ | ||
--- | ||
layout: "cloudflare" | ||
page_title: "Cloudflare: cloudflare_device_posture_rule" | ||
description: Provides a Cloudflare Device Posture Rule resource. | ||
page_title: "cloudflare_device_posture_rule Resource - Cloudflare" | ||
subcategory: "" | ||
description: |- | ||
Provides a Cloudflare Device Posture Rule resource. Device posture rules configure security policies for device posture checks. | ||
--- | ||
|
||
# cloudflare_device_posture_rule | ||
# cloudflare_device_posture_rule (Resource) | ||
|
||
Provides a Cloudflare Device Posture Rule resource. Device posture rules configure security policies for device posture checks. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "cloudflare_device_posture_rule" "corporate_devices_posture_rule" { | ||
account_id = "1d5fdc9e88c8a8c4518b068cd94331fe" | ||
```terraform | ||
resource "cloudflare_device_posture_rule" "eaxmple" { | ||
account_id = "f037e56e89293a057740de681ac9abbe" | ||
name = "Corporate devices posture rule" | ||
type = "serial_number" | ||
type = "os_version" | ||
description = "Device posture rule for corporate devices." | ||
schedule = "24h" | ||
expiration = "24h" | ||
match { | ||
platform = "mac" | ||
platform = "linux" | ||
} | ||
input { | ||
id = cloudflare_teams_list.corporate_devices.id | ||
id = cloudflare_teams_list.corporate_devices.id | ||
version = "1.0.0" | ||
operator = "<" | ||
os_distro_name = "ubuntu" | ||
os_distro_revision = "1.0.0" | ||
} | ||
} | ||
``` | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
- `account_id` - (Required) The account to which the device posture rule should be added. | ||
- `type` - (Required) The device posture rule type. Valid values are `file`, `application`, and `serial_number`. | ||
- `input` - (Required) The value to be checked against. See below for reference | ||
structure. | ||
- `name` - (Optional) Name of the device posture rule. | ||
- `schedule` - (Optional) Tells the client when to run the device posture check. | ||
Must be in the format `"1h"` or `"30m"`. Valid units are `h` and `m`. | ||
- `expiration` - (Optional) Expire posture results after the specified amount of time. | ||
Must be in the format `"1h"` or `"30m"`. Valid units are `h` and `m`. | ||
- `description` - (Optional) The description of the device posture rule. | ||
- `match` - (Optional) The conditions that the client must match to run the rule. See below for reference structure. | ||
|
||
### Match argument | ||
|
||
The match structure allows the following: | ||
|
||
- `platform` - (Required) The platform of the device. Valid values are `windows`, `mac`, `linux`, `android`, and `ios`. | ||
|
||
### Input argument | ||
### Required | ||
|
||
The input structure depends on the device posture rule type. | ||
- `account_id` (String) The account identifier to target for the resource. | ||
- `type` (String) The device posture rule type. Available values: `serial_number`, `file`, `application`, `gateway`, `warp`, `domain_joined`, `os_version`, `disk_encryption`, `firewall`, `workspace_one`. | ||
|
||
**serial_number** allows the following: | ||
### Optional | ||
|
||
- `id` - (Required) The Teams List id. | ||
- `description` (String) | ||
- `expiration` (String) Expire posture results after the specified amount of time. Must be in the format `1h` or `30m`. Valid units are `h` and `m`. | ||
- `input` (Block List) (see [below for nested schema](#nestedblock--input)) | ||
- `match` (Block List) The conditions that the client must match to run the rule. (see [below for nested schema](#nestedblock--match)) | ||
- `name` (String) Name of the device posture rule. | ||
- `schedule` (String) Tells the client when to run the device posture check. Must be in the format `1h` or `30m`. Valid units are `h` and `m`. | ||
|
||
**file** allows the following: | ||
### Read-Only | ||
|
||
- `path` - (Required) The path to the file. | ||
- `exists` - (Optional) Checks if the file should exist. | ||
- `thumbprint` - (Optional) The thumbprint of the file certificate. | ||
- `sha256` - (Optional) The sha256 hash of the file. | ||
- `id` (String) The ID of this resource. | ||
|
||
**application** allows the following: | ||
<a id="nestedblock--input"></a> | ||
### Nested Schema for `input` | ||
|
||
- `path` - (Required) The path to the application. | ||
- `thumbprint` - (Optional) The thumbprint of the application certificate. | ||
- `running` - (Optional) Checks if the application should be running. | ||
Optional: | ||
|
||
**os_version** allows the following: | ||
- `compliance_status` (String) The workspace one device compliance status. | ||
- `connection_id` (String) The workspace one connection id. | ||
- `domain` (String) The domain that the client must join. | ||
- `enabled` (Boolean) True if the firewall must be enabled. | ||
- `exists` (Boolean) Checks if the file should exist. | ||
- `id` (String) The Teams List id. | ||
- `operator` (String) The version comparison operator. | ||
- `os_distro_name` (String) The operating system excluding version information. | ||
- `os_distro_revision` (String) The operating system version excluding OS name information or release name. | ||
- `path` (String) The path to the file. | ||
- `require_all` (Boolean) True if all drives must be encrypted. | ||
- `running` (Boolean) Checks if the application should be running. | ||
- `sha256` (String) The sha256 hash of the file. | ||
- `thumbprint` (String) The thumbprint of the file certificate. | ||
- `version` (String) The operating system semantic version. | ||
|
||
- `version` = (Required) The operating system semantic version. | ||
- `operator` = (Required) The version comparison operator in (>,>=,<,<=,==) | ||
|
||
**domain_joined** | ||
<a id="nestedblock--match"></a> | ||
### Nested Schema for `match` | ||
|
||
- `domain` = (Required) The domain that the client must join. | ||
Optional: | ||
|
||
**firewall** | ||
|
||
- `enabled` = (Required) True if the firewall must be enabled. | ||
|
||
**disk_encryption** | ||
|
||
- `require_all` = (Required) True if all drives must be encrypted. | ||
|
||
## Attributes Reference | ||
|
||
The following additional attributes are exported: | ||
|
||
- `id` - ID of the device posture rule. | ||
- `platform` (String) The platform of the device. Available values: `windows`, `mac`, `linux`, `android`, `ios`. | ||
|
||
## Import | ||
|
||
Device posture rules can be imported using a composite ID formed of account | ||
ID and device posture rule ID. | ||
|
||
``` | ||
$ terraform import cloudflare_device_posture_rule.corporate_devices cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e | ||
Import is supported using the following syntax: | ||
```shell | ||
$ terraform import cloudflare_device_posture_rule.example <account_id>/<device_posture_rule_id> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ terraform import cloudflare_device_posture_rule.example <account_id>/<device_posture_rule_id> |
20 changes: 20 additions & 0 deletions
20
examples/resources/cloudflare_device_posture_rule/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "cloudflare_device_posture_rule" "eaxmple" { | ||
account_id = "f037e56e89293a057740de681ac9abbe" | ||
name = "Corporate devices posture rule" | ||
type = "os_version" | ||
description = "Device posture rule for corporate devices." | ||
schedule = "24h" | ||
expiration = "24h" | ||
|
||
match { | ||
platform = "linux" | ||
} | ||
|
||
input { | ||
id = cloudflare_teams_list.corporate_devices.id | ||
version = "1.0.0" | ||
operator = "<" | ||
os_distro_name = "ubuntu" | ||
os_distro_revision = "1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.