Skip to main content
POST
/
api
/
analysis
/
results
/
iac
Get IaC Scan Results
curl --request POST \
  --url https://api.codeant.ai/api/analysis/results/iac \
  --header 'Content-Type: application/json' \
  --data '{
  "repo": "owner/repository",
  "commit_id": "abc123def456",
  "access_token": "ghp_xxxxxxxxxxxx",
  "service": "github"
}'
{
  "results": [
    {
      "check_type": "terraform",
      "results": {
        "failed_checks": [
          {
            "bc_check_id": "BC_AWS_NETWORKING_31",
            "check_id": "CKV_AWS_23",
            "check_name": "Ensure every security group and rule has a description",
            "file_path": "/owner/repository/abc123def456/terraform/main.tf",
            "file_line_range": [
              2,
              25
            ],
            "check_class": "checkov.terraform.checks.resource.aws.SecurityGroupRuleDescription",
            "code_block": [
              [
                2,
                "resource \"aws_security_group\" \"web\" {\n"
              ],
              [
                3,
                "  name_prefix = \"web-sg\"\n"
              ],
              [
                4,
                "\n"
              ],
              [
                5,
                "  ingress {\n"
              ],
              [
                6,
                "    from_port   = 22\n"
              ],
              [
                7,
                "    to_port     = 22\n"
              ],
              [
                8,
                "    protocol    = \"tcp\"\n"
              ],
              [
                9,
                "    cidr_blocks = [\"0.0.0.0/0\"]\n"
              ],
              [
                10,
                "  }\n"
              ],
              [
                11,
                "\n"
              ],
              [
                12,
                "  ingress {\n"
              ],
              [
                13,
                "    from_port   = 80\n"
              ],
              [
                14,
                "    to_port     = 80\n"
              ],
              [
                15,
                "    protocol    = \"tcp\"\n"
              ],
              [
                16,
                "    cidr_blocks = [\"0.0.0.0/0\"]\n"
              ],
              [
                17,
                "  }\n"
              ],
              [
                18,
                "\n"
              ],
              [
                19,
                "  egress {\n"
              ],
              [
                20,
                "    from_port   = 0\n"
              ],
              [
                21,
                "    to_port     = 0\n"
              ],
              [
                22,
                "    protocol    = \"-1\"\n"
              ],
              [
                23,
                "    cidr_blocks = [\"0.0.0.0/0\"]\n"
              ],
              [
                24,
                "  }\n"
              ],
              [
                25,
                "}\n"
              ]
            ],
            "resource": "aws_security_group.web",
            "start_line": 2,
            "end_line": 25
          }
        ]
      }
    }
  ]
}

Body

application/json
repo
string
required

Repository identifier (format varies by service)

Example:

"owner/repository"

commit_id
string
required

Git commit SHA or identifier

Example:

"abc123def456"

access_token
string
required

Authentication token for the service

Example:

"ghp_xxxxxxxxxxxx"

service
enum<string>
required

Version control service provider

Available options:
github,
azuredevops,
gitlab,
bitbucket
Example:

"github"

gitlab_base_url
string

Base URL for the service (optional for GitHub, required for GitLab)

Example:

"https://gitlab.com"

Response

IaC scan results retrieved successfully

Infrastructure as Code (IaC) scanning response containing security check results

results
object[]

List of IaC scan results by check type