cdk-real-drift 0.18.9 → 0.18.11
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.
- package/dist/cli.js +60 -4
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2407,7 +2407,8 @@ const KNOWN_DEFAULTS = {
|
|
|
2407
2407
|
} },
|
|
2408
2408
|
"AWS::ECR::Repository": {
|
|
2409
2409
|
EncryptionConfiguration: { EncryptionType: "AES256" },
|
|
2410
|
-
ImageTagMutability: "MUTABLE"
|
|
2410
|
+
ImageTagMutability: "MUTABLE",
|
|
2411
|
+
ImageScanningConfiguration: { ScanOnPush: false }
|
|
2411
2412
|
},
|
|
2412
2413
|
"AWS::ECR::RepositoryCreationTemplate": {
|
|
2413
2414
|
EncryptionConfiguration: { EncryptionType: "AES256" },
|
|
@@ -3107,7 +3108,8 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
3107
3108
|
"AWS::OpenSearchService::Domain": {
|
|
3108
3109
|
"EBSOptions.Iops": 3e3,
|
|
3109
3110
|
"EBSOptions.Throughput": 125,
|
|
3110
|
-
"ClusterConfig.ZoneAwarenessConfig": { AvailabilityZoneCount: 2 }
|
|
3111
|
+
"ClusterConfig.ZoneAwarenessConfig": { AvailabilityZoneCount: 2 },
|
|
3112
|
+
"ClusterConfig.DedicatedMasterCount": 3
|
|
3111
3113
|
},
|
|
3112
3114
|
"AWS::KinesisFirehose::DeliveryStream": {
|
|
3113
3115
|
"ExtendedS3DestinationConfiguration.S3BackupMode": "Disabled",
|
|
@@ -3116,7 +3118,23 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
3116
3118
|
"ExtendedS3DestinationConfiguration.BufferingHints": {
|
|
3117
3119
|
IntervalInSeconds: 300,
|
|
3118
3120
|
SizeInMBs: 5
|
|
3119
|
-
}
|
|
3121
|
+
},
|
|
3122
|
+
"HttpEndpointDestinationConfiguration.RequestConfiguration": {
|
|
3123
|
+
CommonAttributes: [],
|
|
3124
|
+
ContentEncoding: "NONE"
|
|
3125
|
+
},
|
|
3126
|
+
"HttpEndpointDestinationConfiguration.BufferingHints": {
|
|
3127
|
+
IntervalInSeconds: 300,
|
|
3128
|
+
SizeInMBs: 5
|
|
3129
|
+
},
|
|
3130
|
+
"HttpEndpointDestinationConfiguration.RetryOptions": { DurationInSeconds: 300 },
|
|
3131
|
+
"HttpEndpointDestinationConfiguration.S3BackupMode": "FailedDataOnly",
|
|
3132
|
+
"HttpEndpointDestinationConfiguration.S3Configuration.BufferingHints": {
|
|
3133
|
+
IntervalInSeconds: 300,
|
|
3134
|
+
SizeInMBs: 5
|
|
3135
|
+
},
|
|
3136
|
+
"HttpEndpointDestinationConfiguration.S3Configuration.CompressionFormat": "UNCOMPRESSED",
|
|
3137
|
+
"HttpEndpointDestinationConfiguration.S3Configuration.EncryptionConfiguration": { NoEncryptionConfig: "NoEncryption" }
|
|
3120
3138
|
},
|
|
3121
3139
|
"AWS::Athena::WorkGroup": {
|
|
3122
3140
|
"WorkGroupConfiguration.EnforceWorkGroupConfiguration": true,
|
|
@@ -6206,6 +6224,33 @@ function clbDefaultSslPoliciesAtDefault(resourceType, key, value) {
|
|
|
6206
6224
|
if (!Array.isArray(value) || value.length === 0) return false;
|
|
6207
6225
|
return value.every((el) => isNestedObject(el) && el["PolicyType"] === "SSLNegotiationPolicyType" && el["PolicyName"] === CLB_DEFAULT_SSL_POLICY_NAME);
|
|
6208
6226
|
}
|
|
6227
|
+
const VPN_TUNNEL_EMPTY_LIST_KEYS = new Set([
|
|
6228
|
+
"Phase1EncryptionAlgorithms",
|
|
6229
|
+
"Phase1IntegrityAlgorithms",
|
|
6230
|
+
"Phase1DHGroupNumbers",
|
|
6231
|
+
"Phase2EncryptionAlgorithms",
|
|
6232
|
+
"Phase2IntegrityAlgorithms",
|
|
6233
|
+
"Phase2DHGroupNumbers",
|
|
6234
|
+
"IKEVersions"
|
|
6235
|
+
]);
|
|
6236
|
+
const VPN_TUNNEL_INSIDE_CIDR = /^169\.254\.\d{1,3}\.\d{1,3}\/30$/;
|
|
6237
|
+
function vpnTunnelOptionsAtDefault(resourceType, key, value) {
|
|
6238
|
+
if (resourceType !== "AWS::EC2::VPNConnection" || key !== "VpnTunnelOptionsSpecifications") return false;
|
|
6239
|
+
if (!Array.isArray(value) || value.length === 0) return false;
|
|
6240
|
+
return value.every((el) => {
|
|
6241
|
+
if (!isNestedObject(el)) return false;
|
|
6242
|
+
return Object.entries(el).every(([k, v]) => {
|
|
6243
|
+
if (VPN_TUNNEL_EMPTY_LIST_KEYS.has(k)) return Array.isArray(v) && v.length === 0;
|
|
6244
|
+
if (k === "TunnelInsideCidr") return typeof v === "string" && VPN_TUNNEL_INSIDE_CIDR.test(v);
|
|
6245
|
+
if (k === "TunnelInsideIpv6Cidr") return typeof v === "string";
|
|
6246
|
+
if (k === "LogOptions") return deepEqual(v, { CloudwatchLogOptions: {
|
|
6247
|
+
BgpLogEnabled: false,
|
|
6248
|
+
LogEnabled: false
|
|
6249
|
+
} });
|
|
6250
|
+
return false;
|
|
6251
|
+
});
|
|
6252
|
+
});
|
|
6253
|
+
}
|
|
6209
6254
|
const CFN_RANDOM_SUFFIX = /-[0-9A-Za-z]{12,}$/;
|
|
6210
6255
|
function stripInjectedJsonStringDefaults(declared, live, defaults) {
|
|
6211
6256
|
const stripObject = (d, l) => {
|
|
@@ -7590,6 +7635,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
7590
7635
|
continue;
|
|
7591
7636
|
}
|
|
7592
7637
|
}
|
|
7638
|
+
if (resourceType === "AWS::EFS::FileSystem" && k === "BackupPolicy" && typeof declared["AvailabilityZoneName"] === "string") {
|
|
7639
|
+
findings.push({
|
|
7640
|
+
tier: matchesKnownDefault(v, { Status: "ENABLED" }) ? "atDefault" : "undeclared",
|
|
7641
|
+
logicalId,
|
|
7642
|
+
resourceType,
|
|
7643
|
+
path: k,
|
|
7644
|
+
actual: v
|
|
7645
|
+
});
|
|
7646
|
+
continue;
|
|
7647
|
+
}
|
|
7593
7648
|
if (resourceType === "AWS::DMS::ReplicationInstance" && k === "AllocatedStorage") {
|
|
7594
7649
|
const cls = declared["ReplicationInstanceClass"];
|
|
7595
7650
|
const derived = typeof cls === "string" ? opts.accountDefaults?.dmsAllocatedStorageDefaults?.[cls] : void 0;
|
|
@@ -7604,7 +7659,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
7604
7659
|
continue;
|
|
7605
7660
|
}
|
|
7606
7661
|
}
|
|
7607
|
-
if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in schema.defaultPaths && matchesKnownDefault(v, schema.defaultPaths[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) && !(k in knownDef) || clbDefaultSslPoliciesAtDefault(resourceType, k, v)) {
|
|
7662
|
+
if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in schema.defaultPaths && matchesKnownDefault(v, schema.defaultPaths[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) && !(k in knownDef) || clbDefaultSslPoliciesAtDefault(resourceType, k, v) || vpnTunnelOptionsAtDefault(resourceType, k, v)) {
|
|
7608
7663
|
findings.push({
|
|
7609
7664
|
tier: "atDefault",
|
|
7610
7665
|
logicalId,
|
|
@@ -18675,6 +18730,7 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
|
18675
18730
|
"AWS::SNS::Subscription\0FilterPolicyScope",
|
|
18676
18731
|
"AWS::InternetMonitor::Monitor\0Status",
|
|
18677
18732
|
"AWS::ECR::Repository\0ImageTagMutability",
|
|
18733
|
+
"AWS::ECR::Repository\0ImageScanningConfiguration",
|
|
18678
18734
|
"AWS::SQS::Queue\0MaximumMessageSize",
|
|
18679
18735
|
"AWS::Lambda::Url\0InvokeMode",
|
|
18680
18736
|
"AWS::RolesAnywhere::Profile\0DurationSeconds",
|