Skip to content

YAML Schema

Hare Sudhan edited this page Oct 10, 2024 · 1 revision
$defs:
  Atomic:
    additionalProperties: false
    properties:
      test_number:
        anyOf:
          - type: string
          - type: "null"
        default: null
        title: Test Number
      name:
        minLength: 1
        title: Name
        type: string
      description:
        minLength: 1
        title: Description
        type: string
      supported_platforms:
        items:
          enum:
            - windows
            - macos
            - linux
            - office-365
            - azure-ad
            - google-workspace
            - saas
            - iaas
            - containers
            - iaas:gcp
            - iaas:azure
            - iaas:aws
          type: string
        minItems: 1
        title: Supported Platforms
        type: array
      executor:
        discriminator:
          mapping:
            bash: "#/$defs/CommandExecutor"
            command_prompt: "#/$defs/CommandExecutor"
            manual: "#/$defs/ManualExecutor"
            powershell: "#/$defs/CommandExecutor"
            sh: "#/$defs/CommandExecutor"
          propertyName: name
        oneOf:
          - $ref: "#/$defs/ManualExecutor"
          - $ref: "#/$defs/CommandExecutor"
        title: Executor
      dependencies:
        anyOf:
          - items:
              $ref: "#/$defs/Dependency"
            type: array
          - type: "null"
        default: []
        title: Dependencies
      input_arguments:
        default: {}
        patternProperties:
          "^[\\w_-]+$":
            discriminator:
              mapping:
                Float: "#/$defs/FloatArg"
                Integer: "#/$defs/IntArg"
                Path: "#/$defs/StringArg"
                String: "#/$defs/StringArg"
                Url: "#/$defs/UrlArg"
                float: "#/$defs/FloatArg"
                integer: "#/$defs/IntArg"
                path: "#/$defs/StringArg"
                string: "#/$defs/StringArg"
                url: "#/$defs/UrlArg"
              propertyName: type
            oneOf:
              - $ref: "#/$defs/FloatArg"
              - $ref: "#/$defs/IntArg"
              - $ref: "#/$defs/UrlArg"
              - $ref: "#/$defs/StringArg"
        title: Input Arguments
        type: object
      dependency_executor_name:
        default: manual
        enum:
          - manual
          - powershell
          - sh
          - bash
          - command_prompt
        title: Dependency Executor Name
        type: string
      auto_generated_guid:
        anyOf:
          - format: uuid
            type: string
          - type: "null"
        default: null
        title: Auto Generated Guid
    required:
      - name
      - description
      - supported_platforms
      - executor
    title: Atomic
    type: object
  CommandExecutor:
    properties:
      name:
        enum:
          - powershell
          - sh
          - bash
          - command_prompt
        title: Name
        type: string
      elevation_required:
        default: false
        title: Elevation Required
        type: boolean
      command:
        minLength: 1
        title: Command
        type: string
      cleanup_command:
        anyOf:
          - type: string
          - type: "null"
        default: null
        title: Cleanup Command
    required:
      - name
      - command
    title: CommandExecutor
    type: object
  Dependency:
    properties:
      description:
        minLength: 1
        title: Description
        type: string
      prereq_command:
        minLength: 1
        title: Prereq Command
        type: string
      get_prereq_command:
        anyOf:
          - type: string
          - type: "null"
        title: Get Prereq Command
    required:
      - description
      - prereq_command
      - get_prereq_command
    title: Dependency
    type: object
  FloatArg:
    properties:
      description:
        title: Description
        type: string
      default:
        anyOf:
          - type: number
          - type: "null"
        title: Default
      type:
        enum:
          - float
          - Float
        title: Type
        type: string
    required:
      - description
      - default
      - type
    title: FloatArg
    type: object
  IntArg:
    properties:
      description:
        title: Description
        type: string
      default:
        anyOf:
          - type: integer
          - type: "null"
        title: Default
      type:
        enum:
          - integer
          - Integer
        title: Type
        type: string
    required:
      - description
      - default
      - type
    title: IntArg
    type: object
  ManualExecutor:
    properties:
      name:
        const: manual
        title: Name
      elevation_required:
        default: false
        title: Elevation Required
        type: boolean
      steps:
        minLength: 10
        title: Steps
        type: string
    required:
      - name
      - steps
    title: ManualExecutor
    type: object
  StringArg:
    properties:
      description:
        title: Description
        type: string
      default:
        anyOf:
          - type: string
          - type: "null"
        title: Default
      type:
        enum:
          - string
          - path
          - String
          - Path
        title: Type
        type: string
    required:
      - description
      - default
      - type
    title: StringArg
    type: object
  UrlArg:
    properties:
      description:
        title: Description
        type: string
      default:
        anyOf:
          - pattern: ^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$
            type: string
          - format: uri
            minLength: 1
            type: string
          - format: ipvanyaddress
            type: string
          - type: "null"
        title: Default
      type:
        enum:
          - url
          - Url
        title: Type
        type: string
    required:
      - description
      - default
      - type
    title: UrlArg
    type: object
properties:
  attack_technique:
    minLength: 5
    pattern: T\d{4}(?:\.\d{3})?
    title: Attack Technique
    type: string
  display_name:
    minLength: 5
    title: Display Name
    type: string
  atomic_tests:
    items:
      $ref: "#/$defs/Atomic"
    minItems: 1
    title: Atomic Tests
    type: array
required:
  - attack_technique
  - display_name
  - atomic_tests
title: Technique
type: object
Clone this wiki locally