List device posture rules
zero_trust.devices.posture.list(PostureListParams**kwargs) -> SyncSinglePage[DevicePostureRule]
GET/accounts/{account_id}/devices/posture
Fetches device posture rules for a Zero Trust account.
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:
List device posture rules
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
page = client.zero_trust.devices.posture.list(
account_id="699d98642c564d2e855e9661899b7252",
)
page = page.result[0]
print(page.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,
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000
}
}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,
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000
}
}