Policy Set
Policy sets, attachments and exemptions drive Policy Governance. They are JSON:API resources under an organization and are also available through the GraphQL endpoint. Creating or changing them requires the Manage Policies team permission.
Policy set (policy_set)
data.attributes.name
string
Unique name within the organization
data.attributes.description
string
OPTIONAL
data.attributes.enforcementLevel
string
hard_mandatory, soft_mandatory or advisory
data.attributes.shadowEnforcementLevel
string
OPTIONAL. Counted and shown, never blocks
data.attributes.overrideTeam
string
Team allowed to override soft_mandatory violations
data.attributes.global
boolean
Apply to every workspace in the organization
data.attributes.repository / branch / folder
string
Git location of the Rego
data.attributes.opaVersion
string
OPTIONAL OPA version
data.relationships.vcs
object
VCS connection used to clone the repository
Policy attachment (policy_attachment)
Attaches a non-global policy set to exactly one of workspace, project or tag (relationships), plus policySet.
Policy exemption (policy_exemption)
data.attributes.ruleId
string
Rule to waive
data.attributes.ticketReference
string
Reference for the audit trail
data.attributes.justification
string
Why the rule is waived
data.attributes.expiresAt
date
OPTIONAL expiry
data.relationships.policySet
object
Policy set the rule belongs to
data.relationships.workspace / project
object
OPTIONAL scope; omit both for an organization-wide exemption
Overrides of soft_mandatory violations are made from the run page. A run's evaluation results are available as policy_evaluation records.
Supported Operations
Returns the collection of type policy_set
Filters the collection of policy_set using a 'disjoint' RSQL expression
Filters the collection of policy_set using a 'joined' RSQL expression
Number of pages to return. Can be used with page[size]
Number of elements per page. Can be used with page[number]
Offset from 0 to start paginating. Can be used with page[limit]
Maximum number of items to return. Can be used with page[offset]
For requesting total pages/records be included in the response page meta data
Successful response
GET /api/v1/policy_set HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
{
"data": [
{
"type": "text",
"id": "text",
"attributes": {
"branch": null,
"createdBy": null,
"createdDate": null,
"description": null,
"enforcementLevel": null,
"folder": null,
"global": null,
"name": null,
"opaVersion": null,
"overrideTeam": null,
"repository": null,
"shadowEnforcementLevel": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"attachments": {
"data": [
null
]
},
"exemptions": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"parameters": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
}
}
}
],
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Creates an item of type policy_set
Successful response
POST /api/v1/policy_set HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 585
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"branch": null,
"createdBy": null,
"createdDate": null,
"description": null,
"enforcementLevel": null,
"folder": null,
"global": null,
"name": null,
"opaVersion": null,
"overrideTeam": null,
"repository": null,
"shadowEnforcementLevel": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"attachments": {
"data": [
null
]
},
"exemptions": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"parameters": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"branch": null,
"createdBy": null,
"createdDate": null,
"description": null,
"enforcementLevel": null,
"folder": null,
"global": null,
"name": null,
"opaVersion": null,
"overrideTeam": null,
"repository": null,
"shadowEnforcementLevel": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"attachments": {
"data": [
null
]
},
"exemptions": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"parameters": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Returns an instance of type policy_set
policy_set Identifier
Successful response
GET /api/v1/policy_set/{policy_setId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"branch": null,
"createdBy": null,
"createdDate": null,
"description": null,
"enforcementLevel": null,
"folder": null,
"global": null,
"name": null,
"opaVersion": null,
"overrideTeam": null,
"repository": null,
"shadowEnforcementLevel": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"attachments": {
"data": [
null
]
},
"exemptions": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"parameters": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Modifies an instance of type policy_set
policy_set Identifier
Successful response
No content
PATCH /api/v1/policy_set/{policy_setId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 585
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"branch": null,
"createdBy": null,
"createdDate": null,
"description": null,
"enforcementLevel": null,
"folder": null,
"global": null,
"name": null,
"opaVersion": null,
"overrideTeam": null,
"repository": null,
"shadowEnforcementLevel": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"attachments": {
"data": [
null
]
},
"exemptions": {
"data": [
null
]
},
"notificationConfiguration": {
"data": [
null
]
},
"organization": {
"data": [
null
]
},
"parameters": {
"data": [
null
]
},
"vcs": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Successful response
No content
Deletes an instance of type policy_set
policy_set Identifier
Successful response
No content
DELETE /api/v1/policy_set/{policy_setId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
No content
Last updated
Was this helpful?