Fix Infrastructure as Code Configuration Errors
POST/code/api/v1/fixes/checkov
Suggest a fix for infrastructure as code configuration errors that are found in the request files.
Request
- application/json
Body
arrayrequired
- Array [
- Array [
- ]
- ]
errors object[]required
Data regarding the resource on which the fix will be applied
endLine doublerequired
Resource's end line in the file
policyId stringrequired
Check ID which is being fixed
resourceId stringrequired
Representation of the resource ID which is a combination of "resource type"."resource name"
startLine doublerequired
Resource's start line in the file
fileContent stringrequired
Content of the file on which the fix will be appiled
filePath stringrequired
framework stringrequired
Framework on which the fix will be applied, e.g. terraform or cloudformation
Responses
- 200
- 422
Fixes for checkov errors
- application/json
- Schema
- Example (from schema)
- Example 1
Schema
- Array [
- Array [
- ]
- ]
filePath stringrequired
fixes object[]required
fixedDefinition stringrequired
originalEndLine doublerequired
originalStartLine doublerequired
policyId stringrequired
resourceId stringrequired
[
{
"filePath": "string",
"fixes": [
{
"fixedDefinition": "string",
"originalEndLine": 0,
"originalStartLine": 0,
"policyId": "string",
"resourceId": "string"
}
]
}
]
[
{
"filePath": "/aws/ec2.tf",
"fixes": [
{
"fixedDefinition": "resource \"aws_ebs_volume\" \"web_host_storage\" {\n # unencrypted volume\n availability_zone = \"${var.availability_zone}\"\n #encrypted = false # Setting this causes the volume to be recreated on apply \n size = 1\n tags = {\n Name = \"${local.resource_prefix.value}-ebs\"\n }\n encrypted = true\n}\n",
"originalEndLine": 33,
"originalStartLine": 25,
"policyId": "BC_AWS_GENERAL_3",
"resourceId": "aws_ebs_volume.web_host_storage"
}
]
}
]
Request arguments validation error
Loading...