{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iam-access-analyzer/json-schema/amazon-iam-access-analyzer-get-finding-v2-response-schema.json",
  "title": "GetFindingV2Response",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iam-access-analyzer-operations-api-openapi.yml#/components/schemas/GetFindingV2Response",
  "type": "object",
  "properties": {
    "analyzedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The time at which the resource-based policy or IAM entity that generated the finding was analyzed."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "The time at which the finding was created."
    },
    "error": {
      "type": "string",
      "description": "An error."
    },
    "id": {
      "type": "string",
      "description": "The ID of the finding to retrieve."
    },
    "nextToken": {
      "type": "string",
      "description": "A token used for pagination of results returned."
    },
    "resource": {
      "type": "string",
      "description": "The resource that generated the finding."
    },
    "resourceType": {
      "type": "string",
      "description": "The type of the resource identified in the finding."
    },
    "resourceOwnerAccount": {
      "type": "string",
      "description": "Tye Amazon Web Services account ID that owns the resource."
    },
    "status": {
      "type": "string",
      "description": "The status of the finding."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The time at which the finding was updated."
    },
    "findingDetails": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FindingDetails"
      },
      "description": "A localized message that explains the finding and provides guidance on how to address it."
    },
    "findingType": {
      "type": "string",
      "description": "The type of the finding. For external access analyzers, the type is ExternalAccess. For unused access analyzers, the type can be UnusedIAMRole, UnusedIAMUserAccessKey, UnusedIAMUserPassword, or UnusedPermission. For internal access analyzers, the type is InternalAccess."
    }
  },
  "required": [
    "analyzedAt",
    "createdAt",
    "id",
    "resourceType",
    "resourceOwnerAccount",
    "status",
    "updatedAt",
    "findingDetails"
  ],
  "$defs": {
    "ExternalAccessDetails": {
      "type": "object",
      "properties": {
        "action": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The action in the analyzed policy statement that an external principal has permission to use."
        },
        "condition": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The condition in the analyzed policy statement that resulted in an external access finding."
        },
        "isPublic": {
          "type": "boolean",
          "description": "Specifies whether the external access finding is public."
        },
        "principal": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The external principal that has access to a resource within the zone of trust."
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FindingSource"
          },
          "description": "The sources of the external access finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings."
        },
        "resourceControlPolicyRestriction": {
          "type": "string",
          "description": "The type of restriction applied to the finding by the resource owner with an Organizations resource control policy (RCP). APPLICABLE: There is an RCP present in the organization but IAM Access Analyzer does not include it in the evaluation of effective permissions. For example, if s3:DeleteObject is blocked by the RCP and the restriction is APPLICABLE, then s3:DeleteObject would still be included in the list of actions for the finding. FAILED_TO_EVALUATE_RCP: There was an error evaluating the RCP. NOT_APPLICABLE: There was no RCP present in the organization, or there was no RCP applicable to t"
        }
      },
      "required": [
        "condition"
      ]
    },
    "FindingDetails": {
      "type": "object",
      "properties": {
        "internalAccessDetails": {
          "$ref": "#/$defs/InternalAccessDetails"
        },
        "externalAccessDetails": {
          "$ref": "#/$defs/ExternalAccessDetails"
        },
        "unusedPermissionDetails": {
          "$ref": "#/$defs/UnusedPermissionDetails"
        },
        "unusedIamUserAccessKeyDetails": {
          "$ref": "#/$defs/UnusedIamUserAccessKeyDetails"
        },
        "unusedIamRoleDetails": {
          "$ref": "#/$defs/UnusedIamRoleDetails"
        },
        "unusedIamUserPasswordDetails": {
          "$ref": "#/$defs/UnusedIamUserPasswordDetails"
        }
      },
      "description": "Exactly one member is set."
    },
    "FindingSource": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Indicates the type of access that generated the finding."
        },
        "detail": {
          "$ref": "#/$defs/FindingSourceDetail"
        }
      },
      "required": [
        "type"
      ]
    },
    "FindingSourceDetail": {
      "type": "object",
      "properties": {
        "accessPointArn": {
          "type": "string",
          "description": "The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point."
        },
        "accessPointAccount": {
          "type": "string",
          "description": "The account of the cross-account access point that generated the finding."
        }
      }
    },
    "InternalAccessDetails": {
      "type": "object",
      "properties": {
        "action": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The action in the analyzed policy statement that has internal access permission to use."
        },
        "condition": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The condition in the analyzed policy statement that resulted in an internal access finding."
        },
        "principal": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The principal that has access to a resource within the internal environment."
        },
        "principalOwnerAccount": {
          "type": "string",
          "description": "The Amazon Web Services account ID that owns the principal identified in the internal access finding."
        },
        "accessType": {
          "type": "string",
          "description": "The type of internal access identified in the finding. This indicates how the access is granted within your Amazon Web Services environment."
        },
        "principalType": {
          "type": "string",
          "description": "The type of principal identified in the internal access finding, such as IAM role or IAM user."
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FindingSource"
          },
          "description": "The sources of the internal access finding. This indicates how the access that generated the finding is granted within your Amazon Web Services environment."
        },
        "resourceControlPolicyRestriction": {
          "type": "string",
          "description": "The type of restriction applied to the finding by the resource owner with an Organizations resource control policy (RCP). APPLICABLE: There is an RCP present in the organization but IAM Access Analyzer does not include it in the evaluation of effective permissions. For example, if s3:DeleteObject is blocked by the RCP and the restriction is APPLICABLE, then s3:DeleteObject would still be included in the list of actions for the finding. Only applicable to internal access findings with the account as the zone of trust. FAILED_TO_EVALUATE_RCP: There was an error evaluating the RCP. NOT_APPLICABLE"
        },
        "serviceControlPolicyRestriction": {
          "type": "string",
          "description": "The type of restriction applied to the finding by an Organizations service control policy (SCP). APPLICABLE: There is an SCP present in the organization but IAM Access Analyzer does not include it in the evaluation of effective permissions. Only applicable to internal access findings with the account as the zone of trust. FAILED_TO_EVALUATE_SCP: There was an error evaluating the SCP. NOT_APPLICABLE: There was no SCP present in the organization. For internal access findings with the account as the zone of trust, NOT_APPLICABLE could also indicate that there was no SCP applicable to the principa"
        }
      }
    },
    "UnusedAction": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "description": "The action for which the unused access finding was generated."
        },
        "lastAccessed": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the action was last accessed."
        }
      },
      "required": [
        "action"
      ]
    },
    "UnusedIamRoleDetails": {
      "type": "object",
      "properties": {
        "lastAccessed": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the role was last accessed."
        }
      }
    },
    "UnusedIamUserAccessKeyDetails": {
      "type": "object",
      "properties": {
        "accessKeyId": {
          "type": "string",
          "description": "The ID of the access key for which the unused access finding was generated."
        },
        "lastAccessed": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the access key was last accessed."
        }
      },
      "required": [
        "accessKeyId"
      ]
    },
    "UnusedIamUserPasswordDetails": {
      "type": "object",
      "properties": {
        "lastAccessed": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the password was last accessed."
        }
      }
    },
    "UnusedPermissionDetails": {
      "type": "object",
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UnusedAction"
          },
          "description": "A list of unused actions for which the unused access finding was generated."
        },
        "serviceNamespace": {
          "type": "string",
          "description": "The namespace of the Amazon Web Services service that contains the unused actions."
        },
        "lastAccessed": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the permission was last accessed."
        }
      },
      "required": [
        "serviceNamespace"
      ]
    }
  }
}