Update a device posture rule
zero_trust.devices.posture.update(strrule_id, PostureUpdateParams**kwargs) -> DevicePostureRule
PUT/accounts/{account_id}/devices/posture/{rule_id}
Updates a device posture rule.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Update a device posture rule
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
device_posture_rule = client.zero_trust.devices.posture.update(
rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
account_id="699d98642c564d2e855e9661899b7252",
name="Admin Serial Numbers",
type="file",
)
print(device_posture_rule.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
}