Skip to content

Commit

Permalink
feat(client-ssm): Add sensitive trait to SSM IPAddress property for C…
Browse files Browse the repository at this point in the history
…loudTrail redaction
  • Loading branch information
awstools committed Jun 24, 2024
1 parent 798ea2a commit b4bc88d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { DescribeInstanceInformationRequest, DescribeInstanceInformationResult } from "../models/models_0";
import {
DescribeInstanceInformationRequest,
DescribeInstanceInformationResult,
DescribeInstanceInformationResultFilterSensitiveLog,
} from "../models/models_0";
import { de_DescribeInstanceInformationCommand, se_DescribeInstanceInformationCommand } from "../protocols/Aws_json1_1";
import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient";

Expand Down Expand Up @@ -164,7 +168,7 @@ export class DescribeInstanceInformationCommand extends $Command
})
.s("AmazonSSM", "DescribeInstanceInformation", {})
.n("SSMClient", "DescribeInstanceInformationCommand")
.f(void 0, void 0)
.f(void 0, DescribeInstanceInformationResultFilterSensitiveLog)
.ser(se_DescribeInstanceInformationCommand)
.de(de_DescribeInstanceInformationCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { DescribeInstancePropertiesRequest, DescribeInstancePropertiesResult } from "../models/models_0";
import {
DescribeInstancePropertiesRequest,
DescribeInstancePropertiesResult,
DescribeInstancePropertiesResultFilterSensitiveLog,
} from "../models/models_0";
import { de_DescribeInstancePropertiesCommand, se_DescribeInstancePropertiesCommand } from "../protocols/Aws_json1_1";
import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient";

Expand Down Expand Up @@ -168,7 +172,7 @@ export class DescribeInstancePropertiesCommand extends $Command
})
.s("AmazonSSM", "DescribeInstanceProperties", {})
.n("SSMClient", "DescribeInstancePropertiesCommand")
.f(void 0, void 0)
.f(void 0, DescribeInstancePropertiesResultFilterSensitiveLog)
.ser(se_DescribeInstancePropertiesCommand)
.de(de_DescribeInstancePropertiesCommand)
.build() {}
36 changes: 36 additions & 0 deletions clients/client-ssm/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9647,6 +9647,24 @@ export const DescribeAssociationResultFilterSensitiveLog = (obj: DescribeAssocia
}),
});

/**
* @internal
*/
export const InstanceInformationFilterSensitiveLog = (obj: InstanceInformation): any => ({
...obj,
...(obj.IPAddress && { IPAddress: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const DescribeInstanceInformationResultFilterSensitiveLog = (obj: DescribeInstanceInformationResult): any => ({
...obj,
...(obj.InstanceInformationList && {
InstanceInformationList: obj.InstanceInformationList.map((item) => InstanceInformationFilterSensitiveLog(item)),
}),
});

/**
* @internal
*/
Expand Down Expand Up @@ -9677,6 +9695,24 @@ export const DescribeInstancePatchStatesForPatchGroupResultFilterSensitiveLog =
}),
});

/**
* @internal
*/
export const InstancePropertyFilterSensitiveLog = (obj: InstanceProperty): any => ({
...obj,
...(obj.IPAddress && { IPAddress: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const DescribeInstancePropertiesResultFilterSensitiveLog = (obj: DescribeInstancePropertiesResult): any => ({
...obj,
...(obj.InstanceProperties && {
InstanceProperties: obj.InstanceProperties.map((item) => InstancePropertyFilterSensitiveLog(item)),
}),
});

/**
* @internal
*/
Expand Down
3 changes: 2 additions & 1 deletion codegen/sdk-codegen/aws-models/ssm.json
Original file line number Diff line number Diff line change
Expand Up @@ -14454,7 +14454,8 @@
"smithy.api#length": {
"min": 1,
"max": 46
}
},
"smithy.api#sensitive": {}
}
},
"com.amazonaws.ssm#ISO8601String": {
Expand Down

0 comments on commit b4bc88d

Please sign in to comment.