@aws-sdk/client-inspector2 3.326.0 → 3.328.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +8 -0
  2. package/dist-cjs/Inspector2.js +2 -0
  3. package/dist-cjs/commands/SearchVulnerabilitiesCommand.js +45 -0
  4. package/dist-cjs/commands/index.js +1 -0
  5. package/dist-cjs/models/models_0.js +4 -1
  6. package/dist-cjs/pagination/SearchVulnerabilitiesPaginator.js +28 -0
  7. package/dist-cjs/pagination/index.js +1 -0
  8. package/dist-cjs/protocols/Aws_restJson1.js +135 -2
  9. package/dist-es/Inspector2.js +2 -0
  10. package/dist-es/commands/SearchVulnerabilitiesCommand.js +41 -0
  11. package/dist-es/commands/index.js +1 -0
  12. package/dist-es/models/models_0.js +3 -0
  13. package/dist-es/pagination/SearchVulnerabilitiesPaginator.js +24 -0
  14. package/dist-es/pagination/index.js +1 -0
  15. package/dist-es/protocols/Aws_restJson1.js +131 -0
  16. package/dist-types/Inspector2.d.ts +7 -0
  17. package/dist-types/Inspector2Client.d.ts +3 -2
  18. package/dist-types/commands/SearchVulnerabilitiesCommand.d.ts +140 -0
  19. package/dist-types/commands/index.d.ts +1 -0
  20. package/dist-types/models/models_0.d.ts +217 -0
  21. package/dist-types/pagination/SearchVulnerabilitiesPaginator.d.ts +7 -0
  22. package/dist-types/pagination/index.d.ts +1 -0
  23. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  24. package/dist-types/ts3.4/Inspector2.d.ts +17 -0
  25. package/dist-types/ts3.4/Inspector2Client.d.ts +6 -0
  26. package/dist-types/ts3.4/commands/SearchVulnerabilitiesCommand.d.ts +41 -0
  27. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  28. package/dist-types/ts3.4/models/models_0.d.ts +61 -0
  29. package/dist-types/ts3.4/pagination/SearchVulnerabilitiesPaginator.d.ts +11 -0
  30. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  31. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
  32. package/package.json +8 -8
package/README.md CHANGED
@@ -446,6 +446,14 @@ ListUsageTotals
446
446
 
447
447
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-inspector2/classes/listusagetotalscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-inspector2/interfaces/listusagetotalscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-inspector2/interfaces/listusagetotalscommandoutput.html)
448
448
 
449
+ </details>
450
+ <details>
451
+ <summary>
452
+ SearchVulnerabilities
453
+ </summary>
454
+
455
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-inspector2/classes/searchvulnerabilitiescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-inspector2/interfaces/searchvulnerabilitiescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-inspector2/interfaces/searchvulnerabilitiescommandoutput.html)
456
+
449
457
  </details>
450
458
  <details>
451
459
  <summary>
@@ -32,6 +32,7 @@ const ListFindingsCommand_1 = require("./commands/ListFindingsCommand");
32
32
  const ListMembersCommand_1 = require("./commands/ListMembersCommand");
33
33
  const ListTagsForResourceCommand_1 = require("./commands/ListTagsForResourceCommand");
34
34
  const ListUsageTotalsCommand_1 = require("./commands/ListUsageTotalsCommand");
35
+ const SearchVulnerabilitiesCommand_1 = require("./commands/SearchVulnerabilitiesCommand");
35
36
  const TagResourceCommand_1 = require("./commands/TagResourceCommand");
36
37
  const UntagResourceCommand_1 = require("./commands/UntagResourceCommand");
37
38
  const UpdateConfigurationCommand_1 = require("./commands/UpdateConfigurationCommand");
