swagger: '2.0'
info:
  contact: {}
paths:
  /applications:
    get:
      description: Retrieves a list of applications based on the provided query parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get a list of applications
      parameters:
        - type: string
          description: Date in RFC3339 format e.g 2023-05-25T00:10:01-02:00
          name: date
          in: query
        - type: string
          description: Sort the applications by a specific field e.g sort=applicationName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the applications by a specific field e.g
            filter=applicationName eq 'application1' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of applications to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use field appdApplicationId value from the response
          name: applicationId
          in: query
      responses:
        '200':
          description: Successful retrieval of application list
          schema:
            $ref: '#/definitions/application.ApplicationsListAPIResponseResult'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /applications/{applicationId}/tiers:
    get:
      description: >-
        Retrieves a list of tiers based a specific application and provided
        query parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get list of tiers for a specific application
      parameters:
        - type: string
          description: Application ID required for specific application tier details
          name: applicationId
          in: path
          required: true
        - type: string
          description: Date in RFC3339 format e.g 2023-05-25T00:10:01-02:00
          name: date
          in: query
        - type: string
          description: Sort the applications by a specific field e.g sort=applicationName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the applications by a specific field e.g
            filter=applicationName eq 'application1' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of applications to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of tier list of a specific application
          schema:
            $ref: '#/definitions/application.TiersListAPIResponseResult'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /attacks:
    get:
      description: >-
        If attackSummaryId is provided, retrieves details of a specific attack.
        Otherwise, retrieves a list of attacks.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Attacks List or Specific Attack
      parameters:
        - type: string
          description: >-
            Start time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: startedAt
          in: query
        - type: string
          description: >-
            End time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: endedAt
          in: query
        - type: string
          description: Sort the attacks by a specific field e.g sort=attackName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the attacks by a specific field e.g filter=attackName eq
            'dangerousOne' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of attacks to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of attack list or attack details
          schema:
            $ref: '#/definitions/attacks.AttackSummaryAPIResponseResult'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /attacks/{attackSummaryId}:
    get:
      description: >-
        If attackSummaryId is provided, retrieves details of a specific attack.
        Otherwise, retrieves a list of attacks.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Attacks List or Specific Attack
      parameters:
        - type: string
          description: Attack Summary ID required for specific attack details
          name: attackSummaryId
          in: path
          required: true
        - type: string
          description: >-
            Start time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: startedAt
          in: query
        - type: string
          description: >-
            End time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: endedAt
          in: query
        - type: string
          description: Sort the attacks by a specific field e.g sort=attackName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the attacks by a specific field e.g filter=attackName eq
            'dangerousOne' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of attacks to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of attack list or attack details
          schema:
            $ref: '#/definitions/attacks.AttackSummaryAPIResponseResult'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /businessTransactions:
    get:
      description: >-
        Retrieves a list of business transactions based on the provided query
        parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get BusinessTransactions List
      parameters:
        - type: string
          description: >-
            Start time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: startedAt
          in: query
        - type: string
          description: >-
            End time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: endedAt
          in: query
        - type: string
          description: >-
            Sort the transactions by a specific field e.g
            sort=businessTransactionName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the transactions by a specific field e.g
            filter=businessTransactionName eq 'businessOne' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of transactions to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of business transaction list
          schema:
            $ref: '#/definitions/bt.BusinessTransactionsListAPIResponseResult'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /businessTransactions/{businessTransactionId}:
    get:
      description: >-
        Retrieves details of of a business transaction based on the provided
        query parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Business Transaction Details
      parameters:
        - type: string
          description: Business Transaction Id
          name: businessTransactionId
          in: path
          required: true
      responses:
        '200':
          description: Successful retrieval of details of a specific business transaction
          schema:
            $ref: '#/definitions/dblib.BusinessTransactionsDetailAPIResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /libraries:
    get:
      description: Retrieves a list of Libraries based on the provided query parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Libraries List
      parameters:
        - type: string
          description: >-
            Start time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: startedAt
          in: query
        - type: string
          description: >-
            End time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: endedAt
          in: query
        - type: string
          description: Sort the libraries by a specific field e.g sort=applicationName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the libraries by a specific field e.g filter=applicationName
            eq 'application1' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of libraries to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of library list
          schema:
            $ref: '#/definitions/libraries.LibrariesResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /libraries/{libraryId}:
    get:
      description: Retrieves details of a library based on the provided query parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Library Details
      parameters:
        - type: string
          description: Library ID
          name: libraryId
          in: path
          required: true
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of details of a specific library
          schema:
            $ref: '#/definitions/dblib.LibrariesAPIResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /stats/businessRisk:
    get:
      description: >-
        Retrieves business risk score by application and business transaction
        based on the provided query parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Business Risk Score
      parameters:
        - type: string
          description: Business Transaction ID
          name: btId
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of business risk score
          schema:
            $ref: '#/definitions/dblib.BusinessRiskScoreResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /vulnerabilities:
    get:
      description: >-
        Retrieves a list of vulnerabilities based on the provided query
        parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Vulnerabilities List
      parameters:
        - type: string
          description: >-
            Start time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: startedAt
          in: query
        - type: string
          description: >-
            End time of the transactions RFC3339 format e.g
            2023-05-25T00:10:01-02:00
          name: endedAt
          in: query
        - type: string
          description: Sort the vulnerabilities by a specific field e.g sort=cweName
          name: sort
          in: query
        - type: string
          description: Order of the sort field (asc or desc)
          name: order
          in: query
        - type: string
          description: >-
            Filter the vulnerabilities by a specific field e.g filter=cweName eq
            'CW-94' 
          name: filter
          in: query
        - type: integer
          default: 10
          description: Maximum number of vulnerabilities to return
          name: max
          in: query
        - type: integer
          default: 0
          description: Offset for pagination
          name: offset
          in: query
        - type: integer
          description: >-
            Global application filter, to restrict output to one application
            only use appdApplicationId value from response
          name: applicationId
          in: query
        - type: integer
          description: >-
            Global tier filter, to restrict output to one tier only. Use
            appdTierId value from response
          name: tierId
          in: query
      responses:
        '200':
          description: Successful retrieval of vulnerability list
          schema:
            $ref: '#/definitions/vulnerabilities.VulnerabilitiesResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
  /vulnerabilities/{cveId}:
    get:
      description: >-
        Retrieves details of of a vulnerability based on the provided query
        parameters.
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - public
      summary: Get Vulnerability Details
      parameters:
        - type: string
          description: Cve ID
          name: cveId
          in: path
          required: true
      responses:
        '200':
          description: Successful retrieval of details of a specific vulnerability
          schema:
            $ref: '#/definitions/dblib.VulnerabilityDetailsAPIResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/eputil.ErrorResponse'
