{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/harness/main/json-schema/harness-audit-filter-properties-schema.json",
  "title": "AuditFilterProperties",
  "description": "This contains the Audit Event filter information. This is used to filter Audit Events depending on the information provided.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/harness-audit-api-openapi.yml#/components/schemas/AuditFilterProperties",
  "type": "object",
  "properties": {
    "scopes": {
      "type": "array",
      "description": "List of Resource Scopes",
      "items": {
        "$ref": "#/$defs/AuditResourceScope"
      }
    },
    "resources": {
      "type": "array",
      "description": "List of Resources",
      "items": {
        "$ref": "#/$defs/AuditResource"
      }
    },
    "includeChildScopes": {
      "type": "boolean",
      "description": "Include audits from child scopes",
      "default": true
    },
    "modules": {
      "type": "array",
      "description": "List of Module Types",
      "items": {
        "type": "string",
        "description": "List of Module Types",
        "enum": [
          "CD",
          "CI",
          "CV",
          "CF",
          "CE",
          "STO",
          "CHAOS",
          "AI_TEST_AUTOMATION",
          "SRM",
          "IACM",
          "CET",
          "IDP",
          "CODE",
          "SSCA",
          "AISRE",
          "CORE",
          "PMS",
          "TEMPLATESERVICE",
          "RMG",
          "GOVERNANCE",
          "PLATFORM",
          "SEI",
          "HAR",
          "DevopsEssentials",
          "FME",
          "DBOPS",
          "AI_AGENT_MLOPS",
          "AASP",
          "AARP",
          "AAST",
          "AISEC"
        ]
      }
    },
    "actions": {
      "type": "array",
      "description": "List of Actions",
      "items": {
        "type": "string",
        "description": "List of Actions"
      }
    },
    "environments": {
      "type": "array",
      "description": "List of Environments",
      "items": {
        "$ref": "#/$defs/AuditEnvironment"
      }
    },
    "principals": {
      "type": "array",
      "description": "List of Principals",
      "items": {
        "$ref": "#/$defs/AuditPrincipal"
      }
    },
    "staticFilter": {
      "type": "string",
      "description": "Pre-defined Filter",
      "enum": [
        "EXCLUDE_LOGIN_EVENTS",
        "EXCLUDE_SYSTEM_EVENTS"
      ]
    },
    "startTime": {
      "type": "integer",
      "description": "Used to specify a start time for retrieving Audit events that occurred at or after the time indicated.",
      "format": "int64"
    },
    "endTime": {
      "type": "integer",
      "description": "Used to specify the end time for retrieving Audit events that occurred at or before the time indicated.",
      "format": "int64"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "description": "Filter tags as a key-value pair."
      },
      "description": "Filter tags as a key-value pair."
    },
    "filterType": {
      "type": "string",
      "description": "This specifies the corresponding Entity of the filter.",
      "enum": [
        "Audit"
      ]
    }
  },
  "$defs": {
    "AuditEnvironment": {
      "required": [
        "identifier",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "PreProduction",
            "Production"
          ]
        },
        "identifier": {
          "type": "string"
        }
      },
      "description": "List of Environments"
    },
    "AuditPrincipal": {
      "required": [
        "identifier",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "USER",
            "SYSTEM",
            "API_KEY",
            "SERVICE_ACCOUNT"
          ]
        },
        "identifier": {
          "type": "string"
        }
      },
      "description": "List of Principals"
    },
    "AuditResource": {
      "required": [
        "identifier",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Resource Type"
        },
        "identifier": {
          "type": "string",
          "description": "Resource Identifier"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Map of additional information about the Resource."
          },
          "description": "Map of additional information about the Resource."
        }
      },
      "description": "This contains info about Resource saved as a part of Audit Event"
    },
    "AuditResourceScope": {
      "type": "object",
      "properties": {
        "accountIdentifier": {
          "type": "string",
          "description": "Identifier of Account"
        },
        "orgIdentifier": {
          "type": "string",
          "description": "Identifier of Organization"
        },
        "projectIdentifier": {
          "type": "string",
          "description": "Identifier of Project"
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Additional information about the Resource Scope"
          },
          "description": "Additional information about the Resource Scope"
        }
      },
      "description": "This has scope details for the resource defined in Harness."
    }
  }
}