Skip to content

Commit f85fa66

Browse files
author
awstools
committed
feat(client-guardduty): Amazon GuardDuty introduces a new Malware Protection feature that triggers malware scan on selected EC2 instance resources, after the service detects a potentially malicious activity.
1 parent 65ad083 commit f85fa66

File tree

11 files changed

+4429
-501
lines changed

11 files changed

+4429
-501
lines changed

clients/client-guardduty/src/GuardDuty.ts

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ import {
8383
DeleteThreatIntelSetCommandInput,
8484
DeleteThreatIntelSetCommandOutput,
8585
} from "./commands/DeleteThreatIntelSetCommand";
86+
import {
87+
DescribeMalwareScansCommand,
88+
DescribeMalwareScansCommandInput,
89+
DescribeMalwareScansCommandOutput,
90+
} from "./commands/DescribeMalwareScansCommand";
8691
import {
8792
DescribeOrganizationConfigurationCommand,
8893
DescribeOrganizationConfigurationCommandInput,
@@ -137,6 +142,11 @@ import {
137142
GetInvitationsCountCommandOutput,
138143
} from "./commands/GetInvitationsCountCommand";
139144
import { GetIPSetCommand, GetIPSetCommandInput, GetIPSetCommandOutput } from "./commands/GetIPSetCommand";
145+
import {
146+
GetMalwareScanSettingsCommand,
147+
GetMalwareScanSettingsCommandInput,
148+
GetMalwareScanSettingsCommandOutput,
149+
} from "./commands/GetMalwareScanSettingsCommand";
140150
import {
141151
GetMasterAccountCommand,
142152
GetMasterAccountCommandInput,
@@ -243,6 +253,11 @@ import {
243253
UpdateFindingsFeedbackCommandOutput,
244254
} from "./commands/UpdateFindingsFeedbackCommand";
245255
import { UpdateIPSetCommand, UpdateIPSetCommandInput, UpdateIPSetCommandOutput } from "./commands/UpdateIPSetCommand";
256+
import {
257+
UpdateMalwareScanSettingsCommand,
258+
UpdateMalwareScanSettingsCommandInput,
259+
UpdateMalwareScanSettingsCommandOutput,
260+
} from "./commands/UpdateMalwareScanSettingsCommand";
246261
import {
247262
UpdateMemberDetectorsCommand,
248263
UpdateMemberDetectorsCommandInput,
@@ -877,6 +892,38 @@ export class GuardDuty extends GuardDutyClient {
877892
}
878893
}
879894

895+
/**
896+
* <p>Returns a list of malware scans.</p>
897+
*/
898+
public describeMalwareScans(
899+
args: DescribeMalwareScansCommandInput,
900+
options?: __HttpHandlerOptions
901+
): Promise<DescribeMalwareScansCommandOutput>;
902+
public describeMalwareScans(
903+
args: DescribeMalwareScansCommandInput,
904+
cb: (err: any, data?: DescribeMalwareScansCommandOutput) => void
905+
): void;
906+
public describeMalwareScans(
907+
args: DescribeMalwareScansCommandInput,
908+
options: __HttpHandlerOptions,
909+
cb: (err: any, data?: DescribeMalwareScansCommandOutput) => void
910+
): void;
911+
public describeMalwareScans(
912+
args: DescribeMalwareScansCommandInput,
913+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeMalwareScansCommandOutput) => void),
914+
cb?: (err: any, data?: DescribeMalwareScansCommandOutput) => void
915+
): Promise<DescribeMalwareScansCommandOutput> | void {
916+
const command = new DescribeMalwareScansCommand(args);
917+
if (typeof optionsOrCb === "function") {
918+
this.send(command, optionsOrCb);
919+
} else if (typeof cb === "function") {
920+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
921+
this.send(command, optionsOrCb || {}, cb);
922+
} else {
923+
return this.send(command, optionsOrCb);
924+
}
925+
}
926+
880927
/**
881928
* <p>Returns information about the account selected as the delegated administrator for
882929
* GuardDuty.</p>
@@ -1310,6 +1357,38 @@ export class GuardDuty extends GuardDutyClient {
13101357
}
13111358
}
13121359

1360+
/**
1361+
* <p>Returns the details of the malware scan settings.</p>
1362+
*/
1363+
public getMalwareScanSettings(
1364+
args: GetMalwareScanSettingsCommandInput,
1365+
options?: __HttpHandlerOptions
1366+
): Promise<GetMalwareScanSettingsCommandOutput>;
1367+
public getMalwareScanSettings(
1368+
args: GetMalwareScanSettingsCommandInput,
1369+
cb: (err: any, data?: GetMalwareScanSettingsCommandOutput) => void
1370+
): void;
1371+
public getMalwareScanSettings(
1372+
args: GetMalwareScanSettingsCommandInput,
1373+
options: __HttpHandlerOptions,
1374+
cb: (err: any, data?: GetMalwareScanSettingsCommandOutput) => void
1375+
): void;
1376+
public getMalwareScanSettings(
1377+
args: GetMalwareScanSettingsCommandInput,
1378+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetMalwareScanSettingsCommandOutput) => void),
1379+
cb?: (err: any, data?: GetMalwareScanSettingsCommandOutput) => void
1380+
): Promise<GetMalwareScanSettingsCommandOutput> | void {
1381+
const command = new GetMalwareScanSettingsCommand(args);
1382+
if (typeof optionsOrCb === "function") {
1383+
this.send(command, optionsOrCb);
1384+
} else if (typeof cb === "function") {
1385+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1386+
this.send(command, optionsOrCb || {}, cb);
1387+
} else {
1388+
return this.send(command, optionsOrCb);
1389+
}
1390+
}
1391+
13131392
/**
13141393
* @deprecated
13151394
*
@@ -2121,6 +2200,38 @@ export class GuardDuty extends GuardDutyClient {
21212200
}
21222201
}
21232202

2203+
/**
2204+
* <p>Updates the malware scan settings.</p>
2205+
*/
2206+
public updateMalwareScanSettings(
2207+
args: UpdateMalwareScanSettingsCommandInput,
2208+
options?: __HttpHandlerOptions
2209+
): Promise<UpdateMalwareScanSettingsCommandOutput>;
2210+
public updateMalwareScanSettings(
2211+
args: UpdateMalwareScanSettingsCommandInput,
2212+
cb: (err: any, data?: UpdateMalwareScanSettingsCommandOutput) => void
2213+
): void;
2214+
public updateMalwareScanSettings(
2215+
args: UpdateMalwareScanSettingsCommandInput,
2216+
options: __HttpHandlerOptions,
2217+
cb: (err: any, data?: UpdateMalwareScanSettingsCommandOutput) => void
2218+
): void;
2219+
public updateMalwareScanSettings(
2220+
args: UpdateMalwareScanSettingsCommandInput,
2221+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateMalwareScanSettingsCommandOutput) => void),
2222+
cb?: (err: any, data?: UpdateMalwareScanSettingsCommandOutput) => void
2223+
): Promise<UpdateMalwareScanSettingsCommandOutput> | void {
2224+
const command = new UpdateMalwareScanSettingsCommand(args);
2225+
if (typeof optionsOrCb === "function") {
2226+
this.send(command, optionsOrCb);
2227+
} else if (typeof cb === "function") {
2228+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2229+
this.send(command, optionsOrCb || {}, cb);
2230+
} else {
2231+
return this.send(command, optionsOrCb);
2232+
}
2233+
}
2234+
21242235
/**
21252236
* <p>Contains information on member accounts to be updated.</p>
21262237
*/