@@ -71,6 +72,7 @@ const commands = {
71
72
  ListMembersCommand: ListMembersCommand_1.ListMembersCommand,
72
73
  ListTagsForResourceCommand: ListTagsForResourceCommand_1.ListTagsForResourceCommand,
73
74
  ListUsageTotalsCommand: ListUsageTotalsCommand_1.ListUsageTotalsCommand,
75
+ SearchVulnerabilitiesCommand: SearchVulnerabilitiesCommand_1.SearchVulnerabilitiesCommand,
74
76
  TagResourceCommand: TagResourceCommand_1.TagResourceCommand,
75
77
  UntagResourceCommand: UntagResourceCommand_1.UntagResourceCommand,
76
78
  UpdateConfigurationCommand: UpdateConfigurationCommand_1.UpdateConfigurationCommand,
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchVulnerabilitiesCommand = void 0;
4
+ const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint");
5
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
6
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
8
+ class SearchVulnerabilitiesCommand extends smithy_client_1.Command {
9
+ static getEndpointParameterInstructions() {
10
+ return {
11
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
12
+ Endpoint: { type: "builtInParams", name: "endpoint" },
13
+ Region: { type: "builtInParams", name: "region" },
14
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
15
+ };
16
+ }
17
+ constructor(input) {
18
+ super();
19
+ this.input = input;
20
+ }
21
+ resolveMiddleware(clientStack, configuration, options) {
22
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
23
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SearchVulnerabilitiesCommand.getEndpointParameterInstructions()));
24
+ const stack = clientStack.concat(this.middlewareStack);
25
+ const { logger } = configuration;
26
+ const clientName = "Inspector2Client";
27
+ const commandName = "SearchVulnerabilitiesCommand";
28
+ const handlerExecutionContext = {
29
+ logger,
30
+ clientName,
31
+ commandName,
32
+ inputFilterSensitiveLog: (_) => _,
33
+ outputFilterSensitiveLog: (_) => _,
34
+ };
35
+ const { requestHandler } = configuration;
36
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
37
+ }
38
+ serialize(input, context) {
39
+ return (0, Aws_restJson1_1.se_SearchVulnerabilitiesCommand)(input, context);
40
+ }
41
+ deserialize(output, context) {
42
+ return (0, Aws_restJson1_1.de_SearchVulnerabilitiesCommand)(output, context);
43
+ }
44
+ }
45
+ exports.SearchVulnerabilitiesCommand = SearchVulnerabilitiesCommand;
@@ -31,6 +31,7 @@ tslib_1.__exportStar(require("./ListFindingsCommand"), exports);
31
31
  tslib_1.__exportStar(require("./ListMembersCommand"), exports);
32
32
  tslib_1.__exportStar(require("./ListTagsForResourceCommand"), exports);
33
33
  tslib_1.__exportStar(require("./ListUsageTotalsCommand"), exports);
34
+ tslib_1.__exportStar(require("./SearchVulnerabilitiesCommand"), exports);
34
35
  tslib_1.__exportStar(require("./TagResourceCommand"), exports);
35
36
  tslib_1.__exportStar(require("./UntagResourceCommand"), exports);
