GetInsightsCommand

Lists and describes insights for the specified insight ARNs.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SecurityHubClient, GetInsightsCommand } from "@aws-sdk/client-securityhub"; // ES Modules import
// const { SecurityHubClient, GetInsightsCommand } = require("@aws-sdk/client-securityhub"); // CommonJS import
const client = new SecurityHubClient(config);
const input = { // GetInsightsRequest
  InsightArns: [ // ArnList
    "STRING_VALUE",
  ],
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new GetInsightsCommand(input);
const response = await client.send(command);
// { // GetInsightsResponse
//   Insights: [ // InsightList // required
//     { // Insight
//       InsightArn: "STRING_VALUE", // required
//       Name: "STRING_VALUE", // required
//       Filters: { // AwsSecurityFindingFilters
//         ProductArn: [ // StringFilterList
//           { // StringFilter
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "PREFIX" || "NOT_EQUALS" || "PREFIX_NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         AwsAccountId: [
//           {
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "PREFIX" || "NOT_EQUALS" || "PREFIX_NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         Id: [
//           {
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "PREFIX" || "NOT_EQUALS" || "PREFIX_NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         GeneratorId: [
//           {
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "PREFIX" || "NOT_EQUALS" || "PREFIX_NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         Region: [
//           {
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "PREFIX" || "NOT_EQUALS" || "PREFIX_NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         Type: "<StringFilterList>",
//         FirstObservedAt: [ // DateFilterList
//           { // DateFilter
//             Start: "STRING_VALUE",
//             End: "STRING_VALUE",
//             DateRange: { // DateRange
//               Value: Number("int"),
//               Unit: "DAYS",
//             },
//           },
//         ],
//         LastObservedAt: [
//           {
//             Start: "STRING_VALUE",
//             End: "STRING_VALUE",
//             DateRange: {
//               Value: Number("int"),
//               Unit: "DAYS",
//             },
//           },
//         ],
//         CreatedAt: [
//           {
//             Start: "STRING_VALUE",
//             End: "STRING_VALUE",
//             DateRange: {
//               Value: Number("int"),
//               Unit: "DAYS",
//             },
//           },
//         ],
//         UpdatedAt: [
//           {
//             Start: "STRING_VALUE",
//             End: "STRING_VALUE",
//             DateRange: {
//               Value: Number("int"),
//               Unit: "DAYS",
//             },
//           },
//         ],
//         SeverityProduct: [ // NumberFilterList
//           { // NumberFilter
//             Gte: Number("double"),
//             Lte: Number("double"),
//             Eq: Number("double"),
//             Gt: Number("double"),
//             Lt: Number("double"),
//           },
//         ],
//         SeverityNormalized: [
//           {
//             Gte: Number("double"),
//             Lte: Number("double"),
//             Eq: Number("double"),
//             Gt: Number("double"),
//             Lt: Number("double"),
//           },
//         ],
//         SeverityLabel: "<StringFilterList>",
//         Confidence: [
//           {
//             Gte: Number("double"),
//             Lte: Number("double"),
//             Eq: Number("double"),
//             Gt: Number("double"),
//             Lt: Number("double"),
//           },
//         ],
//         Criticality: [
//           {
//             Gte: Number("double"),
//             Lte: Number("double"),
//             Eq: Number("double"),
//             Gt: Number("double"),
//             Lt: Number("double"),
//           },
//         ],
//         Title: "<StringFilterList>",
//         Description: "<StringFilterList>",
//         RecommendationText: "<StringFilterList>",
//         SourceUrl: "<StringFilterList>",
//         ProductFields: [ // MapFilterList
//           { // MapFilter
//             Key: "STRING_VALUE",
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         ProductName: "<StringFilterList>",
//         CompanyName: "<StringFilterList>",
//         UserDefinedFields: [
//           {
//             Key: "STRING_VALUE",
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         MalwareName: "<StringFilterList>",
//         MalwareType: "<StringFilterList>",
//         MalwarePath: "<StringFilterList>",
//         MalwareState: "<StringFilterList>",
//         NetworkDirection: "<StringFilterList>",
//         NetworkProtocol: "<StringFilterList>",
//         NetworkSourceIpV4: [ // IpFilterList
//           { // IpFilter
//             Cidr: "STRING_VALUE",
//           },
//         ],
//         NetworkSourceIpV6: [
//           {
//             Cidr: "STRING_VALUE",
//           },
//         ],
//         NetworkSourcePort: [
//           {
//             Gte: Number("double"),
//             Lte: Number("double"),
//             Eq: Number("double"),
//             Gt: Number("double"),
//             Lt: Number("double"),
//           },
//         ],
//         NetworkSourceDomain: "<StringFilterList>",
//         NetworkSourceMac: "<StringFilterList>",
//         NetworkDestinationIpV4: [
//           {
//             Cidr: "STRING_VALUE",
//           },
//         ],
//         NetworkDestinationIpV6: [
//           {
//             Cidr: "STRING_VALUE",
//           },
//         ],
//         NetworkDestinationPort: "<NumberFilterList>",
//         NetworkDestinationDomain: "<StringFilterList>",
//         ProcessName: "<StringFilterList>",
//         ProcessPath: "<StringFilterList>",
//         ProcessPid: "<NumberFilterList>",
//         ProcessParentPid: "<NumberFilterList>",
//         ProcessLaunchedAt: [
//           {
//             Start: "STRING_VALUE",
//             End: "STRING_VALUE",
//             DateRange: {
//               Value: Number("int"),
//               Unit: "DAYS",
//             },
//           },
//         ],
//         ProcessTerminatedAt: "<DateFilterList>",
//         ThreatIntelIndicatorType: "<StringFilterList>",
//         ThreatIntelIndicatorValue: "<StringFilterList>",
//         ThreatIntelIndicatorCategory: "<StringFilterList>",
//         ThreatIntelIndicatorLastObservedAt: "<DateFilterList>",
//         ThreatIntelIndicatorSource: "<StringFilterList>",
//         ThreatIntelIndicatorSourceUrl: "<StringFilterList>",
//         ResourceType: "<StringFilterList>",
//         ResourceId: "<StringFilterList>",
//         ResourcePartition: "<StringFilterList>",
//         ResourceRegion: "<StringFilterList>",
//         ResourceTags: [
//           {
//             Key: "STRING_VALUE",
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         ResourceAwsEc2InstanceType: "<StringFilterList>",
//         ResourceAwsEc2InstanceImageId: "<StringFilterList>",
//         ResourceAwsEc2InstanceIpV4Addresses: [
//           {
//             Cidr: "STRING_VALUE",
//           },
//         ],
//         ResourceAwsEc2InstanceIpV6Addresses: "<IpFilterList>",
//         ResourceAwsEc2InstanceKeyName: "<StringFilterList>",
//         ResourceAwsEc2InstanceIamInstanceProfileArn: "<StringFilterList>",
//         ResourceAwsEc2InstanceVpcId: "<StringFilterList>",
//         ResourceAwsEc2InstanceSubnetId: "<StringFilterList>",
//         ResourceAwsEc2InstanceLaunchedAt: "<DateFilterList>",
//         ResourceAwsS3BucketOwnerId: "<StringFilterList>",
//         ResourceAwsS3BucketOwnerName: "<StringFilterList>",
//         ResourceAwsIamAccessKeyUserName: "<StringFilterList>",
//         ResourceAwsIamAccessKeyPrincipalName: "<StringFilterList>",
//         ResourceAwsIamAccessKeyStatus: "<StringFilterList>",
//         ResourceAwsIamAccessKeyCreatedAt: "<DateFilterList>",
//         ResourceAwsIamUserUserName: "<StringFilterList>",
//         ResourceContainerName: "<StringFilterList>",
//         ResourceContainerImageId: "<StringFilterList>",
//         ResourceContainerImageName: "<StringFilterList>",
//         ResourceContainerLaunchedAt: "<DateFilterList>",
//         ResourceDetailsOther: [
//           {
//             Key: "STRING_VALUE",
//             Value: "STRING_VALUE",
//             Comparison: "EQUALS" || "NOT_EQUALS" || "CONTAINS" || "NOT_CONTAINS",
//           },
//         ],
//         ComplianceStatus: "<StringFilterList>",
//         VerificationState: "<StringFilterList>",
//         WorkflowState: "<StringFilterList>",
//         WorkflowStatus: "<StringFilterList>",
//         RecordState: "<StringFilterList>",
//         RelatedFindingsProductArn: "<StringFilterList>",
//         RelatedFindingsId: "<StringFilterList>",
//         NoteText: "<StringFilterList>",
//         NoteUpdatedAt: "<DateFilterList>",
//         NoteUpdatedBy: "<StringFilterList>",
//         Keyword: [ // KeywordFilterList
//           { // KeywordFilter
//             Value: "STRING_VALUE",
//           },
//         ],
//         FindingProviderFieldsConfidence: "<NumberFilterList>",
//         FindingProviderFieldsCriticality: "<NumberFilterList>",
//         FindingProviderFieldsRelatedFindingsId: "<StringFilterList>",
//         FindingProviderFieldsRelatedFindingsProductArn: "<StringFilterList>",
//         FindingProviderFieldsSeverityLabel: "<StringFilterList>",
//         FindingProviderFieldsSeverityOriginal: "<StringFilterList>",
//         FindingProviderFieldsTypes: "<StringFilterList>",
//         Sample: [ // BooleanFilterList
//           { // BooleanFilter
//             Value: true || false,
//           },
//         ],
//         ComplianceSecurityControlId: "<StringFilterList>",
//         ComplianceAssociatedStandardsId: "<StringFilterList>",
//         VulnerabilitiesExploitAvailable: "<StringFilterList>",
//         VulnerabilitiesFixAvailable: "<StringFilterList>",
//         ComplianceSecurityControlParametersName: "<StringFilterList>",
//         ComplianceSecurityControlParametersValue: "<StringFilterList>",
//         AwsAccountName: "<StringFilterList>",
//         ResourceApplicationName: "<StringFilterList>",
//         ResourceApplicationArn: "<StringFilterList>",
//       },
//       GroupByAttribute: "STRING_VALUE", // required
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

Example Usage

 Loading code editorLoading code editor

GetInsightsCommand Input

See GetInsightsCommandInput for more details

Parameter
Type
Description
InsightArns
string[] | undefined

The ARNs of the insights to describe. If you don't provide any insight ARNs, then GetInsights returns all of your custom insights. It does not return any managed insights.

MaxResults
number | undefined

The maximum number of items to return in the response.

NextToken
string | undefined

The token that is required for pagination. On your first call to the GetInsights operation, set the value of this parameter to NULL.

For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.

GetInsightsCommand Output

See GetInsightsCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Insights
Required
Insight[] | undefined

The insights returned by the operation.

NextToken
string | undefined

The pagination token to use to request the next page of results.

Throws

Name
Fault
Details
InternalException
server

Internal server error.

InvalidAccessException
client

The account doesn't have permission to perform this action.

InvalidInputException
client

The request was rejected because you supplied an invalid or out-of-range value for an input parameter.

LimitExceededException
client

The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.

ResourceNotFoundException
client

The request was rejected because we can't find the specified resource.

SecurityHubServiceException
Base exception class for all service exceptions from SecurityHub service.