{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-guardduty/json-schema/amazon-guardduty-get-malware-scan-response-schema.json",
  "title": "GetMalwareScanResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-guardduty-malware-scan-api-openapi.yml#/components/schemas/GetMalwareScanResponse",
  "type": "object",
  "properties": {
    "ScanId": {
      "type": "string",
      "description": "A unique identifier associated with the malware scan. Each malware scan has a corresponding scan ID. Using this scan ID, you can monitor the status of your malware scan."
    },
    "DetectorId": {
      "type": "string",
      "description": "The unique ID of the detector that is associated with the request, if it belongs to an account which is a GuardDuty customer. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API."
    },
    "AdminDetectorId": {
      "type": "string",
      "description": "The unique detector ID of the administrator account that the request is associated with. If the account is an administrator, the AdminDetectorId will be the same as the one used for DetectorId. If the customer is not a GuardDuty customer, this field will not be present.. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API."
    },
    "ResourceArn": {
      "type": "string",
      "description": "Amazon Resource Name (ARN) of the resource on which a malware scan was invoked."
    },
    "ResourceType": {
      "type": "string",
      "enum": [
        "EBS_RECOVERY_POINT",
        "EBS_SNAPSHOT",
        "EBS_VOLUME",
        "EC2_AMI",
        "EC2_INSTANCE",
        "EC2_RECOVERY_POINT",
        "S3_RECOVERY_POINT",
        "S3_BUCKET",
        "S3_POINT_IN_TIME_RECOVERY"
      ],
      "description": "The type of resource that was scanned for malware."
    },
    "ScannedResourcesCount": {
      "type": "integer",
      "description": "The total number of resources that were successfully scanned. This is dependent on the resource type."
    },
    "SkippedResourcesCount": {
      "type": "integer",
      "description": "The total number of resources that were skipped during the scan."
    },
    "FailedResourcesCount": {
      "type": "integer",
      "description": "The total number of resources that failed to be scanned."
    },
    "ScannedResources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScannedResource"
      },
      "description": "A list of resources along with their metadata that were scanned as part of the malware scan operation."
    },
    "ScanConfiguration": {
      "$ref": "#/$defs/ScanConfiguration"
    },
    "ScanCategory": {
      "type": "string",
      "enum": [
        "FULL_SCAN",
        "INCREMENTAL_SCAN"
      ],
      "description": "The category of the malware scan, indicating the type of scan performed."
    },
    "ScanStatus": {
      "type": "string",
      "enum": [
        "RUNNING",
        "COMPLETED",
        "COMPLETED_WITH_ISSUES",
        "FAILED",
        "SKIPPED"
      ],
      "description": "A value representing the current status of the malware scan."
    },
    "ScanStatusReason": {
      "type": "string",
      "enum": [
        "ACCESS_DENIED",
        "RESOURCE_NOT_FOUND",
        "SNAPSHOT_SIZE_LIMIT_EXCEEDED",
        "RESOURCE_UNAVAILABLE",
        "INCONSISTENT_SOURCE",
        "INCREMENTAL_NO_DIFFERENCE",
        "NO_EBS_VOLUMES_FOUND",
        "UNSUPPORTED_PRODUCT_CODE_TYPE",
        "AMI_SNAPSHOT_LIMIT_EXCEEDED",
        "UNRELATED_RESOURCES",
        "BASE_RESOURCE_NOT_SCANNED",
        "BASE_CREATED_AFTER_TARGET",
        "UNSUPPORTED_FOR_INCREMENTAL",
        "UNSUPPORTED_AMI",
        "UNSUPPORTED_SNAPSHOT",
        "UNSUPPORTED_COMPOSITE_RECOVERY_POINT",
        "ALL_FILES_SKIPPED_OR_FAILED"
      ],
      "description": "Represents the reason for the current scan status, if applicable."
    },
    "ScanType": {
      "type": "string",
      "enum": [
        "BACKUP_INITIATED",
        "ON_DEMAND",
        "GUARDDUTY_INITIATED"
      ],
      "description": "A value representing the initiator of the scan."
    },
    "ScanStartedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp representing when the malware scan was started."
    },
    "ScanCompletedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The timestamp representing when the malware scan was completed."
    },
    "ScanResultDetails": {
      "$ref": "#/$defs/GetMalwareScanResultDetails"
    }
  },
  "$defs": {
    "AdditionalInfo": {
      "type": "object",
      "properties": {
        "VersionId": {
          "type": "string",
          "description": "The version ID of the S3 object, if applicable."
        },
        "DeviceName": {
          "type": "string",
          "description": "The device name of the EBS volume, if applicable."
        }
      }
    },
    "EbsSnapshot": {
      "type": "object",
      "properties": {
        "DeviceName": {
          "type": "string",
          "description": "The device name of the EBS snapshot that was scanned."
        }
      }
    },
    "GetMalwareScanResultDetails": {
      "type": "object",
      "properties": {
        "ScanResultStatus": {
          "type": "string",
          "enum": [
            "NO_THREATS_FOUND",
            "THREATS_FOUND"
          ],
          "description": "Status indicating whether threats were found for a completed scan."
        },
        "SkippedFileCount": {
          "type": "integer",
          "description": "The total number of files that were skipped during the scan."
        },
        "FailedFileCount": {
          "type": "integer",
          "description": "The total number of files that failed to be scanned."
        },
        "ThreatFoundFileCount": {
          "type": "integer",
          "description": "The total number of files in which threats were detected."
        },
        "TotalFileCount": {
          "type": "integer",
          "description": "The total number of files that were processed during the scan."
        },
        "TotalBytes": {
          "type": "integer",
          "description": "The total number of bytes that were scanned."
        },
        "UniqueThreatCount": {
          "type": "integer",
          "description": "The total number of unique threats that were detected during the scan."
        },
        "Threats": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ScanResultThreat"
          },
          "description": "The threats that were detected during the malware scan."
        }
      }
    },
    "IncrementalScanDetails": {
      "type": "object",
      "properties": {
        "BaselineResourceArn": {
          "type": "string",
          "description": "Amazon Resource Name (ARN) of the baseline resource used for incremental scanning. The scan will only process changes since this baseline resource was created."
        }
      },
      "required": [
        "BaselineResourceArn"
      ]
    },
    "ItemDetails": {
      "type": "object",
      "properties": {
        "ResourceArn": {
          "type": "string",
          "description": "Amazon Resource Name (ARN) of the resource where the threat was detected."
        },
        "ItemPath": {
          "type": "string",
          "description": "The path where the threat was detected."
        },
        "Hash": {
          "type": "string",
          "description": "The hash value of the infected item."
        },
        "AdditionalInfo": {
          "$ref": "#/$defs/AdditionalInfo"
        }
      }
    },
    "ScanConfiguration": {
      "type": "object",
      "properties": {
        "Role": {
          "type": "string",
          "description": "Amazon Resource Name (ARN) of the IAM role that should contain the required permissions for the scan."
        },
        "TriggerDetails": {
          "$ref": "#/$defs/TriggerDetails"
        },
        "IncrementalScanDetails": {
          "$ref": "#/$defs/IncrementalScanDetails"
        },
        "RecoveryPoint": {
          "$ref": "#/$defs/ScanConfigurationRecoveryPoint"
        }
      }
    },
    "ScanConfigurationContinuousScanDetails": {
      "type": "object",
      "properties": {
        "StartTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp representing the start of the time range that was scanned."
        },
        "EndTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp representing the end of the time range that was scanned."
        }
      },
      "required": [
        "EndTime"
      ]
    },
    "ScanConfigurationRecoveryPoint": {
      "type": "object",
      "properties": {
        "BackupVaultName": {
          "type": "string",
          "description": "The name of the Amazon Web Services Backup vault that contains the recovery point for the scanned."
        },
        "ContinuousScanDetails": {
          "$ref": "#/$defs/ScanConfigurationContinuousScanDetails"
        }
      }
    },
    "ScanResultThreat": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the detected threat."
        },
        "Source": {
          "type": "string",
          "enum": [
            "AMAZON",
            "BITDEFENDER"
          ],
          "description": "The source that detected this threat."
        },
        "Count": {
          "type": "integer",
          "description": "The number of instances of this threat that were detected."
        },
        "Hash": {
          "type": "string",
          "description": "The hash value associated with the detected threat."
        },
        "ItemDetails": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ItemDetails"
          },
          "description": "Additional information about where this threat was detected."
        }
      }
    },
    "ScannedResource": {
      "type": "object",
      "properties": {
        "ScannedResourceArn": {
          "type": "string",
          "description": "Amazon Resource Name (ARN) of the scanned resource."
        },
        "ScannedResourceType": {
          "type": "string",
          "enum": [
            "EBS_RECOVERY_POINT",
            "EBS_SNAPSHOT",
            "EBS_VOLUME",
            "EC2_AMI",
            "EC2_INSTANCE",
            "EC2_RECOVERY_POINT",
            "S3_RECOVERY_POINT",
            "S3_BUCKET",
            "S3_POINT_IN_TIME_RECOVERY"
          ],
          "description": "The resource type of the scanned resource."
        },
        "ScannedResourceStatus": {
          "type": "string",
          "enum": [
            "RUNNING",
            "COMPLETED",
            "COMPLETED_WITH_ISSUES",
            "FAILED",
            "SKIPPED"
          ],
          "description": "The status of the scanned resource."
        },
        "ScanStatusReason": {
          "type": "string",
          "enum": [
            "ACCESS_DENIED",
            "RESOURCE_NOT_FOUND",
            "SNAPSHOT_SIZE_LIMIT_EXCEEDED",
            "RESOURCE_UNAVAILABLE",
            "INCONSISTENT_SOURCE",
            "INCREMENTAL_NO_DIFFERENCE",
            "NO_EBS_VOLUMES_FOUND",
            "UNSUPPORTED_PRODUCT_CODE_TYPE",
            "AMI_SNAPSHOT_LIMIT_EXCEEDED",
            "UNRELATED_RESOURCES",
            "BASE_RESOURCE_NOT_SCANNED",
            "BASE_CREATED_AFTER_TARGET",
            "UNSUPPORTED_FOR_INCREMENTAL",
            "UNSUPPORTED_AMI",
            "UNSUPPORTED_SNAPSHOT",
            "UNSUPPORTED_COMPOSITE_RECOVERY_POINT",
            "ALL_FILES_SKIPPED_OR_FAILED"
          ],
          "description": "The reason for the scan status of this particular resource, if applicable."
        },
        "ResourceDetails": {
          "$ref": "#/$defs/ScannedResourceDetails"
        }
      }
    },
    "ScannedResourceDetails": {
      "type": "object",
      "properties": {
        "EbsVolume": {
          "$ref": "#/$defs/VolumeDetail"
        },
        "EbsSnapshot": {
          "$ref": "#/$defs/EbsSnapshot"
        }
      }
    },
    "TriggerDetails": {
      "type": "object",
      "properties": {
        "GuardDutyFindingId": {
          "type": "string",
          "description": "The ID of the GuardDuty finding that triggered the malware scan."
        },
        "Description": {
          "type": "string",
          "description": "The description of the scan trigger."
        },
        "TriggerType": {
          "type": "string",
          "enum": [
            "BACKUP",
            "GUARDDUTY"
          ],
          "description": "Specifies the trigger type that started the malware scan."
        }
      }
    },
    "VolumeDetail": {
      "type": "object",
      "properties": {
        "VolumeArn": {
          "type": "string",
          "description": "EBS volume ARN information."
        },
        "VolumeType": {
          "type": "string",
          "description": "The EBS volume type."
        },
        "DeviceName": {
          "type": "string",
          "description": "The device name for the EBS volume."
        },
        "VolumeSizeInGB": {
          "type": "integer",
          "description": "EBS volume size in GB."
        },
        "EncryptionType": {
          "type": "string",
          "description": "EBS volume encryption type."
        },
        "SnapshotArn": {
          "type": "string",
          "description": "Snapshot ARN of the EBS volume."
        },
        "KmsKeyArn": {
          "type": "string",
          "description": "KMS key ARN used to encrypt the EBS volume."
        }
      }
    }
  }
}