36
37
  tslib_1.__exportStar(require("./UpdateConfigurationCommand"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RelationshipStatus = exports.Currency = exports.ReportFormat = exports.ServiceQuotaExceededException = exports.FilterAction = exports.ScanType = exports.ScanStatusCode = exports.ScanStatusReason = exports.EcrScanFrequency = exports.Ec2Platform = exports.CoverageResourceType = exports.CoverageMapComparison = exports.CoverageStringComparison = exports.GroupKey = exports.ConflictException = exports.Ec2DeepInspectionStatus = exports.FreeTrialInfoErrorCode = exports.FreeTrialType = exports.FreeTrialStatus = exports.ResourceNotFoundException = exports.BadRequestException = exports.Runtime = exports.PackageType = exports.ValidationException = exports.ValidationExceptionReason = exports.ThrottlingException = exports.InternalServerException = exports.Architecture = exports.AggregationType = exports.AggregationResponse = exports.AggregationRequest = exports.TitleSortBy = exports.RepositorySortBy = exports.PackageSortBy = exports.LambdaLayerSortBy = exports.LambdaFunctionSortBy = exports.ImageLayerSortBy = exports.FindingTypeSortBy = exports.Ec2InstanceSortBy = exports.MapComparison = exports.AwsEcrContainerSortBy = exports.AmiSortBy = exports.StringComparison = exports.ErrorCode = exports.SortOrder = exports.AccountSortBy = exports.AggregationResourceType = exports.AggregationFindingType = exports.Status = exports.AccessDeniedException = void 0;
4
- exports.UsageType = exports.SortField = exports.Operation = exports.Service = exports.ReportingErrorCode = exports.FindingType = exports.FindingStatus = exports.Severity = exports.ResourceType = exports.PackageManager = exports.NetworkProtocol = exports.FixAvailable = exports.ExternalReportStatus = exports.ExploitAvailable = exports.EcrRescanDurationStatus = exports.EcrRescanDuration = exports.ResourceScanType = exports.DelegatedAdminStatus = void 0;
4
+ exports.VulnerabilitySource = exports.UsageType = exports.SortField = exports.Operation = exports.Service = exports.ReportingErrorCode = exports.FindingType = exports.FindingStatus = exports.Severity = exports.ResourceType = exports.PackageManager = exports.NetworkProtocol = exports.FixAvailable = exports.ExternalReportStatus = exports.ExploitAvailable = exports.EcrRescanDurationStatus = exports.EcrRescanDuration = exports.ResourceScanType = exports.DelegatedAdminStatus = void 0;
5
5
  const Inspector2ServiceException_1 = require("./Inspector2ServiceException");
6
6
  class AccessDeniedException extends Inspector2ServiceException_1.Inspector2ServiceException {
7
7
  constructor(opts) {
@@ -549,3 +549,6 @@ exports.UsageType = {
549
549
  ECR_RESCAN: "ECR_RESCAN",
550
550
  LAMBDA_FUNCTION_HOURS: "LAMBDA_FUNCTION_HOURS",
551
551
  };
552
+ exports.VulnerabilitySource = {
553
+ NVD: "NVD",
554
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paginateSearchVulnerabilities = void 0;
4
+ const SearchVulnerabilitiesCommand_1 = require("../commands/SearchVulnerabilitiesCommand");
5
+ const Inspector2Client_1 = require("../Inspector2Client");
6
+ const makePagedClientRequest = async (client, input, ...args) => {
7
+ return await client.send(new SearchVulnerabilitiesCommand_1.SearchVulnerabilitiesCommand(input), ...args);
8
+ };
9
+ async function* paginateSearchVulnerabilities(config, input, ...additionalArguments) {
10
+ let token = config.startingToken || undefined;
11
+ let hasNext = true;
12
+ let page;
13
+ while (hasNext) {
14
+ input.nextToken = token;
15
+ if (config.client instanceof Inspector2Client_1.Inspector2Client) {
16
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
17
+ }
18
+ else {
19
+ throw new Error("Invalid client, expected Inspector2 | Inspector2Client");
20
+ }
21
+ yield page;
22
+ const prevToken = token;
23
+ token = page.nextToken;
24
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
25
+ }
26
+ return undefined;
27
+ }
28
+ exports.paginateSearchVulnerabilities = paginateSearchVulnerabilities;
@@ -11,3 +11,4 @@ tslib_1.__exportStar(require("./ListFindingAggregationsPaginator"), exports);
11
11
  tslib_1.__exportStar(require("./ListFindingsPaginator"), exports);
12
12
  tslib_1.__exportStar(require("./ListMembersPaginator"), exports);
13
13
  tslib_1.__exportStar(require("./ListUsageTotalsPaginator"), exports);
14
+ tslib_1.__exportStar(require("./SearchVulnerabilitiesPaginator"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_DisassociateMemberCommand = exports.de_DisableDelegatedAdminAccountCommand = exports.de_DisableCommand = exports.de_DescribeOrganizationConfigurationCommand = exports.de_DeleteFilterCommand = exports.de_CreateFindingsReportCommand = exports.de_CreateFilterCommand = exports.de_CancelFindingsReportCommand = exports.de_BatchUpdateMemberEc2DeepInspectionStatusCommand = exports.de_BatchGetMemberEc2DeepInspectionStatusCommand = exports.de_BatchGetFreeTrialInfoCommand = exports.de_BatchGetAccountStatusCommand = exports.de_AssociateMemberCommand = exports.se_UpdateOrgEc2DeepInspectionConfigurationCommand = exports.se_UpdateOrganizationConfigurationCommand = exports.se_UpdateFilterCommand = exports.se_UpdateEc2DeepInspectionConfigurationCommand = exports.se_UpdateConfigurationCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListUsageTotalsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListMembersCommand = exports.se_ListFindingsCommand = exports.se_ListFindingAggregationsCommand = exports.se_ListFiltersCommand = exports.se_ListDelegatedAdminAccountsCommand = exports.se_ListCoverageStatisticsCommand = exports.se_ListCoverageCommand = exports.se_ListAccountPermissionsCommand = exports.se_GetMemberCommand = exports.se_GetFindingsReportStatusCommand = exports.se_GetEc2DeepInspectionConfigurationCommand = exports.se_GetDelegatedAdminAccountCommand = exports.se_GetConfigurationCommand = exports.se_EnableDelegatedAdminAccountCommand = exports.se_EnableCommand = exports.se_DisassociateMemberCommand = exports.se_DisableDelegatedAdminAccountCommand = exports.se_DisableCommand = exports.se_DescribeOrganizationConfigurationCommand = exports.se_DeleteFilterCommand = exports.se_CreateFindingsReportCommand = exports.se_CreateFilterCommand = exports.se_CancelFindingsReportCommand = exports.se_BatchUpdateMemberEc2DeepInspectionStatusCommand = exports.se_BatchGetMemberEc2DeepInspectionStatusCommand = exports.se_BatchGetFreeTrialInfoCommand = exports.se_BatchGetAccountStatusCommand = exports.se_AssociateMemberCommand = void 0;
4
- exports.de_UpdateOrgEc2DeepInspectionConfigurationCommand = exports.de_UpdateOrganizationConfigurationCommand = exports.de_UpdateFilterCommand = exports.de_UpdateEc2DeepInspectionConfigurationCommand = exports.de_UpdateConfigurationCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListUsageTotalsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListMembersCommand = exports.de_ListFindingsCommand = exports.de_ListFindingAggregationsCommand = exports.de_ListFiltersCommand = exports.de_ListDelegatedAdminAccountsCommand = exports.de_ListCoverageStatisticsCommand = exports.de_ListCoverageCommand = exports.de_ListAccountPermissionsCommand = exports.de_GetMemberCommand = exports.de_GetFindingsReportStatusCommand = exports.de_GetEc2DeepInspectionConfigurationCommand = exports.de_GetDelegatedAdminAccountCommand = exports.de_GetConfigurationCommand = exports.de_EnableDelegatedAdminAccountCommand = exports.de_EnableCommand = void 0;
3
+ exports.de_DisableDelegatedAdminAccountCommand = exports.de_DisableCommand = exports.de_DescribeOrganizationConfigurationCommand = exports.de_DeleteFilterCommand = exports.de_CreateFindingsReportCommand = exports.de_CreateFilterCommand = exports.de_CancelFindingsReportCommand = exports.de_BatchUpdateMemberEc2DeepInspectionStatusCommand = exports.de_BatchGetMemberEc2DeepInspectionStatusCommand = exports.de_BatchGetFreeTrialInfoCommand = exports.de_BatchGetAccountStatusCommand = exports.de_AssociateMemberCommand = exports.se_UpdateOrgEc2DeepInspectionConfigurationCommand = exports.se_UpdateOrganizationConfigurationCommand = exports.se_UpdateFilterCommand = exports.se_UpdateEc2DeepInspectionConfigurationCommand = exports.se_UpdateConfigurationCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_SearchVulnerabilitiesCommand = exports.se_ListUsageTotalsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListMembersCommand = exports.se_ListFindingsCommand = exports.se_ListFindingAggregationsCommand = exports.se_ListFiltersCommand = exports.se_ListDelegatedAdminAccountsCommand = exports.se_ListCoverageStatisticsCommand = exports.se_ListCoverageCommand = exports.se_ListAccountPermissionsCommand = exports.se_GetMemberCommand = exports.se_GetFindingsReportStatusCommand = exports.se_GetEc2DeepInspectionConfigurationCommand = exports.se_GetDelegatedAdminAccountCommand = exports.se_GetConfigurationCommand = exports.se_EnableDelegatedAdminAccountCommand = exports.se_EnableCommand = exports.se_DisassociateMemberCommand = exports.se_DisableDelegatedAdminAccountCommand = exports.se_DisableCommand = exports.se_DescribeOrganizationConfigurationCommand = exports.se_DeleteFilterCommand = exports.se_CreateFindingsReportCommand = exports.se_CreateFilterCommand = exports.se_CancelFindingsReportCommand = exports.se_BatchUpdateMemberEc2DeepInspectionStatusCommand = exports.se_BatchGetMemberEc2DeepInspectionStatusCommand = exports.se_BatchGetFreeTrialInfoCommand = exports.se_BatchGetAccountStatusCommand = exports.se_AssociateMemberCommand = void 0;
4
+ exports.de_UpdateOrgEc2DeepInspectionConfigurationCommand = exports.de_UpdateOrganizationConfigurationCommand = exports.de_UpdateFilterCommand = exports.de_UpdateEc2DeepInspectionConfigurationCommand = exports.de_UpdateConfigurationCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_SearchVulnerabilitiesCommand = exports.de_ListUsageTotalsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListMembersCommand = exports.de_ListFindingsCommand = exports.de_ListFindingAggregationsCommand = exports.de_ListFiltersCommand = exports.de_ListDelegatedAdminAccountsCommand = exports.de_ListCoverageStatisticsCommand = exports.de_ListCoverageCommand = exports.de_ListAccountPermissionsCommand = exports.de_GetMemberCommand = exports.de_GetFindingsReportStatusCommand = exports.de_GetEc2DeepInspectionConfigurationCommand = exports.de_GetDelegatedAdminAccountCommand = exports.de_GetConfigurationCommand = exports.de_EnableDelegatedAdminAccountCommand = exports.de_EnableCommand = exports.de_DisassociateMemberCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const uuid_1 = require("uuid");
@@ -658,6 +658,28 @@ const se_ListUsageTotalsCommand = async (input, context) => {
658
658
  });
659
659
  };
660
660
  exports.se_ListUsageTotalsCommand = se_ListUsageTotalsCommand;
661
+ const se_SearchVulnerabilitiesCommand = async (input, context) => {
662
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
663
+ const headers = {
664
+ "content-type": "application/json",
665
+ };
666
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/vulnerabilities/search";
667
+ let body;
668
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
669
+ filterCriteria: (_) => (0, smithy_client_1._json)(_),
670
+ nextToken: [],
671
+ }));
672
+ return new protocol_http_1.HttpRequest({
673
+ protocol,
674
+ hostname,
675
+ port,
676
+ method: "POST",
677
+ headers,
678
+ path: resolvedPath,
679
+ body,
680
+ });
681
+ };
682
+ exports.se_SearchVulnerabilitiesCommand = se_SearchVulnerabilitiesCommand;
661
683
  const se_TagResourceCommand = async (input, context) => {
662
684
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
663
685
  const headers = {
@@ -2162,6 +2184,50 @@ const de_ListUsageTotalsCommandError = async (output, context) => {
2162
2184
  });
2163
2185
  }
2164
2186
  };
2187
+ const de_SearchVulnerabilitiesCommand = async (output, context) => {
2188
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2189
+ return de_SearchVulnerabilitiesCommandError(output, context);
2190
+ }
2191
+ const contents = (0, smithy_client_1.map)({
2192
+ $metadata: deserializeMetadata(output),
2193
+ });
2194
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2195
+ const doc = (0, smithy_client_1.take)(data, {
2196
+ nextToken: smithy_client_1.expectString,
2197
+ vulnerabilities: (_) => de_Vulnerabilities(_, context),
2198
+ });
2199
+ Object.assign(contents, doc);
2200
+ return contents;
2201
+ };
2202
+ exports.de_SearchVulnerabilitiesCommand = de_SearchVulnerabilitiesCommand;
2203
+ const de_SearchVulnerabilitiesCommandError = async (output, context) => {
2204
+ const parsedOutput = {
2205
+ ...output,
2206
+ body: await parseErrorBody(output.body, context),
2207
+ };
2208
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2209
+ switch (errorCode) {
2210
+ case "AccessDeniedException":
2211
+ case "com.amazonaws.inspector2#AccessDeniedException":
2212
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2213
+ case "InternalServerException":
2214
+ case "com.amazonaws.inspector2#InternalServerException":
2215
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
2216
+ case "ThrottlingException":
2217
+ case "com.amazonaws.inspector2#ThrottlingException":
2218
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
2219
+ case "ValidationException":
2220
+ case "com.amazonaws.inspector2#ValidationException":
2221
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2222
+ default:
2223
+ const parsedBody = parsedOutput.body;
2224
+ return throwDefaultError({
2225
+ output,
2226
+ parsedBody,
2227
+ errorCode,
2228
+ });
2229
+ }
2230
+ };
2165
2231
  const de_TagResourceCommand = async (output, context) => {
2166
2232
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2167
2233
  return de_TagResourceCommandError(output, context);
@@ -2728,6 +2794,14 @@ const de_AggregationResponseList = (output, context) => {
2728
2794
  });
