Create a device posture rule
Creates a new device posture rule.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
Zero Trust WriteParametersExpand Collapse
params DevicePostureNewParams
Type param.Field[DevicePostureNewParamsType]Body param: The type of device posture rule.
Body param: The type of device posture rule.
Body param: Sets the expiration time for a posture check result. If empty, the result remains valid until it is overwritten by new data from the WARP client.
ReturnsExpand Collapse
type DevicePostureRule struct{…}
Sets the expiration time for a posture check result. If empty, the result remains valid until it is overwritten by new data from the WARP client.
The value to be checked against.
The value to be checked against.
type UniqueClientIDInput struct{…}
type DeviceInputTeamsDevicesCarbonblackInputRequest struct{…}
OperatingSystem DeviceInputTeamsDevicesCarbonblackInputRequestOperatingSystemOperating system.
Operating system.
type DeviceInputTeamsDevicesApplicationInputRequest struct{…}
OperatingSystem DeviceInputTeamsDevicesApplicationInputRequestOperatingSystemOperating system.
Operating system.
type DeviceInputTeamsDevicesClientCertificateV2InputRequest struct{…}
Confirm the certificate was not imported from another device. We recommend keeping this enabled unless the certificate was deployed without a private key.
OperatingSystem DeviceInputTeamsDevicesClientCertificateV2InputRequestOperatingSystemOperating system.
Operating system.
Certificate Common Name. This may include one or more variables in the ${ } notation. Only ${serial_number} and ${hostname} are valid variables.
ExtendedKeyUsage []DeviceInputTeamsDevicesClientCertificateV2InputRequestExtendedKeyUsageOptionalList of values indicating purposes for which the certificate public key can be used.
List of values indicating purposes for which the certificate public key can be used.
Locations DeviceInputTeamsDevicesClientCertificateV2InputRequestLocationsOptional
TrustStores []DeviceInputTeamsDevicesClientCertificateV2InputRequestLocationsTrustStoreOptionalList of trust stores to check for client certificate.
List of trust stores to check for client certificate.
type WorkspaceOneInput struct{…}
type CrowdstrikeInput struct{…}
For more details on last seen, please refer to the Crowdstrike documentation.
State CrowdstrikeInputStateOptionalFor more details on state, please refer to the Crowdstrike documentation.
For more details on state, please refer to the Crowdstrike documentation.
type IntuneInput struct{…}
type KolideInput struct{…}
type TaniumInput struct{…}
type SentineloneS2sInput struct{…}
NetworkStatus SentineloneS2sInputNetworkStatusOptionalNetwork status of device.
Network status of device.
OperationalState SentineloneS2sInputOperationalStateOptionalAgent operational state.
Agent operational state.
type DeviceInputTeamsDevicesCustomS2sInputRequest struct{…}
Operator DeviceInputTeamsDevicesCustomS2sInputRequestOperatorOperator.
Operator.
The conditions that the client must match to run the rule.
The conditions that the client must match to run the rule.
Polling frequency for the WARP client posture check. Default: 5m (poll every five minutes). Minimum: 1m.
Create a device posture rule
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/cloudflare-go"
"github.com/stainless-sdks/cloudflare-go/option"
"github.com/stainless-sdks/cloudflare-go/zero_trust"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
devicePostureRule, err := client.ZeroTrust.Devices.Posture.New(context.TODO(), zero_trust.DevicePostureNewParams{
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
Name: cloudflare.F("Admin Serial Numbers"),
Type: cloudflare.F(zero_trust.DevicePostureNewParamsTypeFile),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", devicePostureRule.ID)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"description": "The rule for admin serial numbers",
"expiration": "1h",
"input": {
"operating_system": "linux",
"path": "/bin/cat",
"exists": true,
"sha256": "https://api.us-2.crowdstrike.com",
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"
},
"match": [
{
"platform": "windows"
}
],
"name": "Admin Serial Numbers",
"schedule": "1h",
"type": "file"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
"description": "The rule for admin serial numbers",
"expiration": "1h",
"input": {
"operating_system": "linux",
"path": "/bin/cat",
"exists": true,
"sha256": "https://api.us-2.crowdstrike.com",
"thumbprint": "0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"
},
"match": [
{
"platform": "windows"
}
],
"name": "Admin Serial Numbers",
"schedule": "1h",
"type": "file"
},
"success": true
}