Skip to content

Returns a list of resources

Description

Returns a list of resources.

You can use the Scopes parameter to define the data boundary for the query. Currently, Scopes supports AwsOrganizations, which lets you retrieve resources from your entire organization or from specific organizational units. Only the delegated administrator account can use Scopes.

You can use the Filters parameter to refine results based on resource attributes. You can use Scopes and Filters independently or together. When both are provided, Scopes narrows the data set first, and then Filters refines results within that scoped data set.

For AI/ML resources, the response includes the ResourceSubCategory field. For self-hosted AI resources and their host resources, the response also includes ResourceInfo with AI-specific details. Self-hosted AI resources use a ResourceType with the SelfHosted::AI:: prefix, such as SelfHosted::AI::Model, SelfHosted::AI::Agent, SelfHosted::AI::InferenceEndpoint, and SelfHosted::AI::ExternalEndpoint.

If you filter by ResourceSubCategory, you must also include a ResourceCategory string filter with comparison set to EQUALS and value AI/ML in the same request.

Usage

securityhub_get_resources_v2(Filters, Scopes, SortCriteria, NextToken,
  MaxResults)

Arguments

  • Filters

    Filters resources based on a set of criteria.

  • Scopes

    Limits the results to resources from specific organizational units or from the delegated administrator's organization. Only the delegated administrator account can use this parameter. Other accounts receive an AccessDeniedException.

    This parameter is optional. If you omit it, the delegated administrator sees resources from all accounts across the entire organization. Other accounts see only their own resources.

    You can specify up to 10 entries in Scopes.AwsOrganizations. If multiple entries are specified, the entries are combined using OR logic.

  • SortCriteria

    The resource attributes used to sort the list of returned resources.

  • NextToken

    The token required for pagination. On your first call, set the value of this parameter to NULL. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response.

  • MaxResults

    The maximum number of results to return.

Value

A list with the following syntax:

list(
  Resources = list(
    list(
      ResourceGuid = "string",
      ResourceId = "string",
      AccountId = "string",
      AccountName = "string",
      Region = "string",
      ResourceProvider = "string",
      ResourceOwnerAccountId = "string",
      ResourceOwnerOrgId = "string",
      ResourceCloudPartition = "string",
      ResourceRegion = "string",
      ResourceCategory = "Compute"|"Database"|"Storage"|"Code"|"AI/ML"|"Identity"|"Network"|"Messaging"|"Other",
      ResourceType = "string",
      ResourceName = "string",
      ResourceCreationTimeDt = "string",
      ResourceDetailCaptureTimeDt = "string",
      FindingsSummary = list(
        list(
          FindingType = "string",
          ProductName = "string",
          TotalFindings = 123,
          Severities = list(
            Other = 123,
            Fatal = 123,
            Critical = 123,
            High = 123,
            Medium = 123,
            Low = 123,
            Informational = 123,
            Unknown = 123
          )
        )
      ),
      ResourceTags = list(
        list(
          Key = "string",
          Value = "string"
        )
      ),
      ResourceConfig = list(),
      ResourceSubCategory = "Model"|"ModelServing"|"Agent"|"AgentFramework"|"AgentToolsAndIdentity"|"SafetyAndGuardrail"|"KnowledgeAndData"|"OrchestrationAndPipeline"|"ExternalEndpoint"|"Development"|"Other",
      DiscoveryType = "Managed"|"SelfHosted",
      ResourceInfo = list(
        AIDetails = list(
          HostResourceGuid = "string",
          HostResourceType = "string",
          CanonicalId = "string",
          SelfHostedAIModelResourceCount = 123,
          SelfHostedAIAgentResourceCount = 123,
          SelfHostedAIModelServingResourceCount = 123,
          SelfHostedAIExternalEndpointResourceCount = 123,
          SelfHostedAIDevelopmentResourceCount = 123,
          SelfHostedAIAgentFrameworkResourceCount = 123,
          SelfHostedAIAgentToolsAndIdentityResourceCount = 123,
          SelfHostedTotalAIResourceCount = 123
        )
      )
    )
  ),
  NextToken = "string"
)

Request syntax

svc$get_resources_v2(
  Filters = list(
    CompositeFilters = list(
      list(
        StringFilters = list(
          list(
            FieldName = "ResourceGuid"|"ResourceId"|"AccountId"|"AccountName"|"Region"|"ResourceProvider"|"ResourceOwnerAccountId"|"ResourceOwnerOrgId"|"ResourceCloudPartition"|"ResourceRegion"|"ResourceCategory"|"ResourceType"|"ResourceName"|"FindingsSummary.FindingType"|"FindingsSummary.ProductName"|"ResourceSubCategory"|"DiscoveryType"|"ResourceInfo.AIDetails.HostResourceGuid"|"ResourceInfo.AIDetails.HostResourceType"|"ResourceInfo.AIDetails.CanonicalId",
            Filter = list(
              Value = "string",
              Comparison = "EQUALS"|"PREFIX"|"NOT_EQUALS"|"PREFIX_NOT_EQUALS"|"CONTAINS"|"NOT_CONTAINS"|"CONTAINS_WORD"
            )
          )
        ),
        DateFilters = list(
          list(
            FieldName = "ResourceDetailCaptureTime"|"ResourceCreationTime",
            Filter = list(
              Start = "string",
              End = "string",
              DateRange = list(
                Value = 123,
                Unit = "DAYS",
                Comparison = "WITHIN"|"OLDER_THAN"
              )
            )
          )
        ),
        NumberFilters = list(
          list(
            FieldName = "FindingsSummary.TotalFindings"|"FindingsSummary.Severities.Other"|"FindingsSummary.Severities.Fatal"|"FindingsSummary.Severities.Critical"|"FindingsSummary.Severities.High"|"FindingsSummary.Severities.Medium"|"FindingsSummary.Severities.Low"|"FindingsSummary.Severities.Informational"|"FindingsSummary.Severities.Unknown"|"ResourceInfo.AIDetails.SelfHostedAIModelResourceCount"|"ResourceInfo.AIDetails.SelfHostedAIAgentResourceCount"|"ResourceInfo.AIDetails.SelfHostedAIModelServingResourceCount"|"ResourceInfo.AIDetails.SelfHostedAIExternalEndpointResourceCount"|"ResourceInfo.AIDetails.SelfHostedAIDevelopmentResourceCount"|"ResourceInfo.AIDetails.SelfHostedAIAgentFrameworkResourceCount"|"ResourceInfo.AIDetails.SelfHostedAIAgentToolsAndIdentityResourceCount"|"ResourceInfo.AIDetails.SelfHostedTotalAIResourceCount",
            Filter = list(
              Gte = 123.0,
              Lte = 123.0,
              Eq = 123.0,
              Gt = 123.0,
              Lt = 123.0
            )
          )
        ),
        MapFilters = list(
          list(
            FieldName = "ResourceTags",
            Filter = list(
              Key = "string",
              Value = "string",
              Comparison = "EQUALS"|"NOT_EQUALS"|"CONTAINS"|"NOT_CONTAINS"
            )
          )
        ),
        NestedCompositeFilters = list(),
        Operator = "AND"|"OR"
      )
    ),
    CompositeOperator = "AND"|"OR"
  ),
  Scopes = list(
    AwsOrganizations = list(
      list(
        OrganizationId = "string",
        OrganizationalUnitId = "string"
      )
    )
  ),
  SortCriteria = list(
    list(
      Field = "string",
      SortOrder = "asc"|"desc"
    )
  ),
  NextToken = "string",
  MaxResults = 123
)