> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get IaC Scan Results

> Retrieves Infrastructure as Code (IaC) security scanning results for a specific repository and commit



## OpenAPI

````yaml /openapi.json post /api/analysis/results/iac
openapi: 3.0.3
info:
  title: CodeAnt AI API
  description: >-
    API for code analysis (SAST, SCA, secrets, IaC) and developer productivity
    metrics. Supports GitHub, GitLab, Bitbucket, and Azure DevOps.
  version: 1.0.0
servers:
  - url: https://api.codeant.ai
    description: Production server
security: []
tags:
  - name: Analysis
    description: Code analysis operations
  - name: Agent Analysis
    description: >-
      AI-powered agent analysis operations. Uses LLM-based code exploration
      agents to perform deep security threat hunting, bug finding, and custom
      analysis with reflection-based false positive filtering.
  - name: Developer Metrics — Teams
    description: >-
      Manage developer teams: create, update, delete teams and manage team
      membership. Teams are used to organize developers and scope metrics.
  - name: Developer Metrics
    description: >-
      Developer productivity and activity metrics: active developers, PR
      throughput, individual comparisons, and AI-generated summaries. All
      endpoints support GitHub, GitLab, Bitbucket, and Azure DevOps.
paths:
  /api/analysis/results/iac:
    post:
      tags:
        - Analysis
      summary: Get IaC Scan Results
      description: >-
        Retrieves Infrastructure as Code (IaC) security scanning results for a
        specific repository and commit
      operationId: getIaCResults
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IaCRequest'
            examples:
              github:
                summary: GitHub repository example
                value:
                  repo: owner/repository
                  commit_id: abc123def456
                  access_token: ghp_xxxxxxxxxxxx
                  service: github
      responses:
        '200':
          description: IaC scan results retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IaCResponse'
              example:
                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" {
                            - - 3
                              - |2
                                  name_prefix = "web-sg"
                            - - 4
                              - |+

                            - - 5
                              - |2
                                  ingress {
                            - - 6
                              - |2
                                    from_port   = 22
                            - - 7
                              - |2
                                    to_port     = 22
                            - - 8
                              - |2
                                    protocol    = "tcp"
                            - - 9
                              - |2
                                    cidr_blocks = ["0.0.0.0/0"]
                            - - 10
                              - |2
                                  }
                            - - 11
                              - |+

                            - - 12
                              - |2
                                  ingress {
                            - - 13
                              - |2
                                    from_port   = 80
                            - - 14
                              - |2
                                    to_port     = 80
                            - - 15
                              - |2
                                    protocol    = "tcp"
                            - - 16
                              - |2
                                    cidr_blocks = ["0.0.0.0/0"]
                            - - 17
                              - |2
                                  }
                            - - 18
                              - |+

                            - - 19
                              - |2
                                  egress {
                            - - 20
                              - |2
                                    from_port   = 0
                            - - 21
                              - |2
                                    to_port     = 0
                            - - 22
                              - |2
                                    protocol    = "-1"
                            - - 23
                              - |2
                                    cidr_blocks = ["0.0.0.0/0"]
                            - - 24
                              - |2
                                  }
                            - - 25
                              - |
                                }
                          resource: aws_security_group.web
                          start_line: 2
                          end_line: 25
        '401':
          description: Invalid access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Access token invalid
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Error retrieving IaC scan results
components:
  schemas:
    IaCRequest:
      type: object
      required:
        - repo
        - access_token
        - service
      properties:
        repo:
          type: string
          description: Repository identifier (format varies by service)
          example: owner/repository
        commit_id:
          type: string
          description: >-
            Git commit SHA or identifier. Either commit_id or branch is
            required. If both are provided, commit_id takes precedence.
          example: abc123def456
        branch:
          type: string
          description: >-
            Git branch name. When provided without commit_id, the service
            resolves the latest commit from scan history for this branch. Either
            commit_id or branch is required.
          example: main
        access_token:
          type: string
          description: Authentication token for the service
          example: ghp_xxxxxxxxxxxx
        service:
          type: string
          description: Version control service provider
          enum:
            - github
            - azuredevops
            - gitlab
            - bitbucket
          example: github
        gitlab_base_url:
          type: string
          description: Base URL for the service (optional for GitHub, required for GitLab)
          example: https://gitlab.com
    IaCResponse:
      type: object
      description: >-
        Infrastructure as Code (IaC) scanning response containing security check
        results
      properties:
        results:
          type: array
          description: List of IaC scan results by check type
          items:
            type: object
            properties:
              check_type:
                type: string
                description: Type of IaC framework checked
                example: terraform
              results:
                type: object
                description: Check results for this framework
                properties:
                  failed_checks:
                    type: array
                    description: List of failed security checks
                    items:
                      type: object
                      properties:
                        bc_check_id:
                          type: string
                          description: Bridgecrew check identifier
                          example: BC_AWS_NETWORKING_31
                        check_id:
                          type: string
                          description: Checkov check identifier
                          example: CKV_AWS_23
                        check_name:
                          type: string
                          description: Human-readable name of the security check
                          example: >-
                            Ensure every security group and rule has a
                            description
                        file_path:
                          type: string
                          description: Path to the file with the issue
                          example: /owner/repository/abc123def456/terraform/main.tf
                        file_line_range:
                          type: array
                          description: Line range where the issue occurs
                          items:
                            type: integer
                          example:
                            - 2
                            - 25
                        check_class:
                          type: string
                          description: Full class path of the check
                          example: >-
                            checkov.terraform.checks.resource.aws.SecurityGroupRuleDescription
                        code_block:
                          type: array
                          description: Code lines with line numbers
                          items:
                            type: array
                            description: Array containing line number and line content
                            minItems: 2
                            maxItems: 2
                          example:
                            - - 2
                              - |
                                resource "aws_security_group" "web" {
                            - - 3
                              - |2
                                  name_prefix = "web-sg"
                        resource:
                          type: string
                          description: Resource identifier in IaC file
                          example: aws_security_group.web
                        start_line:
                          type: integer
                          description: Starting line number
                          example: 2
                        end_line:
                          type: integer
                          description: Ending line number
                          example: 25
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message

````