Exemption Rules
Manage admin-defined rules that gate Exemption creation
List a collection of Exemption Rules
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Page number to fetch (starting from 0)
0Example: 4Number of results per page
30Example: 50Harness personal or service access token
Aliquam quae illum ullam nisi.OK response.
BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
GET /gateway/sto/api/v2/exemption-rules?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"pagination": {
"link": "",
"page": 4,
"pageSize": 20,
"totalItems": 230,
"totalPages": 12
},
"results": [
{
"actions": {
"duration": {
"maxDurationDays": 3
}
},
"conditions": {
"epss_score": {
"gte": 90
},
"reachable": true,
"severity_code": [
"Critical"
]
},
"created": 1651578240,
"createdBy": "user111111111111111111",
"description": "Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.",
"enabled": true,
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"lastModifiedBy": "user111111111111111111",
"name": "Critical reachable issues: 3 days max",
"priority": 0
},
{
"actions": {
"duration": {
"maxDurationDays": 3
}
},
"conditions": {
"epss_score": {
"gte": 90
},
"reachable": true,
"severity_code": [
"Critical"
]
},
"created": 1651578240,
"createdBy": "user111111111111111111",
"description": "Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.",
"enabled": true,
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"lastModifiedBy": "user111111111111111111",
"name": "Critical reachable issues: 3 days max",
"priority": 0
}
]
}Create a new Exemption Rule
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness personal or service access token
Voluptas maiores quos quia omnis aut mollitia.Free-form rule description.
Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle.
trueHuman-readable rule name. Must be unique within an account.
Critical reachable issues: 3 days max0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.
0Harness User ID
abcdef1234567890ghijklOK response.
Resource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
POST /gateway/sto/api/v2/exemption-rules?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 361
{
"actions": {
"duration": {
"maxDurationDays": 3
}
},
"conditions": {
"epss_score": {
"gte": 90
},
"reachable": true,
"severity_code": [
"Critical"
]
},
"description": "Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.",
"enabled": true,
"name": "Critical reachable issues: 3 days max",
"priority": 0,
"userId": "abcdef1234567890ghijkl"
}{
"id": "abcdef1234567890ghijkl"
}Find Exemption Rule by ID
The ID of the Exemption Rule to retrieve
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness personal or service access token
Dolores sapiente enim omnis rerum qui.OK response.
An admin-defined rule that gates Exemption creation and approval. Rules are evaluated against an exemption request; if a rule matches, its actions fire — typically capping the requested duration.
Unix timestamp at which the resource was created
1651578240ID of the user who created the rule.
user111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Free-form rule description.
Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle.
trueResource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Unix timestamp at which the resource was most recently modified
1651578240ID of the user who last modified the rule.
user111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Human-readable rule name. Must be unique within an account.
Critical reachable issues: 3 days max0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.
0BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
GET /gateway/sto/api/v2/exemption-rules/{id}?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"actions": {
"duration": {
"maxDurationDays": 3
}
},
"conditions": {
"epss_score": {
"gte": 90
},
"reachable": true,
"severity_code": [
"Critical"
]
},
"created": 1651578240,
"createdBy": "user111111111111111111",
"description": "Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.",
"enabled": true,
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"lastModifiedBy": "user111111111111111111",
"name": "Critical reachable issues: 3 days max",
"priority": 0
}Update an existing Exemption Rule
The ID of the Exemption Rule to update
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness personal or service access token
Qui et.Free-form rule description.
Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle.
trueHuman-readable rule name. Must be unique within an account.
Critical reachable issues: 3 days max0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.
0Harness User ID
abcdef1234567890ghijklOK response.
An admin-defined rule that gates Exemption creation and approval. Rules are evaluated against an exemption request; if a rule matches, its actions fire — typically capping the requested duration.
Unix timestamp at which the resource was created
1651578240ID of the user who created the rule.
user111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Free-form rule description.
Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle.
trueResource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Unix timestamp at which the resource was most recently modified
1651578240ID of the user who last modified the rule.
user111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Human-readable rule name. Must be unique within an account.
Critical reachable issues: 3 days max0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.
0BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
PUT /gateway/sto/api/v2/exemption-rules/{id}?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 361
{
"actions": {
"duration": {
"maxDurationDays": 3
}
},
"conditions": {
"epss_score": {
"gte": 90
},
"reachable": true,
"severity_code": [
"Critical"
]
},
"description": "Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.",
"enabled": true,
"name": "Critical reachable issues: 3 days max",
"priority": 0,
"userId": "abcdef1234567890ghijkl"
}{
"actions": {
"duration": {
"maxDurationDays": 3
}
},
"conditions": {
"epss_score": {
"gte": 90
},
"reachable": true,
"severity_code": [
"Critical"
]
},
"created": 1651578240,
"createdBy": "user111111111111111111",
"description": "Critical findings that are reachable in production must be remediated quickly; cap exemptions at 3 days.",
"enabled": true,
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"lastModifiedBy": "user111111111111111111",
"name": "Critical reachable issues: 3 days max",
"priority": 0
}Evaluate the exemption rule engine and return the strictest constraint that applies to an exemption request. Pass items[] (max 100); a single exemption is just a one-element list. Each item self-describes its own scope and kind:
• target-scoped issue: set targetId. • pipeline-scoped issue: set pipelineId (mutually exclusive with targetId). • project-scoped issue: set neither (scope comes from the request-level orgId/projectId). • occurrence-level: set occurrences[], or set scanId (with targetId) to evaluate all non-exempted occurrences from that scan — used when "Exempt all future occurrences" is unchecked.
Items in a single batch may mix scopes and kinds freely. The response carries the strictest matched constraint across everything evaluated: maxDurationDays is the minimum of every non-null per-item cap (or null if all are unconstrained), and matchedRuleId names the rule contributing that minimum. Optional type carries the FE "Reason" dropdown value (same enum as POST /exemptions.type) so rules with reason conditions evaluate correctly.
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness personal or service access token
Perferendis earum incidunt laborum libero dignissimos.Harness Organization id this exemption request is scoped to. Required: the backend resolves the project hierarchy (parent_unique_id) from orgId/projectId to scope attribute resolution for project- and pipeline-level evaluation, and rules conditioned on org_id evaluate correctly.
defaultPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project id this exemption request is scoped to. Required: the backend resolves the project hierarchy (parent_unique_id) from orgId/projectId to scope attribute resolution for project- and pipeline-level evaluation, and rules conditioned on project_id evaluate correctly.
my_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Value of the FE's "Reason" dropdown — i.e. the same enum sent as type on POST /exemptions ("False Positive", "Acceptable Risk", "Compensating Controls", "Acceptable Use", "Fix Unavailable", "Other"). When set, it is merged into every issue's context so rules with reason conditions evaluate correctly. Omit if the user has not picked from the dropdown yet — rules with reason conditions will be skipped in that case. Named type here for parity with POST /exemptions.type; internally the rule engine surfaces it as the reason axis (which matches the FE dropdown label customers see).
False PositivePossible values: OK response.
Constraints that apply to an exemption request for a specific issue, computed by evaluating account-level exemption rules against the issue's attributes.
ID of the rule that fired. Empty string if no rule matched (request is unconstrained by policy).
rule11111111111111111aMaximum duration in days that this exemption may run. Null means no cap and indefinite ("All Time") is allowed; a non-null value forbids "All Time".
7BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
POST /gateway/sto/api/v2/exemption-rules/constraints?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 552
{
"items": [
{
"issueId": "abcdef1234567890ghijkl",
"occurrences": [
101,
102
],
"pipelineId": "my_pipeline",
"scanId": "abcdef1234567890ghijkl",
"targetId": "abcdef1234567890ghijkl"
},
{
"issueId": "abcdef1234567890ghijkl",
"occurrences": [
101,
102
],
"pipelineId": "my_pipeline",
"scanId": "abcdef1234567890ghijkl",
"targetId": "abcdef1234567890ghijkl"
},
{
"issueId": "abcdef1234567890ghijkl",
"occurrences": [
101,
102
],
"pipelineId": "my_pipeline",
"scanId": "abcdef1234567890ghijkl",
"targetId": "abcdef1234567890ghijkl"
}
],
"orgId": "default",
"projectId": "my_project",
"type": "False Positive"
}{
"matchedRuleId": "rule11111111111111111a",
"maxDurationDays": 7
}Last updated
Was this helpful?