Skip to content

Commit 0d0b1ae

Browse files
author
awstools
committed
feat(client-guardduty): Add S3 On-Demand Object Scanning
1 parent 2557db0 commit 0d0b1ae

File tree

8 files changed

+322
-0
lines changed

8 files changed

+322
-0
lines changed

clients/client-guardduty/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,14 @@ ListTrustedEntitySets
749749

750750
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/guardduty/command/ListTrustedEntitySetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-guardduty/Interface/ListTrustedEntitySetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-guardduty/Interface/ListTrustedEntitySetsCommandOutput/)
751751

752+
</details>
753+
<details>
754+
<summary>
755+
SendObjectMalwareScan
756+
</summary>
757+
758+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/guardduty/command/SendObjectMalwareScanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-guardduty/Interface/SendObjectMalwareScanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-guardduty/Interface/SendObjectMalwareScanCommandOutput/)
759+
752760
</details>
753761
<details>
754762
<summary>

clients/client-guardduty/src/GuardDuty.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ import {
292292
ListTrustedEntitySetsCommandInput,
293293
ListTrustedEntitySetsCommandOutput,
294294
} from "./commands/ListTrustedEntitySetsCommand";
295+
import {
296+
SendObjectMalwareScanCommand,
297+
SendObjectMalwareScanCommandInput,
298+
SendObjectMalwareScanCommandOutput,
299+
} from "./commands/SendObjectMalwareScanCommand";
295300
import {
296301
StartMalwareScanCommand,
297302
StartMalwareScanCommandInput,
@@ -443,6 +448,7 @@ const commands = {
443448
ListThreatEntitySetsCommand,
444449
ListThreatIntelSetsCommand,
445450
ListTrustedEntitySetsCommand,
451+
SendObjectMalwareScanCommand,
446452
StartMalwareScanCommand,
447453
StartMonitoringMembersCommand,
448454
StopMonitoringMembersCommand,
@@ -1472,6 +1478,24 @@ export interface GuardDuty {
14721478
cb: (err: any, data?: ListTrustedEntitySetsCommandOutput) => void
14731479
): void;
14741480

1481+
/**
1482+
* @see {@link SendObjectMalwareScanCommand}
1483+
*/
1484+
sendObjectMalwareScan(): Promise<SendObjectMalwareScanCommandOutput>;
1485+
sendObjectMalwareScan(
1486+
args: SendObjectMalwareScanCommandInput,
1487+
options?: __HttpHandlerOptions
1488+
): Promise<SendObjectMalwareScanCommandOutput>;
1489+
sendObjectMalwareScan(
1490+
args: SendObjectMalwareScanCommandInput,
1491+
cb: (err: any, data?: SendObjectMalwareScanCommandOutput) => void
1492+
): void;
1493+
sendObjectMalwareScan(
1494+
args: SendObjectMalwareScanCommandInput,
1495+
options: __HttpHandlerOptions,
1496+
cb: (err: any, data?: SendObjectMalwareScanCommandOutput) => void
1497+
): void;
1498+
14751499
/**
14761500
* @see {@link StartMalwareScanCommand}
14771501
*/

clients/client-guardduty/src/GuardDutyClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ import {
231231
ListTrustedEntitySetsCommandInput,
232232
ListTrustedEntitySetsCommandOutput,
233233
} from "./commands/ListTrustedEntitySetsCommand";
234+
import {
235+
SendObjectMalwareScanCommandInput,
236+
SendObjectMalwareScanCommandOutput,
237+
} from "./commands/SendObjectMalwareScanCommand";
234238
import { StartMalwareScanCommandInput, StartMalwareScanCommandOutput } from "./commands/StartMalwareScanCommand";
235239
import {
236240
StartMonitoringMembersCommandInput,
@@ -363,6 +367,7 @@ export type ServiceInputTypes =
363367
| ListThreatEntitySetsCommandInput
364368
| ListThreatIntelSetsCommandInput
365369
| ListTrustedEntitySetsCommandInput
370+
| SendObjectMalwareScanCommandInput
366371
| StartMalwareScanCommandInput
367372
| StartMonitoringMembersCommandInput
368373
| StopMonitoringMembersCommandInput
@@ -452,6 +457,7 @@ export type ServiceOutputTypes =
452457
| ListThreatEntitySetsCommandOutput
453458
| ListThreatIntelSetsCommandOutput
454459
| ListTrustedEntitySetsCommandOutput
460+
| SendObjectMalwareScanCommandOutput
455461
| StartMalwareScanCommandOutput
456462
| StartMonitoringMembersCommandOutput
457463
| StopMonitoringMembersCommandOutput
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { Command as $Command } from "@smithy/smithy-client";
4+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
5+
6+
import { commonParams } from "../endpoint/EndpointParameters";
7+
import { GuardDutyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GuardDutyClient";
8+
import { SendObjectMalwareScanRequest, SendObjectMalwareScanResponse } from "../models/models_1";
9+
import { SendObjectMalwareScan } from "../schemas/schemas_0";
10+
11+
/**
12+
* @public
13+
*/
14+
export type { __MetadataBearer };
15+
export { $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link SendObjectMalwareScanCommand}.
20+
*/
21+
export interface SendObjectMalwareScanCommandInput extends SendObjectMalwareScanRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link SendObjectMalwareScanCommand}.
26+
*/
27+
export interface SendObjectMalwareScanCommandOutput extends SendObjectMalwareScanResponse, __MetadataBearer {}
28+
29+
/**
30+
* <p>Initiates a malware scan for a specific S3 object. This API allows you to perform on-demand malware scanning of individual objects in S3 buckets that have Malware Protection for S3 enabled.</p>
31+
* <p>When you use this API, the Amazon Web Services service terms for GuardDuty Malware
32+
* Protection apply. For more information, see <a href="http://aws.amazon.com/service-terms/#87._Amazon_GuardDuty">Amazon Web Services service terms for GuardDuty Malware Protection</a>.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { GuardDutyClient, SendObjectMalwareScanCommand } from "@aws-sdk/client-guardduty"; // ES Modules import
37+
* // const { GuardDutyClient, SendObjectMalwareScanCommand } = require("@aws-sdk/client-guardduty"); // CommonJS import
38+
* // import type { GuardDutyClientConfig } from "@aws-sdk/client-guardduty";
39+
* const config = {}; // type is GuardDutyClientConfig
40+
* const client = new GuardDutyClient(config);
41+
* const input = { // SendObjectMalwareScanRequest
42+
* S3Object: { // S3ObjectForSendObjectMalwareScan
43+
* Bucket: "STRING_VALUE",
44+
* Key: "STRING_VALUE",
45+
* VersionId: "STRING_VALUE",
46+
* },
47+
* };
48+
* const command = new SendObjectMalwareScanCommand(input);
49+
* const response = await client.send(command);
50+
* // {};
51+
*
52+
* ```
53+
*
54+
* @param SendObjectMalwareScanCommandInput - {@link SendObjectMalwareScanCommandInput}
55+
* @returns {@link SendObjectMalwareScanCommandOutput}
56+
* @see {@link SendObjectMalwareScanCommandInput} for command's `input` shape.
57+
* @see {@link SendObjectMalwareScanCommandOutput} for command's `response` shape.
58+
* @see {@link GuardDutyClientResolvedConfig | config} for GuardDutyClient's `config` shape.
59+
*
60+
* @throws {@link AccessDeniedException} (client fault)
61+
* <p>An access denied exception object.</p>
62+
*
63+
* @throws {@link BadRequestException} (client fault)
64+
* <p>A bad request exception object.</p>
65+
*
66+
* @throws {@link InternalServerErrorException} (server fault)
67+
* <p>An internal server error exception object.</p>
68+
*
69+
* @throws {@link GuardDutyServiceException}
70+
* <p>Base exception class for all service exceptions from GuardDuty service.</p>
71+
*
72+
*
73+
* @public
74+
*/
75+
export class SendObjectMalwareScanCommand extends $Command
76+
.classBuilder<
77+
SendObjectMalwareScanCommandInput,
78+
SendObjectMalwareScanCommandOutput,
79+
GuardDutyClientResolvedConfig,
80+
ServiceInputTypes,
81+
ServiceOutputTypes
82+
>()
83+
.ep(commonParams)
84+
.m(function (this: any, Command: any, cs: any, config: GuardDutyClientResolvedConfig, o: any) {
85+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
86+
})
87+
.s("GuardDutyAPIService", "SendObjectMalwareScan", {})
88+
.n("GuardDutyClient", "SendObjectMalwareScanCommand")
89+
.sc(SendObjectMalwareScan)
90+
.build() {
91+
/** @internal type navigation helper, not in runtime. */
92+
protected declare static __types: {
93+
api: {
94+
input: SendObjectMalwareScanRequest;
95+
output: {};
96+
};
97+
sdk: {
98+
input: SendObjectMalwareScanCommandInput;
99+
output: SendObjectMalwareScanCommandOutput;
100+
};
101+
};
102+
}

clients/client-guardduty/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export * from "./ListTagsForResourceCommand";
6565
export * from "./ListThreatEntitySetsCommand";
6666
export * from "./ListThreatIntelSetsCommand";
6767
export * from "./ListTrustedEntitySetsCommand";
68+
export * from "./SendObjectMalwareScanCommand";
6869
export * from "./StartMalwareScanCommand";
6970
export * from "./StartMonitoringMembersCommand";
7071
export * from "./StopMonitoringMembersCommand";

clients/client-guardduty/src/models/models_1.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,46 @@ export interface ListTrustedEntitySetsResponse {
25662566
NextToken?: string | undefined;
25672567
}
25682568

2569+
/**
2570+
* <p>The S3 object path to initiate a scan, including bucket name, object key, and optional version ID.</p>
2571+
* @public
2572+
*/
2573+
export interface S3ObjectForSendObjectMalwareScan {
2574+
/**
2575+
* <p>The name of the S3 bucket containing the object to scan. The bucket must have GuardDuty Malware Protection enabled.</p>
2576+
* @public
2577+
*/
2578+
Bucket?: string | undefined;
2579+
2580+
/**
2581+
* <p>The key (name) of the S3 object to scan for malware. This must be the full key path of the object within the bucket.</p>
2582+
* @public
2583+
*/
2584+
Key?: string | undefined;
2585+
2586+
/**
2587+
* <p>The version ID of the S3 object to scan. If not specified, the latest version of the object is scanned.</p>
2588+
* @public
2589+
*/
2590+
VersionId?: string | undefined;
2591+
}
2592+
2593+
/**
2594+
* @public
2595+
*/
2596+
export interface SendObjectMalwareScanRequest {
2597+
/**
2598+
* <p>The S3 object information for the object you want to scan. The bucket must have a Malware Protection plan configured to use this API.</p>
2599+
* @public
2600+
*/
2601+
S3Object?: S3ObjectForSendObjectMalwareScan | undefined;
2602+
}
2603+
2604+
/**
2605+
* @public
2606+
*/
2607+
export interface SendObjectMalwareScanResponse {}
2608+
25692609
/**
25702610
* @public
25712611
*/

clients/client-guardduty/src/schemas/schemas_0.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const _BPAu = "BucketPublicAccess";
8888
const _BPP = "BlockPublicPolicy";
8989
const _BRE = "BadRequestException";
9090
const _Bl = "Blocked";
91+
const _Bu = "Bucket";
9192
const _C = "City";
9293
const _CA = "ClusterArn";
9394
const _CAr = "CreatedAt";
@@ -786,6 +787,10 @@ const _SNe = "SessionName";
786787
const _SO = "S3Object";
787788
const _SOD = "S3ObjectDetails";
788789
const _SODb = "S3ObjectDetail";
790+
const _SOFSOMS = "S3ObjectForSendObjectMalwareScan";
791+
const _SOMS = "SendObjectMalwareScan";
792+
const _SOMSR = "SendObjectMalwareScanRequest";
793+
const _SOMSRe = "SendObjectMalwareScanResponse";
789794
const _SOU = "S3ObjectUids";
790795
const _SP = "ScriptPath";
791796
const _SPo = "SocketPath";
@@ -1020,6 +1025,7 @@ const _bPAl = "blockPublicAcls";
10201025
const _bPAu = "bucketPublicAccess";
10211026
const _bPP = "blockPublicPolicy";
10221027
const _bl = "blocked";
1028+
const _bu = "bucket";
10231029
const _c = "client";
10241030
const _cA = "clusterArn";
10251031
const _cAr = "createdAt";
@@ -10167,6 +10173,33 @@ export var S3ObjectDetail: StaticStructureSchema = [
1016710173
],
1016810174
],
1016910175
];
10176+
export var S3ObjectForSendObjectMalwareScan: StaticStructureSchema = [
10177+
3,
10178+
n0,
10179+
_SOFSOMS,
10180+
0,
10181+
[_Bu, _Ke, _VIe],
10182+
[
10183+
[
10184+
0,
10185+
{
10186+
[_jN]: _bu,
10187+
},
10188+
],
10189+
[
10190+
0,
10191+
{
10192+
[_jN]: _ke,
10193+
},
10194+
],
10195+
[
10196+
0,
10197+
{
10198+
[_jN]: _vIe,
10199+
},
10200+
],
10201+
],
10202+
];
1017010203
export var Scan: StaticStructureSchema = [
1017110204
3,
1017210205
n0,
@@ -10536,6 +10569,22 @@ export var SecurityGroup: StaticStructureSchema = [
1053610569
],
1053710570
],
1053810571
];
10572+
export var SendObjectMalwareScanRequest: StaticStructureSchema = [
10573+
3,
10574+
n0,
10575+
_SOMSR,
10576+
0,
10577+
[_SO],
10578+
[
10579+
[
10580+
() => S3ObjectForSendObjectMalwareScan,
10581+
{
10582+
[_jN]: _sO,
10583+
},
10584+
],
10585+
],
10586+
];
10587+
export var SendObjectMalwareScanResponse: StaticStructureSchema = [3, n0, _SOMSRe, 0, [], []];
1053910588
export var Sequence: StaticStructureSchema = [
1054010589
3,
1054110590
n0,
@@ -13098,6 +13147,16 @@ export var ListTrustedEntitySets: StaticOperationSchema = [
1309813147
() => ListTrustedEntitySetsRequest,
1309913148
() => ListTrustedEntitySetsResponse,
1310013149
];
13150+
export var SendObjectMalwareScan: StaticOperationSchema = [
13151+
9,
13152+
n0,
13153+
_SOMS,
13154+
{
13155+
[_ht]: ["POST", "/object-malware-scan/send", 200],
13156+
},
13157+
() => SendObjectMalwareScanRequest,
13158+
() => SendObjectMalwareScanResponse,
13159+
];
1310113160
export var StartMalwareScan: StaticOperationSchema = [
1310213161
9,
1310313162
n0,

0 commit comments

Comments
 (0)