definitions:
  application.ApplicationsListAPIResponseResult:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/dblib.ApplicationsListAPIResponse'
      total:
        type: integer
  application.TiersListAPIResponseResult:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/dblib.TiersListAPIResponse'
      total:
        type: integer
  attacks.AttackSummaryAPIResponseResult:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/dblib.AttackSummaryAPIResponse'
      total:
        type: integer
  bt.BusinessTransactionsListAPIResponseResult:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/dblib.BusinessTransactionsSummaryAPIResponse'
      total:
        type: integer
  dblib.ApplicationsListAPIResponse:
    type: object
    properties:
      appdApplicationId:
        type: integer
      applicationCreatedAt:
        type: string
      applicationId:
        type: string
      applicationName:
        type: string
      applicationSecurityEnabled:
        type: boolean
      applicationSecurityEnabledComputed:
        type: boolean
      countApmActive:
        type: integer
      countReady:
        type: integer
      countSecured:
        type: integer
      countSecurityEnabled:
        type: integer
      countSupportedAgent:
        type: integer
  dblib.AttackSummaryAPIResponse:
    type: object
    properties:
      appdApplicationId:
        type: integer
      appdBtId:
        type: integer
      appdTierId:
        type: integer
      applicationName:
        type: string
      attackName:
        type: string
      attackNote:
        type: string
      attackOutcome:
        type: string
      attackSource:
        type: string
      attackStatus:
        type: string
      attackSummaryId:
        type: string
      attackTypes:
        type: string
      btName:
        type: string
      btUuid:
        type: string
      firstSeenAt:
        type: string
      keyInfo:
        type: string
      lastSeenAt:
        type: string
      tierName:
        type: string
  dblib.BusinessRiskScoreResponse:
    type: object
    properties:
      brmTitle:
        type: string
      businessRiskScore:
        type: integer
  dblib.BusinessTransactionsDetailAPIResponse:
    type: object
    properties:
      appdApplicationId:
        type: integer
      appdBusinessTransactionId:
        type: integer
      applicationName:
        type: string
      brmTitle:
        type: string
      businessRiskScore:
        type: integer
      businessTransactionName:
        type: string
      entryTierAppdId:
        type: integer
      entryTierName:
        type: string
      riskScore:
        type: number
      riskScoreCard:
        type: string
  dblib.BusinessTransactionsSummaryAPIResponse:
    type: object
    properties:
      appdApplicationId:
        type: integer
      appdBusinessTransactionId:
        type: integer
      applicationId:
        type: string
      applicationName:
        type: string
      attackOutcomeCountAttempted:
        type: integer
      attackOutcomeCountBlocked:
        type: integer
      attackOutcomeCountExploited:
        type: integer
      brmTitle:
        type: string
      businessRiskScore:
        type: integer
      businessTransactionId:
        type: string
      businessTransactionName:
        type: string
      entryTierAppdId:
        type: integer
      entryTierId:
        type: string
      entryTierName:
        type: string
      riskScore:
        type: number
      severityCountCritical:
        type: integer
      severityCountHigh:
        type: integer
      severityCountLow:
        type: integer
      severityCountMedium:
        type: integer
      tierCount:
        type: integer
      totalAttackCount:
        type: integer
      totalVulnCount:
        type: integer
  dblib.KennaData:
    type: object
    properties:
      active_internet_breach:
        type: boolean
      easily_exploitable:
        type: boolean
      malware_exploitable:
        type: boolean
      popular_target:
        type: boolean
      predicted_exploitable:
        type: boolean
      remote_code_execution:
        type: boolean
      risk_score_meter:
        type: number
  dblib.LibrariesAPIResponse:
    type: object
    properties:
      active_internet_breach:
        type: boolean
      affectedNodeCount:
        type: integer
      appdApplicationId:
        type: integer
      appdTierId:
        type: integer
      applicationName:
        type: string
      easily_exploitable:
        type: boolean
      kennaRiskScore:
        type: number
      libraryId:
        type: string
      malware_exploitable:
        type: boolean
      packageCanonicalName:
        type: string
      packageId:
        type: string
      packageLanguage:
        type: string
      packageName:
        type: string
      packageVersion:
        type: string
      popular_target:
        type: boolean
      predicted_exploitable:
        type: boolean
      recommendedVersion:
        type: string
      remote_code_execution:
        type: boolean
      riskScore:
        type: number
      severity:
        type: string
      severityCountCritical:
        type: integer
      severityCountHigh:
        type: integer
      severityCountLow:
        type: integer
      severityCountMedium:
        type: integer
      status:
        type: string
      tierName:
        type: string
      totalVulnCount:
        type: integer
  dblib.TiersListAPIResponse:
    type: object
    properties:
      appdApplicationId:
        type: integer
      appdTierId:
        type: integer
      applicationName:
        type: string
      countApmActive:
        type: integer
      countReady:
        type: integer
      countSecured:
        type: integer
      countSecurityEnabled:
        type: integer
      countSupportedAgent:
        type: integer
      id:
        type: string
      tierCreatedAt:
        type: string
      tierEnableSecurity:
        type: boolean
      tierEnableSecurityStatus:
        type: boolean
      tierName:
        type: string
  dblib.VulnerabilitiesAPIResponse:
    type: object
    properties:
      active_internet_breach:
        type: boolean
      affectedNodeCount:
        type: integer
      appdApplicationId:
        type: integer
      appdTierId:
        type: integer
      applicationName:
        type: string
      attackSummaryId:
        type: string
      cveId:
        type: string
      cveName:
        type: string
      cvePublishDate:
        type: string
      cveTitle:
        type: string
      cweName:
        description: Below fields are needed to be included in Export
        type: string
      easily_exploitable:
        type: boolean
      firstSeenAt:
        type: string
      hasAttacks:
        type: boolean
      hasEvent:
        type: boolean
      hasObservations:
        type: boolean
      incidentId:
        type: string
      kennaScore:
        type: number
      lastSeenAt:
        type: string
      libraryId:
        type: string
      malware_exploitable:
        type: boolean
      packageCanonicalName:
        type: string
      packageId:
        type: string
      packageLanguage:
        type: string
      popular_target:
        type: boolean
      predicted_exploitable:
        type: boolean
      remediation:
        type: string
      remote_code_execution:
        type: boolean
      riskScore:
        type: number
      severity:
        type: string
      status:
        $ref: '#/definitions/models.IncidentStatus'
      tierId:
        type: string
      tierName:
        type: string
  dblib.VulnerabilityDetailsAPIResponse:
    type: object
    properties:
      createdAt:
        type: string
      cveId:
        type: string
      cveTitle:
        type: string
      cvss3BaseScore:
        type: number
      cvss3VectorString:
        type: string
      cweName:
        type: string
      description:
        type: string
      kenna:
        $ref: '#/definitions/dblib.KennaData'
      name:
        type: string
      nvdUrl:
        type: string
      publishDate:
        type: string
      remediation:
        type: string
      severity:
        type: string
      updatedAt:
        type: string
  eputil.ErrorResponse:
    type: object
    properties:
      error:
        type: string
  libraries.LibrariesResponse:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/dblib.LibrariesAPIResponse'
      total:
        type: integer
  models.IncidentStatus:
    type: string
    enum:
      - Unknown
      - Discovered
      - Confirmed
      - Snoozed
      - Assigned
      - Rejected
      - Fixed
      - Ignored
    x-enum-varnames:
      - IncidentUnknown
      - IncidentDiscovered
      - IncidentConfirmed
      - IncidentSnoozed
      - IncidentAssigned
      - IncidentRejected
      - IncidentFixed
      - IncidentIgnored
  vulnerabilities.VulnerabilitiesResponse:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/dblib.VulnerabilitiesAPIResponse'
      total:
        type: integer