clients/client-guardduty/src/GuardDutyClient.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ import {
8989
DeleteThreatIntelSetCommandInput,
9090
DeleteThreatIntelSetCommandOutput,
9191
} from "./commands/DeleteThreatIntelSetCommand";
92+
import {
93+
DescribeMalwareScansCommandInput,
94+
DescribeMalwareScansCommandOutput,
95+
} from "./commands/DescribeMalwareScansCommand";
9296
import {
9397
DescribeOrganizationConfigurationCommandInput,
9498
DescribeOrganizationConfigurationCommandOutput,
@@ -133,6 +137,10 @@ import {
133137
GetInvitationsCountCommandOutput,
134138
} from "./commands/GetInvitationsCountCommand";
135139
import { GetIPSetCommandInput, GetIPSetCommandOutput } from "./commands/GetIPSetCommand";
140+
import {
141+
GetMalwareScanSettingsCommandInput,
142+
GetMalwareScanSettingsCommandOutput,
143+
} from "./commands/GetMalwareScanSettingsCommand";
136144
import { GetMasterAccountCommandInput, GetMasterAccountCommandOutput } from "./commands/GetMasterAccountCommand";
137145
import { GetMemberDetectorsCommandInput, GetMemberDetectorsCommandOutput } from "./commands/GetMemberDetectorsCommand";
138146
import { GetMembersCommandInput, GetMembersCommandOutput } from "./commands/GetMembersCommand";
@@ -183,6 +191,10 @@ import {
183191
UpdateFindingsFeedbackCommandOutput,
184192
} from "./commands/UpdateFindingsFeedbackCommand";
185193
import { UpdateIPSetCommandInput, UpdateIPSetCommandOutput } from "./commands/UpdateIPSetCommand";
194+
import {
195+
UpdateMalwareScanSettingsCommandInput,
196+
UpdateMalwareScanSettingsCommandOutput,
197+
} from "./commands/UpdateMalwareScanSettingsCommand";
186198
import {
187199
UpdateMemberDetectorsCommandInput,
188200
UpdateMemberDetectorsCommandOutput,
@@ -220,6 +232,7 @@ export type ServiceInputTypes =
220232
| DeleteMembersCommandInput
221233
| DeletePublishingDestinationCommandInput
222234
| DeleteThreatIntelSetCommandInput
235+
| DescribeMalwareScansCommandInput
223236
| DescribeOrganizationConfigurationCommandInput
224237
| DescribePublishingDestinationCommandInput
225238
| DisableOrganizationAdminAccountCommandInput
@@ -234,6 +247,7 @@ export type ServiceInputTypes =
234247
| GetFindingsStatisticsCommandInput
235248
| GetIPSetCommandInput
236249
| GetInvitationsCountCommandInput
250+
| GetMalwareScanSettingsCommandInput
237251
| GetMasterAccountCommandInput
238252
| GetMemberDetectorsCommandInput
239253
| GetMembersCommandInput
@@ -260,6 +274,7 @@ export type ServiceInputTypes =
260274
| UpdateFilterCommandInput
261275
| UpdateFindingsFeedbackCommandInput
262276
| UpdateIPSetCommandInput
277+
| UpdateMalwareScanSettingsCommandInput
263278
| UpdateMemberDetectorsCommandInput
264279
| UpdateOrganizationConfigurationCommandInput
265280
| UpdatePublishingDestinationCommandInput
@@ -284,6 +299,7 @@ export type ServiceOutputTypes =
284299
| DeleteMembersCommandOutput
285300
| DeletePublishingDestinationCommandOutput
286301
| DeleteThreatIntelSetCommandOutput
302+
| DescribeMalwareScansCommandOutput
287303
| DescribeOrganizationConfigurationCommandOutput
288304
| DescribePublishingDestinationCommandOutput
289305
| DisableOrganizationAdminAccountCommandOutput
@@ -298,6 +314,7 @@ export type ServiceOutputTypes =
298314
| GetFindingsStatisticsCommandOutput
299315
| GetIPSetCommandOutput
300316
| GetInvitationsCountCommandOutput
317+
| GetMalwareScanSettingsCommandOutput
301318
| GetMasterAccountCommandOutput
302319
| GetMemberDetectorsCommandOutput
303320
| GetMembersCommandOutput
@@ -324,6 +341,7 @@ export type ServiceOutputTypes =
324341
| UpdateFilterCommandOutput
325342
| UpdateFindingsFeedbackCommandOutput
326343
| UpdateIPSetCommandOutput
344+
| UpdateMalwareScanSettingsCommandOutput
327345
| UpdateMemberDetectorsCommandOutput
328346
| UpdateOrganizationConfigurationCommandOutput
329347
| UpdatePublishingDestinationCommandOutput
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { GuardDutyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GuardDutyClient";
16+
import {
17+
DescribeMalwareScansRequest,
18+
DescribeMalwareScansRequestFilterSensitiveLog,
19+
DescribeMalwareScansResponse,
20+
DescribeMalwareScansResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_restJson1DescribeMalwareScansCommand,
24+
serializeAws_restJson1DescribeMalwareScansCommand,
25+
} from "../protocols/Aws_restJson1";
26+
27+
export interface DescribeMalwareScansCommandInput extends DescribeMalwareScansRequest {}
28+
export interface DescribeMalwareScansCommandOutput extends DescribeMalwareScansResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns a list of malware scans.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { GuardDutyClient, DescribeMalwareScansCommand } from "@aws-sdk/client-guardduty"; // ES Modules import
36+
* // const { GuardDutyClient, DescribeMalwareScansCommand } = require("@aws-sdk/client-guardduty"); // CommonJS import
37+
* const client = new GuardDutyClient(config);
38+
* const command = new DescribeMalwareScansCommand(input);
39+
* const response = await client.send(command);
40+
* ```
41+
*
42+
* @see {@link DescribeMalwareScansCommandInput} for command's `input` shape.
43+
* @see {@link DescribeMalwareScansCommandOutput} for command's `response` shape.
44+
* @see {@link GuardDutyClientResolvedConfig | config} for GuardDutyClient's `config` shape.
45+
*
46+
*/
47+
export class DescribeMalwareScansCommand extends $Command<
48+
DescribeMalwareScansCommandInput,
49+
DescribeMalwareScansCommandOutput,
50+
GuardDutyClientResolvedConfig
51+
> {
52+
// Start section: command_properties
53+
// End section: command_properties
54+
55+
constructor(readonly input: DescribeMalwareScansCommandInput) {
56+
// Start section: command_constructor
57+
super();
58+
// End section: command_constructor
59+
}
60+
61+
/**
62+
* @internal
63+
*/
64+
resolveMiddleware(
65+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
66+
configuration: GuardDutyClientResolvedConfig,
67+
options?: __HttpHandlerOptions
68+
): Handler<DescribeMalwareScansCommandInput, DescribeMalwareScansCommandOutput> {
69+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
70+
71+
const stack = clientStack.concat(this.middlewareStack);
72+
73+
const { logger } = configuration;
74+
const clientName = "GuardDutyClient";
75+
const commandName = "DescribeMalwareScansCommand";
76+
const handlerExecutionContext: HandlerExecutionContext = {
77+
logger,
78+
clientName,
79+
commandName,
80+
inputFilterSensitiveLog: DescribeMalwareScansRequestFilterSensitiveLog,
81+
outputFilterSensitiveLog: DescribeMalwareScansResponseFilterSensitiveLog,
82+
};
83+
const { requestHandler } = configuration;
84+
return stack.resolve(
85+
(request: FinalizeHandlerArguments<any>) =>
86+
requestHandler.handle(request.request as __HttpRequest, options || {}),
87+
handlerExecutionContext
88+
);
89+
}
90+
91+
private serialize(input: DescribeMalwareScansCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
92+
return serializeAws_restJson1DescribeMalwareScansCommand(input, context);
93+
}
94+
95+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DescribeMalwareScansCommandOutput> {
96+
return deserializeAws_restJson1DescribeMalwareScansCommand(output, context);
97+
}
98+
99+
// Start section: command_body_extra
100+
// End section: command_body_extra
101+
}

0 commit comments

Comments
 (0)