2729
2795
  return retVal;
2730
2796
  };
2797
+ const de_AtigData = (output, context) => {
2798
+ return (0, smithy_client_1.take)(output, {
2799
+ firstSeen: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2800
+ lastSeen: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2801
+ targets: smithy_client_1._json,
2802
+ ttps: smithy_client_1._json,
2803
+ });
2804
+ };
2731
2805
  const de_AwsEc2InstanceDetails = (output, context) => {
2732
2806
  return (0, smithy_client_1.take)(output, {
2733
2807
  iamInstanceProfileArn: smithy_client_1.expectString,
@@ -2768,6 +2842,25 @@ const de_AwsLambdaFunctionDetails = (output, context) => {
2768
2842
  vpcConfig: smithy_client_1._json,
2769
2843
  });
2770
2844
  };
2845
+ const de_CisaData = (output, context) => {
2846
+ return (0, smithy_client_1.take)(output, {
2847
+ action: smithy_client_1.expectString,
2848
+ dateAdded: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2849
+ dateDue: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2850
+ });
2851
+ };
2852
+ const de_Cvss2 = (output, context) => {
2853
+ return (0, smithy_client_1.take)(output, {
2854
+ baseScore: smithy_client_1.limitedParseDouble,
2855
+ scoringVector: smithy_client_1.expectString,
2856
+ });
2857
+ };
2858
+ const de_Cvss3 = (output, context) => {
2859
+ return (0, smithy_client_1.take)(output, {
2860
+ baseScore: smithy_client_1.limitedParseDouble,
2861
+ scoringVector: smithy_client_1.expectString,
2862
+ });
2863
+ };
2771
2864
  const de_CvssScore = (output, context) => {
2772
2865
  return (0, smithy_client_1.take)(output, {
2773
2866
  baseScore: smithy_client_1.limitedParseDouble,
@@ -2820,11 +2913,22 @@ const de_EcrRescanDurationState = (output, context) => {
2820
2913
  updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2821
2914
  });
2822
2915
  };
2916
+ const de_Epss = (output, context) => {
2917
+ return (0, smithy_client_1.take)(output, {
2918
+ score: smithy_client_1.limitedParseDouble,
2919
+ });
2920
+ };
2823
2921
  const de_ExploitabilityDetails = (output, context) => {
2824
2922
  return (0, smithy_client_1.take)(output, {
2825
2923
  lastKnownExploitAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2826
2924
  });
2827
2925
  };
2926
+ const de_ExploitObserved = (output, context) => {
2927
+ return (0, smithy_client_1.take)(output, {
2928
+ firstSeen: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2929
+ lastSeen: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2930
+ });
2931
+ };
2828
2932
  const de_Filter = (output, context) => {
2829
2933
  return (0, smithy_client_1.take)(output, {
2830
2934
  action: smithy_client_1.expectString,
@@ -3084,6 +3188,35 @@ const de_UsageTotalList = (output, context) => {
3084
3188
  });
3085
3189
  return retVal;
3086
3190
  };
3191
+ const de_Vulnerabilities = (output, context) => {
3192
+ const retVal = (output || [])
3193
+ .filter((e) => e != null)
3194
+ .map((entry) => {
3195
+ return de_Vulnerability(entry, context);
3196
+ });
3197
+ return retVal;
3198
+ };
3199
+ const de_Vulnerability = (output, context) => {
3200
+ return (0, smithy_client_1.take)(output, {
3201
+ atigData: (_) => de_AtigData(_, context),
3202
+ cisaData: (_) => de_CisaData(_, context),
3203
+ cvss2: (_) => de_Cvss2(_, context),
3204
+ cvss3: (_) => de_Cvss3(_, context),
3205
+ cwes: smithy_client_1._json,
3206
+ description: smithy_client_1.expectString,
3207
+ detectionPlatforms: smithy_client_1._json,
3208
+ epss: (_) => de_Epss(_, context),
3209
+ exploitObserved: (_) => de_ExploitObserved(_, context),
3210
+ id: smithy_client_1.expectString,
3211
+ referenceUrls: smithy_client_1._json,
3212
+ relatedVulnerabilities: smithy_client_1._json,
3213
+ source: smithy_client_1.expectString,
3214
+ sourceUrl: smithy_client_1.expectString,
3215
+ vendorCreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
3216
+ vendorSeverity: smithy_client_1.expectString,
3217
+ vendorUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
3218
+ });
3219
+ };
3087
3220
  const deserializeMetadata = (output) => ({
3088
3221
  httpStatusCode: output.statusCode,
3089
3222
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -29,6 +29,7 @@ import { ListFindingsCommand, } from "./commands/ListFindingsCommand";
29
29
  import { ListMembersCommand } from "./commands/ListMembersCommand";
30
30
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
31
31
  import { ListUsageTotalsCommand, } from "./commands/ListUsageTotalsCommand";
32
+ import { SearchVulnerabilitiesCommand, } from "./commands/SearchVulnerabilitiesCommand";
32
33
  import { TagResourceCommand } from "./commands/TagResourceCommand";
33
34
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
34
35
  import { UpdateConfigurationCommand, } from "./commands/UpdateConfigurationCommand";
@@ -68,6 +69,7 @@ const commands = {
68
69
  ListMembersCommand,
69
70
  ListTagsForResourceCommand,
70
71
  ListUsageTotalsCommand,
72
+ SearchVulnerabilitiesCommand,
71
73
  TagResourceCommand,
72
74
  UntagResourceCommand,
73
75
  UpdateConfigurationCommand,
@@ -0,0 +1,41 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { de_SearchVulnerabilitiesCommand, se_SearchVulnerabilitiesCommand } from "../protocols/Aws_restJson1";
5
+ export class SearchVulnerabilitiesCommand extends $Command {
6
+ static getEndpointParameterInstructions() {
7
+ return {
8
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
9
+ Endpoint: { type: "builtInParams", name: "endpoint" },
10
+ Region: { type: "builtInParams", name: "region" },
11
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
12
+ };
13
+ }
14
+ constructor(input) {
15
+ super();
16
+ this.input = input;
17
+ }
18
+ resolveMiddleware(clientStack, configuration, options) {
19
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
20
+ this.middlewareStack.use(getEndpointPlugin(configuration, SearchVulnerabilitiesCommand.getEndpointParameterInstructions()));
21
+ const stack = clientStack.concat(this.middlewareStack);
22
+ const { logger } = configuration;
23
+ const clientName = "Inspector2Client";
24
+ const commandName = "SearchVulnerabilitiesCommand";
25
+ const handlerExecutionContext = {
26
+ logger,
27
+ clientName,
28
+ commandName,
29
+ inputFilterSensitiveLog: (_) => _,
30
+ outputFilterSensitiveLog: (_) => _,
31
+ };
32
+ const { requestHandler } = configuration;
33
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
34
+ }
35
+ serialize(input, context) {
36
+ return se_SearchVulnerabilitiesCommand(input, context);
37
+ }
38
+ deserialize(output, context) {
39
+ return de_SearchVulnerabilitiesCommand(output, context);
40
+ }
41
+ }
@@ -28,6 +28,7 @@ export * from "./ListFindingsCommand";
28
28
  export * from "./ListMembersCommand";
29
29
  export * from "./ListTagsForResourceCommand";
30
30
  export * from "./ListUsageTotalsCommand";
31
+ export * from "./SearchVulnerabilitiesCommand";
31
32
  export * from "./TagResourceCommand";
32
33
  export * from "./UntagResourceCommand";
33
34
  export * from "./UpdateConfigurationCommand";
@@ -537,3 +537,6 @@ export const UsageType = {
537
537
  ECR_RESCAN: "ECR_RESCAN",
538
538
  LAMBDA_FUNCTION_HOURS: "LAMBDA_FUNCTION_HOURS",
539
539
  };
540
+ export const VulnerabilitySource = {
541
+ NVD: "NVD",
542
+ };
@@ -0,0 +1,24 @@
1
+ import { SearchVulnerabilitiesCommand, } from "../commands/SearchVulnerabilitiesCommand";
2
+ import { Inspector2Client } from "../Inspector2Client";
3
+ const makePagedClientRequest = async (client, input, ...args) => {
4
+ return await client.send(new SearchVulnerabilitiesCommand(input), ...args);
5
+ };
6
+ export async function* paginateSearchVulnerabilities(config, input, ...additionalArguments) {
7
+ let token = config.startingToken || undefined;
8
+ let hasNext = true;
9
+ let page;
10
+ while (hasNext) {
11
+ input.nextToken = token;
12
+ if (config.client instanceof Inspector2Client) {
13
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
14
+ }
15
+ else {
16
+ throw new Error("Invalid client, expected Inspector2 | Inspector2Client");
17
+ }
18
+ yield page;
19
+ const prevToken = token;
20
+ token = page.nextToken;
21
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
22
+ }
23
+ return undefined;
24
+ }
@@ -8,3 +8,4 @@ export * from "./ListFindingAggregationsPaginator";
8
8
  export * from "./ListFindingsPaginator";
9
9
  export * from "./ListMembersPaginator";
10
10
  export * from "./ListUsageTotalsPaginator";
11
+ export * from "./SearchVulnerabilitiesPaginator";
@@ -624,6 +624,27 @@ export const se_ListUsageTotalsCommand = async (input, context) => {
624
624
  body,
625
625
  });
626
626
  };
627
+ export const se_SearchVulnerabilitiesCommand = async (input, context) => {
628
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
629
+ const headers = {
630
+ "content-type": "application/json",
631
+ };
632
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/vulnerabilities/search";
633
+ let body;
634
+ body = JSON.stringify(take(input, {
635
+ filterCriteria: (_) => _json(_),
636
+ nextToken: [],
637
+ }));
638
+ return new __HttpRequest({
639
+ protocol,
640
+ hostname,
641
+ port,
642
+ method: "POST",
643
+ headers,
644
+ path: resolvedPath,
645
+ body,
646
+ });
647
+ };
627
648
  export const se_TagResourceCommand = async (input, context) => {
628
649
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
629
650
  const headers = {
@@ -2091,6 +2112,49 @@ const de_ListUsageTotalsCommandError = async (output, context) => {
2091
2112
  });
2092
2113
  }
2093
2114
  };
2115
+ export const de_SearchVulnerabilitiesCommand = async (output, context) => {
2116
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2117
+ return de_SearchVulnerabilitiesCommandError(output, context);
2118
+ }
2119
+ const contents = map({
2120
+ $metadata: deserializeMetadata(output),
2121
+ });
2122
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2123
+ const doc = take(data, {
2124
+ nextToken: __expectString,
2125
+ vulnerabilities: (_) => de_Vulnerabilities(_, context),
2126
+ });
2127
+ Object.assign(contents, doc);
2128
+ return contents;
2129
+ };
2130
+ const de_SearchVulnerabilitiesCommandError = async (output, context) => {
2131
+ const parsedOutput = {
2132
+ ...output,
2133
+ body: await parseErrorBody(output.body, context),
2134
+ };
2135
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2136
+ switch (errorCode) {
2137
+ case "AccessDeniedException":
2138
+ case "com.amazonaws.inspector2#AccessDeniedException":
2139
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2140
+ case "InternalServerException":
2141
+ case "com.amazonaws.inspector2#InternalServerException":
2142
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
2143
+ case "ThrottlingException":
2144
+ case "com.amazonaws.inspector2#ThrottlingException":
2145
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
2146
+ case "ValidationException":
2147
+ case "com.amazonaws.inspector2#ValidationException":
2148
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2149
+ default:
2150
+ const parsedBody = parsedOutput.body;
2151
+ return throwDefaultError({
2152
+ output,
2153
+ parsedBody,
2154
+ errorCode,
2155
+ });
2156
+ }
2157
+ };
2094
2158
  export const de_TagResourceCommand = async (output, context) => {
2095
2159
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2096
2160
  return de_TagResourceCommandError(output, context);
@@ -2650,6 +2714,14 @@ const de_AggregationResponseList = (output, context) => {
2650
2714
  });
2651
2715
  return retVal;
2652
2716
  };
2717
+ const de_AtigData = (output, context) => {
2718
+ return take(output, {
2719
+ firstSeen: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2720
+ lastSeen: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2721
+ targets: _json,
2722
+ ttps: _json,
2723
+ });
2724
+ };
2653
2725
  const de_AwsEc2InstanceDetails = (output, context) => {
2654
2726
  return take(output, {
2655
2727
  iamInstanceProfileArn: __expectString,
@@ -2690,6 +2762,25 @@ const de_AwsLambdaFunctionDetails = (output, context) => {
2690
2762
  vpcConfig: _json,
2691
2763
  });
2692
2764
  };
2765
+ const de_CisaData = (output, context) => {
2766
+ return take(output, {
2767
+ action: __expectString,
2768
+ dateAdded: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2769
+ dateDue: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2770
+ });
2771
+ };
2772
+ const de_Cvss2 = (output, context) => {
2773
+ return take(output, {
2774
+ baseScore: __limitedParseDouble,
2775
+ scoringVector: __expectString,
2776
+ });
2777
+ };
2778
+ const de_Cvss3 = (output, context) => {
2779
+ return take(output, {
2780
+ baseScore: __limitedParseDouble,
2781
+ scoringVector: __expectString,
2782
+ });
2783
+ };
2693
2784
  const de_CvssScore = (output, context) => {
2694
2785
  return take(output, {
2695
2786
  baseScore: __limitedParseDouble,
@@ -2742,11 +2833,22 @@ const de_EcrRescanDurationState = (output, context) => {
2742
2833
  updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2743
2834
  });
2744
2835
  };
2836
+ const de_Epss = (output, context) => {
2837
+ return take(output, {
2838
+ score: __limitedParseDouble,
2839
+ });
2840
+ };
2745
2841
  const de_ExploitabilityDetails = (output, context) => {
2746
2842
  return take(output, {
2747
2843
  lastKnownExploitAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2748
2844
  });
2749
2845
  };
2846
+ const de_ExploitObserved = (output, context) => {
2847
+ return take(output, {
2848
+ firstSeen: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2849
+ lastSeen: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2850
+ });
2851
+ };
2750
2852
  const de_Filter = (output, context) => {
2751
2853
  return take(output, {
2752
2854
  action: __expectString,
@@ -3006,6 +3108,35 @@ const de_UsageTotalList = (output, context) => {
3006
3108
  });
3007
3109
  return retVal;
3008
3110
  };
3111
+ const de_Vulnerabilities = (output, context) => {
3112
+ const retVal = (output || [])
3113
+ .filter((e) => e != null)
3114
+ .map((entry) => {
3115
+ return de_Vulnerability(entry, context);
3116
+ });
3117
+ return retVal;
3118
+ };
3119
+ const de_Vulnerability = (output, context) => {
3120
+ return take(output, {
3121
+ atigData: (_) => de_AtigData(_, context),
3122
+ cisaData: (_) => de_CisaData(_, context),
3123
+ cvss2: (_) => de_Cvss2(_, context),
3124
+ cvss3: (_) => de_Cvss3(_, context),
3125
+ cwes: _json,
3126
+ description: __expectString,
3127
+ detectionPlatforms: _json,
3128
+ epss: (_) => de_Epss(_, context),
3129
+ exploitObserved: (_) => de_ExploitObserved(_, context),
3130
+ id: __expectString,
3131
+ referenceUrls: _json,
3132
+ relatedVulnerabilities: _json,
3133
+ source: __expectString,
3134
+ sourceUrl: __expectString,
3135
+ vendorCreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
3136
+ vendorSeverity: __expectString,
3137
+ vendorUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
3138
+ });
3139
+ };
3009
3140
  const deserializeMetadata = (output) => ({
3010
3141
  httpStatusCode: output.statusCode,
3011
3142
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -29,6 +29,7 @@ import { ListFindingsCommandInput, ListFindingsCommandOutput } from "./commands/
29
29
  import { ListMembersCommandInput, ListMembersCommandOutput } from "./commands/ListMembersCommand";
30
30
  import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
31
31
  import { ListUsageTotalsCommandInput, ListUsageTotalsCommandOutput } from "./commands/ListUsageTotalsCommand";
32
+ import { SearchVulnerabilitiesCommandInput, SearchVulnerabilitiesCommandOutput } from "./commands/SearchVulnerabilitiesCommand";
32
33
  import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
33
34
  import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
34
35
  import { UpdateConfigurationCommandInput, UpdateConfigurationCommandOutput } from "./commands/UpdateConfigurationCommand";
@@ -218,6 +219,12 @@ export interface Inspector2 {
218
219
  listUsageTotals(args: ListUsageTotalsCommandInput, options?: __HttpHandlerOptions): Promise<ListUsageTotalsCommandOutput>;
219
220
  listUsageTotals(args: ListUsageTotalsCommandInput, cb: (err: any, data?: ListUsageTotalsCommandOutput) => void): void;
220
221
  listUsageTotals(args: ListUsageTotalsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListUsageTotalsCommandOutput) => void): void;
222
+ /**
223
+ * @see {@link SearchVulnerabilitiesCommand}
224
+ */
225
+ searchVulnerabilities(args: SearchVulnerabilitiesCommandInput, options?: __HttpHandlerOptions): Promise<SearchVulnerabilitiesCommandOutput>;
226
+ searchVulnerabilities(args: SearchVulnerabilitiesCommandInput, cb: (err: any, data?: SearchVulnerabilitiesCommandOutput) => void): void;
227
+ searchVulnerabilities(args: SearchVulnerabilitiesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SearchVulnerabilitiesCommandOutput) => void): void;
221
228
  /**
222
229
  * @see {@link TagResourceCommand}
223
230
  */