Armor Detections API

The detection resource enables an API customer to build a webhook detection configuration.

Documentation

Specifications

Other Resources

OpenAPI Specification

armor-detections-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Armor Webhooks Detections API
  description: 'This API provides an interface for building configurations that

    allow you to subscribe to events, detections, and incidents.


    Base URL: `https://webhooks.api.secure-prod.services/`

    '
  version: 1.0.0
servers:
- url: https://webhooks.api.secure-dev.services
  description: Development
- url: https://webhooks.api.secure-stage.services
  description: Staging
- url: https://webhooks.api.secure-prod.services
  description: Production
security:
- OAuth2: []
tags:
- name: Detections
  description: 'The detection resource enables an API customer to build a webhook detection configuration.

    '
paths:
  /security/detection:
    get:
      tags:
      - Detections
      summary: Get Account Detection Configuration
      description: Gets the detection configuration for the account.
      operationId: getDetectionConfiguration
      parameters:
      - $ref: '#/components/parameters/AccountContext'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
      - Detections
      summary: Create a Detection Configuration
      description: Create a new Detection Configuration.
      operationId: createDetectionConfiguration
      parameters:
      - $ref: '#/components/parameters/AccountContext'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectionRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: 'New detection configuration was created True. DetectionId: 7854a268-bc98-478c-af0d-f65ff3d27d52.'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /security/detection/{detection_id}:
    post:
      tags:
      - Detections
      summary: Update a Detection Configuration
      description: Update a Detection Configuration.
      operationId: updateDetectionConfiguration
      parameters:
      - $ref: '#/components/parameters/AccountContext'
      - name: detection_id
        in: path
        required: true
        description: The id of the Detection Configuration.
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectionRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: boolean
              example: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /security/detection/delete/{detection_id}:
    post:
      tags:
      - Detections
      summary: Delete a Detection Configuration
      description: Delete a Detection Configuration.
      operationId: deleteDetectionConfiguration
      parameters:
      - $ref: '#/components/parameters/AccountContext'
      - name: detection_id
        in: path
        required: true
        description: The id of the Detection Configuration.
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: boolean
              example: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: string
          example: 'An error occurred processing the request. Error ID: 7854a268-bc98-478c-af0d-f65ff3d27d52'
  schemas:
    DetectionResponse:
      type: object
      required:
      - id
      - org_id
      - name
      - format
      - event_type
      properties:
        id:
          type: string
          format: uuid
          description: The Id of the Detection Configuration.
          example: 7854a268-bc98-478c-af0d-f65ff3d27d52
        org_id:
          type: integer
          description: The Id of the Account.
          example: 1000
        name:
          type: string
          description: The name of the Detection Configuration.
          example: Detection Name
        format:
          type: string
          description: The format for detection.
          example: splunk
        event_type:
          type: array
          description: The list of events.
          items:
            type: string
        transform:
          type: array
          description: The list of transforms.
          items:
            $ref: '#/components/schemas/DetectionTransform'
        default_label:
          type: array
          description: The list of default labels.
          items:
            $ref: '#/components/schemas/DetectionDefaultLabel'
    DetectionTransform:
      type: object
      properties:
        key:
          type: string
          description: The key name of the transform.
          example: link_event_kibana
        type:
          type: string
          description: The type of the transform.
          enum:
          - add_dynamic_tag
          - remove_dynamic_tag
          - add_log_search_url
          example: add_log_search_url
        value:
          type: string
          description: The value of the transform.
          example: event_uuid
    Message:
      type: object
      properties:
        message:
          type: string
          description: Informational message
    DetectionDefaultLabel:
      type: object
      properties:
        key:
          type: string
          description: The key name of the default label.
          example: rcn_idx
        value:
          type: string
          description: The value of the default label.
          example: Alpha
    ErrorMessage:
      type: object
      properties:
        errorMessage:
          type: string
          description: Error message description
    DetectionRequest:
      type: object
      required:
      - name
      - format
      - event_type
      properties:
        name:
          type: string
          description: The name of the Detection Configuration.
          example: Detection Name
        format:
          type: string
          description: The format for detection.
          example: splunk
        event_type:
          type: array
          description: The list of events.
          items:
            type: string
        transform:
          type: array
          description: The list of transforms.
          items:
            $ref: '#/components/schemas/DetectionTransform'
        default_label:
          type: array
          description: The list of default labels.
          items:
            $ref: '#/components/schemas/DetectionDefaultLabel'
  parameters:
    AccountContext:
      name: x-account-context
      in: header
      required: true
      description: Account context identifier
      schema:
        type: integer
      example: 4
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.armor.com/auth/authorize
          scopes: {}