Policies
REST API operations for policies
Overview
Use these API operations to interact with policies in Panther.
To call the API, see the How to use the Panther REST API instructions—including directions for how to invoke it directly from this documentation page.
Required permissions
For
GET
operations, your API token must have theView Policies
permission.For
POST
,PUT
, andDELETE
operations, your API token must have theManage Policies
permission.
Operations
set this field to false to exclude running tests prior to saving
true
set this field to true if you want to run tests without saving
false
The python body of the policy
The description of the policy
The display name of the policy
Determines whether or not the policy is active
The id of the policy
Determines if the policy is managed by panther
Resource types
Resources to ignore via a pattern that matches the resource id
["aws::s3::*"]
The tags for the policy
OK response.
No Content response.
bad_request: Bad Request response.
exists: Conflict response.
POST /policies HTTP/1.1
Host: your-api-host
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 346
{
"body": "text",
"description": "text",
"displayName": "text",
"enabled": true,
"id": "text",
"managed": true,
"reports": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"resourceTypes": [
"text"
],
"severity": "INFO",
"suppressions": [
"aws::s3::*"
],
"tags": [
"text"
],
"tests": [
{
"expectedResult": true,
"mocks": [
{
"ANY_ADDITIONAL_PROPERTY": "text"
}
],
"name": "text",
"resource": "text"
}
]
}
{
"body": "text",
"createdAt": "text",
"description": "text",
"displayName": "text",
"enabled": true,
"id": "text",
"lastModified": "text",
"managed": true,
"reports": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"resourceTypes": [
"text"
],
"severity": "INFO",
"suppressions": [
"aws::s3::*"
],
"tags": [
"text"
],
"tests": [
{
"expectedResult": true,
"mocks": [
{
"ANY_ADDITIONAL_PROPERTY": "text"
}
],
"name": "text",
"resource": "text"
}
]
}
the id of the policy to fetch
OK response.
not_found: Not Found response.
GET /policies/{id} HTTP/1.1
Host: your-api-host
X-API-Key: YOUR_API_KEY
Accept: */*
{
"body": "text",
"createdAt": "text",
"description": "text",
"displayName": "text",
"enabled": true,
"id": "text",
"lastModified": "text",
"managed": true,
"reports": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"resourceTypes": [
"text"
],
"severity": "INFO",
"suppressions": [
"aws::s3::*"
],
"tags": [
"text"
],
"tests": [
{
"expectedResult": true,
"mocks": [
{
"ANY_ADDITIONAL_PROPERTY": "text"
}
],
"name": "text",
"resource": "text"
}
]
}
put creates or updates a policy
the id of the policy
set this field to false to exclude running tests prior to saving
true
set this field to true if you want to run tests without saving
false
The python body of the policy
The description of the policy
The display name of the policy
Determines whether or not the policy is active
The id of the policy
Determines if the policy is managed by panther
Resource types
Resources to ignore via a pattern that matches the resource id
["aws::s3::*"]
The tags for the policy
200 returned if the item already existed
201 returned if the item was created
No Content response.
bad_request: Bad Request response.
PUT /policies/{id} HTTP/1.1
Host: your-api-host
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 346
{
"body": "text",
"description": "text",
"displayName": "text",
"enabled": true,
"id": "text",
"managed": true,
"reports": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"resourceTypes": [
"text"
],
"severity": "INFO",
"suppressions": [
"aws::s3::*"
],
"tags": [
"text"
],
"tests": [
{
"expectedResult": true,
"mocks": [
{
"ANY_ADDITIONAL_PROPERTY": "text"
}
],
"name": "text",
"resource": "text"
}
]
}
{
"body": "text",
"createdAt": "text",
"description": "text",
"displayName": "text",
"enabled": true,
"id": "text",
"lastModified": "text",
"managed": true,
"reports": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"resourceTypes": [
"text"
],
"severity": "INFO",
"suppressions": [
"aws::s3::*"
],
"tags": [
"text"
],
"tests": [
{
"expectedResult": true,
"mocks": [
{
"ANY_ADDITIONAL_PROPERTY": "text"
}
],
"name": "text",
"resource": "text"
}
]
}
ID of the policy to delete
No Content response.
bad_request: Bad Request response.
not_found: Not Found response.
DELETE /policies/{id} HTTP/1.1
Host: your-api-host
X-API-Key: YOUR_API_KEY
Accept: */*
No content
the pagination token
the maximum results to return
100
OK response.
GET /policies HTTP/1.1
Host: your-api-host
X-API-Key: YOUR_API_KEY
Accept: */*
OK response.
{
"next": "text",
"results": [
{
"body": "text",
"createdAt": "text",
"description": "text",
"displayName": "text",
"enabled": true,
"id": "text",
"lastModified": "text",
"managed": true,
"reports": {
"ANY_ADDITIONAL_PROPERTY": [
"text"
]
},
"resourceTypes": [
"text"
],
"severity": "INFO",
"suppressions": [
"aws::s3::*"
],
"tags": [
"text"
],
"tests": [
{
"expectedResult": true,
"mocks": [
{
"ANY_ADDITIONAL_PROPERTY": "text"
}
],
"name": "text",
"resource": "text"
}
]
}
]
}
Last updated
Was this helpful?