Skip to content

Commit

Permalink
RLP-153906 Get Policy Remediation endpoint (#814)
Browse files Browse the repository at this point in the history
* RLP-153906 Add Get Policy Remediation endpoint

* Remove unused schemas for remediation endpoint RLP-153906
  • Loading branch information
jrdevore authored Jan 21, 2025
1 parent 2c2b851 commit 5da8688
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 0 deletions.
1 change: 1 addition & 0 deletions openapi-specs/cspm/consolidated_spec/all_endpoints.csv
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@
"post","/adoptionadvisor/api/v2/compute/discovered-secured/trend","Get Discovered and Secured Resources","value-widgets-get-discovered-vs-secured","Widgets","Monolith"
"get","/c2c/api/v1/deploy/trend","List Deploy Trend","code-to-cloud-list-deploy-trend","Code to Cloud","code2cloudMicroService.json"
"get","/c2c/api/v1/runtime/trend","List Runtime Trend","code-to-cloud-list-runtime-trend","Code to Cloud","code2cloudMicroService.json"
"get","/policy/api/v1/fetch/remediation/{policyId}","Get Policy Remediation","getRemediationForPolicy","Alerts","Monolith"
"get","/appid/api/v1/satellite","List Cluster Details","listClusters","Settings","Monolith"
"post","/appid/api/v1/satellite","Add Satellite Details","addClusterInfo","Settings","Monolith"
"delete","/appid/api/v1/satellite/{id}","Delete Satellite Details","deleteCluster","Settings","Monolith"
267 changes: 267 additions & 0 deletions openapi-specs/cspm/pia-openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
{
"openapi": "3.0.1",
"info": {
"title": "OpenAPI definition",
"version": "v0"
},
"servers": [
{
"url": "https://api.prismacloud.io"
},
{
"url": "https://api2.prismacloud.io"
},
{
"url": "https://api3.prismacloud.io"
},
{
"url": "https://api4.prismacloud.io"
},
{
"url": "https://api.anz.prismacloud.io"
},
{
"url": "https://api.eu.prismacloud.io"
},
{
"url": "https://api2.eu.prismacloud.io"
},
{
"url": "https://api.gov.prismacloud.io"
},
{
"url": "https://api.prismacloud.cn"
},
{
"url": "https://api.ca.prismacloud.io"
},
{
"url": "https://api.sg.prismacloud.io"
},
{
"url": "https://api.uk.prismacloud.io"
},
{
"url": "https://api.ind.prismacloud.io"
},
{
"url": "https://api.jp.prismacloud.io"
},
{
"url": "https://api.fr.prismacloud.io"
}
],
"tags": [
{
"name": "Alerts",
"description": "..."
}
],
"paths": {
"/policy/api/v1/fetch/remediation/{policyId}": {
"get": {
"tags": [
"Alerts"
],
"summary": "Get Policy Remediation",
"description": "Fetch AI Assisted Remediation and Recommendation content for a given policy. If AI Assisted Remediation is not available, fetch the recommendation content instead. The remediation typically includes actionable steps to mitigate or remediate the identified alert on the asset.",
"operationId": "getRemediationForPolicy",
"parameters": [
{
"name": "policyId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "unifiedAssetId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "alertId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyWithRemediationResponse"
}
}
}
},
"400": {
"description": "bad_request"
},
"401": {
"description": "unauthorized_access"
},
"403": {
"description": "permission_error"
},
"429": {
"description": "too_many_requests"
}
},
"x-public": "true",
"security": [
{
"x-redlock-auth": []
}
]
}
}
},
"components": {
"schemas": {
"AiRemediation": {
"type": "object",
"properties": {
"manualRemediation": {
"$ref": "#/components/schemas/ManualRemediation"
},
"cli": {
"type": "array",
"description": "The suggested CLI-based remediation steps",
"items": {
"$ref": "#/components/schemas/ScriptRemediation"
}
},
"tf": {
"type": "array",
"description": "The suggested Terraform-based remediation steps",
"items": {
"$ref": "#/components/schemas/ScriptRemediation"
}
}
}
},
"ManualRemediation": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "A title for the manual remediation steps"
},
"description": {
"type": "string",
"description": "A description of the remediation content"
},
"instructions": {
"type": "string",
"description": "Detailed instructions to manually remediate the issue"
},
"impact": {
"type": "string",
"description": "The potential impact of applying the remediation"
}
},
"description": "The manual remediation steps to be taken"
},
"PolicyWithRemediation": {
"type": "object",
"properties": {
"policyId": {
"type": "string"
},
"policyName": {
"type": "string"
},
"policyType": {
"type": "string"
},
"cloudType": {
"type": "string",
"enum": [
"all",
"aws",
"azure",
"gcp",
"alibaba_cloud",
"oci",
"other",
"ibm"
]
},
"findingTypes": {
"uniqueItems": true,
"type": "array",
"items": {
"type": "string"
}
},
"aiRemediation": {
"$ref": "#/components/schemas/AiRemediation"
},
"recommendation": {
"type": "string"
},
"hasSearchExecutionSupport": {
"type": "boolean"
},
"savedSearchId": {
"type": "string"
}
}
},
"PolicyWithRemediationResponse": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PolicyWithRemediation"
}
}
}
},
"ScriptRemediation": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "A title for the remediation script to be executed"
},
"description": {
"type": "string",
"description": "A description of the remediation content"
},
"codeBlock": {
"type": "string",
"description": "The suggested code block to be executed for remediation"
},
"impact": {
"type": "string",
"description": "The potential impact of applying the remediation"
},
"automated": {
"type": "boolean",
"description": "can be executed automatically without manual intervention"
}
},
"description": "The suggested Terraform-based remediation steps"
}
},
"securitySchemes": {
"x-redlock-auth": {
"description": "The x-redlock-auth value is a JSON Web Token (JWT).",
"in": "header",
"name": "x-redlock-auth",
"type": "apiKey"
}
}
}
}

0 comments on commit 5da8688

Please sign in to comment.