@kensio/yulin 1.18.0 → 1.18.1
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/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +8 -2
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts.map +1 -1
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +9 -3
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js.map +1 -1
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.d.ts +25 -0
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.d.ts.map +1 -0
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.js +36 -0
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.js.map +1 -0
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts.map +1 -1
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +6 -5
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects-authorizer.d.ts +6 -4
- package/dist/service/s3/command/list-objects/list-objects-authorizer.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects-authorizer.js +6 -4
- package/dist/service/s3/command/list-objects/list-objects-authorizer.js.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts +4 -2
- package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects-page-builder.js +8 -2
- package/dist/service/s3/command/list-objects/list-objects-page-builder.js.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects.command.d.ts +7 -0
- package/dist/service/s3/command/list-objects/list-objects.command.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects.handler.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects/list-objects.handler.js +2 -0
- package/dist/service/s3/command/list-objects/list-objects.handler.js.map +1 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts +1 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js +6 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js.map +1 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts +8 -2
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.d.ts.map +1 -1
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js +2 -0
- package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js.map +1 -1
- package/dist/service/s3/object/s3-common-prefix.d.ts +22 -0
- package/dist/service/s3/object/s3-common-prefix.d.ts.map +1 -0
- package/dist/service/s3/object/s3-common-prefix.js +16 -0
- package/dist/service/s3/object/s3-common-prefix.js.map +1 -0
- package/dist/service/s3/object/s3-object-listing.d.ts +9 -2
- package/dist/service/s3/object/s3-object-listing.d.ts.map +1 -1
- package/dist/service/s3/object/s3-object-listing.js +70 -13
- package/dist/service/s3/object/s3-object-listing.js.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-input.d.ts.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-input.js +2 -0
- package/dist/service/s3/serve/api/sim-s3-api-input.js.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-listing.d.ts +5 -0
- package/dist/service/s3/serve/api/sim-s3-api-listing.d.ts.map +1 -1
- package/dist/service/s3/serve/api/sim-s3-api-listing.js +6 -1
- package/dist/service/s3/serve/api/sim-s3-api-listing.js.map +1 -1
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.d.ts +4 -0
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.d.ts.map +1 -1
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.js +9 -0
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.js.map +1 -1
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.d.ts +22 -0
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.d.ts.map +1 -0
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.js +28 -0
- package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.js.map +1 -0
- package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.d.ts +25 -6
- package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.d.ts.map +1 -1
- package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.js +32 -7
- package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.js.map +1 -1
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.d.ts +16 -0
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.d.ts.map +1 -0
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.js +22 -0
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.js.map +1 -0
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.d.ts +13 -4
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.d.ts.map +1 -1
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.js +21 -11
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.js.map +1 -1
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.d.ts +11 -1
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.d.ts.map +1 -1
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.js +19 -2
- package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.js.map +1 -1
- package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.d.ts +9 -0
- package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.d.ts.map +1 -1
- package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.js +9 -0
- package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.js.map +1 -1
- package/dist/service/wafv2/sim-wafv2.d.ts +12 -0
- package/dist/service/wafv2/sim-wafv2.d.ts.map +1 -1
- package/dist/service/wafv2/sim-wafv2.js +17 -0
- package/dist/service/wafv2/sim-wafv2.js.map +1 -1
- package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.d.ts +26 -0
- package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.d.ts.map +1 -0
- package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.js +34 -0
- package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { simWafUnsimulatedWebAclMembers } from "../../command/web-acl/sim-wafv2-unsimulated-web-acl-input.js";
|
|
1
2
|
import { SimCfnWafResourceConfig } from "../sim-cfn-waf-resource-config.js";
|
|
2
3
|
import { wafWebAclResourceType } from "../sim-cfn-waf-resource-types.js";
|
|
3
4
|
/**
|
|
@@ -7,7 +8,7 @@ import { wafWebAclResourceType } from "../sim-cfn-waf-resource-types.js";
|
|
|
7
8
|
* default action and the custom response bodies are handed over as the
|
|
8
9
|
* template wrote them. They are not read here at all: every rule is compiled
|
|
9
10
|
* by CreateWebACL, which is where a statement kind Yulin cannot evaluate is
|
|
10
|
-
*
|
|
11
|
+
* found, and reading them twice would mean two answers to the same question.
|
|
11
12
|
*/
|
|
12
13
|
export class SimCfnWafWebAclConfig extends SimCfnWafResourceConfig {
|
|
13
14
|
get resourceType() {
|
|
@@ -16,11 +17,13 @@ export class SimCfnWafWebAclConfig extends SimCfnWafResourceConfig {
|
|
|
16
17
|
/**
|
|
17
18
|
* The input the web ACL this Resource describes is created from.
|
|
18
19
|
*
|
|
19
|
-
* The properties this simulation has no behaviour for are
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* The properties this simulation has no behaviour for are left out of it and
|
|
21
|
+
* recorded, so the web ACL deploys with the rest of what the template wrote.
|
|
22
|
+
* An SDK caller is refused for the same properties, because a request that
|
|
23
|
+
* was answered and then quietly dropped is a worse answer than a refusal.
|
|
22
24
|
*/
|
|
23
25
|
createInput() {
|
|
26
|
+
this.recordUnsimulatedMembers();
|
|
24
27
|
return {
|
|
25
28
|
Name: this.name(),
|
|
26
29
|
Scope: this.scope(),
|
|
@@ -29,15 +32,22 @@ export class SimCfnWafWebAclConfig extends SimCfnWafResourceConfig {
|
|
|
29
32
|
Rules: this.rules(),
|
|
30
33
|
VisibilityConfig: this.value("VisibilityConfig"),
|
|
31
34
|
CustomResponseBodies: this.value("CustomResponseBodies"),
|
|
32
|
-
CaptchaConfig: this.value("CaptchaConfig"),
|
|
33
|
-
ChallengeConfig: this.value("ChallengeConfig"),
|
|
34
|
-
TokenDomains: this.strings("TokenDomains"),
|
|
35
|
-
AssociationConfig: this.value("AssociationConfig"),
|
|
36
|
-
DataProtectionConfig: this.value("DataProtectionConfig"),
|
|
37
|
-
OnSourceDDoSProtectionConfig: this.value("OnSourceDDoSProtectionConfig"),
|
|
38
|
-
ApplicationConfig: this.value("ApplicationConfig"),
|
|
39
35
|
};
|
|
40
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Record the web ACL members this simulation has no behaviour for.
|
|
39
|
+
*
|
|
40
|
+
* Each of them changes what a web ACL does on real WAF, so a web ACL
|
|
41
|
+
* deployed without one behaves differently to the one the template
|
|
42
|
+
* describes. `stack.ignoredProperties` is where a test reads that.
|
|
43
|
+
*/
|
|
44
|
+
recordUnsimulatedMembers() {
|
|
45
|
+
for (const [member, reason] of simWafUnsimulatedWebAclMembers) {
|
|
46
|
+
if (this.value(member) !== undefined) {
|
|
47
|
+
this.resource.ignoreProperty(member, `${member} is not simulated: ${reason}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
41
51
|
/**
|
|
42
52
|
* The rules the template declared.
|
|
43
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-waf-web-acl-config.js","sourceRoot":"","sources":["../../../../../src/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAsB,SAAQ,uBAAuB;IAChE,IAAuB,YAAY;QACjC,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"sim-cfn-waf-web-acl-config.js","sourceRoot":"","sources":["../../../../../src/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAE,MAAM,8DAA8D,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAsB,SAAQ,uBAAuB;IAChE,IAAuB,YAAY;QACjC,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED;;;;;;;OAOG;IACH,WAAW;QACT,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAEhC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAE5B;YACb,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;YACnB,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;YAChD,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAE1C;SACd,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACK,wBAAwB;QAC9B,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,8BAA8B,EAAE,CAAC;YAC9D,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;gBACrC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAC1B,MAAM,EACN,GAAG,MAAM,sBAAsB,MAAM,EAAE,CACxC,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACK,KAAK;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,KAAmC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -11,7 +11,17 @@ interface SimCfnWafWebAclCreatorProperties {
|
|
|
11
11
|
* The web ACL is created through the ordinary CreateWebACL command rather than
|
|
12
12
|
* constructed directly, so one a template deployed is the same thing an SDK
|
|
13
13
|
* caller would have got: the same compilation of every rule, and the same
|
|
14
|
-
*
|
|
14
|
+
* refusals.
|
|
15
|
+
*
|
|
16
|
+
* A rule this simulation cannot evaluate is the exception, and the two part
|
|
17
|
+
* company over it. An SDK caller has the whole web ACL refused. A template
|
|
18
|
+
* deploys the web ACL without that rule and records it on
|
|
19
|
+
* `stack.ignoredProperties`, because the alternative is one rule taking a
|
|
20
|
+
* user pool, a table and two functions in the same template down with it.
|
|
21
|
+
*
|
|
22
|
+
* The web ACL is then real, and thinner than the one the template describes.
|
|
23
|
+
* That is the cost of deploying it at all, and the record of the dropped rule
|
|
24
|
+
* is what a test reads to know the size of it.
|
|
15
25
|
*/
|
|
16
26
|
export declare class SimCfnWafWebAclCreator {
|
|
17
27
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-waf-web-acl-creator.d.ts","sourceRoot":"","sources":["../../../../../src/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAClH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-waf-web-acl-creator.d.ts","sourceRoot":"","sources":["../../../../../src/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAClH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAMrE,UAAU,gCAAgC;IACxC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,sBAAsB;;IAGjC,YAAY,UAAU,EAAE,gCAAgC,EAEvD;IAED;;OAEG;IACG,MAAM,CACV,QAAQ,EAAE,cAAc,EACxB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,YAAY,CAAC,CAoCvB;IAED;;;;;;;OAOG;IACG,MAAM,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAc1E;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assertDefined } from "../../../../util/type-guard/defined.js";
|
|
2
2
|
import { simCfnWafResourceCommand } from "../sim-cfn-waf-resource-error.js";
|
|
3
3
|
import { wafWebAclResourceType } from "../sim-cfn-waf-resource-types.js";
|
|
4
|
+
import { simCfnWafEvaluatableRules } from "./sim-cfn-waf-evaluatable-rules.js";
|
|
4
5
|
import { SimCfnWafWebAclConfig } from "./sim-cfn-waf-web-acl-config.js";
|
|
5
6
|
/**
|
|
6
7
|
* Creates simulated web ACLs from AWS::WAFv2::WebACL Resources.
|
|
@@ -8,7 +9,17 @@ import { SimCfnWafWebAclConfig } from "./sim-cfn-waf-web-acl-config.js";
|
|
|
8
9
|
* The web ACL is created through the ordinary CreateWebACL command rather than
|
|
9
10
|
* constructed directly, so one a template deployed is the same thing an SDK
|
|
10
11
|
* caller would have got: the same compilation of every rule, and the same
|
|
11
|
-
*
|
|
12
|
+
* refusals.
|
|
13
|
+
*
|
|
14
|
+
* A rule this simulation cannot evaluate is the exception, and the two part
|
|
15
|
+
* company over it. An SDK caller has the whole web ACL refused. A template
|
|
16
|
+
* deploys the web ACL without that rule and records it on
|
|
17
|
+
* `stack.ignoredProperties`, because the alternative is one rule taking a
|
|
18
|
+
* user pool, a table and two functions in the same template down with it.
|
|
19
|
+
*
|
|
20
|
+
* The web ACL is then real, and thinner than the one the template describes.
|
|
21
|
+
* That is the cost of deploying it at all, and the record of the dropped rule
|
|
22
|
+
* is what a test reads to know the size of it.
|
|
12
23
|
*/
|
|
13
24
|
export class SimCfnWafWebAclCreator {
|
|
14
25
|
#wafV2;
|
|
@@ -23,8 +34,14 @@ export class SimCfnWafWebAclCreator {
|
|
|
23
34
|
resource,
|
|
24
35
|
properties,
|
|
25
36
|
}).createInput();
|
|
37
|
+
const deployable = {
|
|
38
|
+
...input,
|
|
39
|
+
Rules: simCfnWafEvaluatableRules(this.#wafV2, resource, input),
|
|
40
|
+
};
|
|
26
41
|
return await simCfnWafResourceCommand(wafWebAclResourceType, resource.logicalId, async () => {
|
|
27
|
-
const created = await this.#wafV2.createWebAcl({
|
|
42
|
+
const created = await this.#wafV2.createWebAcl({
|
|
43
|
+
input: deployable,
|
|
44
|
+
});
|
|
28
45
|
const arn = created.Summary?.ARN;
|
|
29
46
|
assertDefined(arn, `sim WAFv2 web ACL ARN for CloudFormation Resource ${resource.logicalId}`);
|
|
30
47
|
const webAcl = this.#wafV2.findWebAclByArn(arn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-waf-web-acl-creator.js","sourceRoot":"","sources":["../../../../../src/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAKvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE
|
|
1
|
+
{"version":3,"file":"sim-cfn-waf-web-acl-creator.js","sourceRoot":"","sources":["../../../../../src/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAKvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE;;;;;;;;;;;;;;;;;GAi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AAE,MAAM,CAAC,KAAK;gBACnB,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B;SACF,CAAC,CACL,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { SimWafWebAclWriteInput } from "./web-acl.command.js";
|
|
2
|
+
/**
|
|
3
|
+
* Why each web ACL member this simulation does not model is refused, by the
|
|
4
|
+
* name a request and a template both write.
|
|
5
|
+
*
|
|
6
|
+
* The refusal below and the CloudFormation layer read the same list. One
|
|
7
|
+
* throws and the other records the member and deploys the web ACL without it,
|
|
8
|
+
* and neither should be able to grow a reason the other has not got.
|
|
9
|
+
*/
|
|
10
|
+
export declare const simWafUnsimulatedWebAclMembers: ReadonlyMap<string, string>;
|
|
2
11
|
/**
|
|
3
12
|
* Refuse the web ACL members this simulation does not model.
|
|
4
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-wafv2-unsimulated-web-acl-input.d.ts","sourceRoot":"","sources":["../../../../../src/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AA2CnE;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,sBAAsB,EAC7B,SAAS,EAAE,MAAM,GAChB,IAAI,CAYN"}
|
|
1
|
+
{"version":3,"file":"sim-wafv2-unsimulated-web-acl-input.d.ts","sourceRoot":"","sources":["../../../../../src/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AA2CnE;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CACA,CAAC;AAExE;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,sBAAsB,EAC7B,SAAS,EAAE,MAAM,GAChB,IAAI,CAYN"}
|
|
@@ -29,6 +29,15 @@ const refusedMembers = [
|
|
|
29
29
|
"it configures the WAF-hosted sign-in pages, which are not simulated",
|
|
30
30
|
],
|
|
31
31
|
];
|
|
32
|
+
/**
|
|
33
|
+
* Why each web ACL member this simulation does not model is refused, by the
|
|
34
|
+
* name a request and a template both write.
|
|
35
|
+
*
|
|
36
|
+
* The refusal below and the CloudFormation layer read the same list. One
|
|
37
|
+
* throws and the other records the member and deploys the web ACL without it,
|
|
38
|
+
* and neither should be able to grow a reason the other has not got.
|
|
39
|
+
*/
|
|
40
|
+
export const simWafUnsimulatedWebAclMembers = new Map(refusedMembers.map(([, member, reason]) => [member, reason]));
|
|
32
41
|
/**
|
|
33
42
|
* Refuse the web ACL members this simulation does not model.
|
|
34
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-wafv2-unsimulated-web-acl-input.js","sourceRoot":"","sources":["../../../../../src/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAYzD,MAAM,YAAY,GAChB,2EAA2E;IAC3E,qBAAqB,CAAC;AAExB,MAAM,cAAc,GAAmC;IACrD,CAAC,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,YAAY,CAAC;IACxE,CAAC,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,iBAAiB,EAAE,YAAY,CAAC;IAC5E,CAAC,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC;IACtE;QACE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,iBAAiB;QAC3C,mBAAmB;QACnB,mEAAmE;YACjE,+DAA+D;KAClE;IACD;QACE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,oBAAoB;QAC9C,sBAAsB;QACtB,0EAA0E;YACxE,kBAAkB;KACrB;IACD;QACE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,4BAA4B;QACtD,8BAA8B;QAC9B,oEAAoE;KACrE;IACD;QACE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,iBAAiB;QAC3C,mBAAmB;QACnB,qEAAqE;KACtE;CACF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CAChD,KAA6B,EAC7B,SAAiB;IAEjB,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAExC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;QACpD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,+BAA+B,CACvC,GAAG,SAAS,YAAY,MAAM,oCAC5B,MACF,EAAE,CACH,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"sim-wafv2-unsimulated-web-acl-input.js","sourceRoot":"","sources":["../../../../../src/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAYzD,MAAM,YAAY,GAChB,2EAA2E;IAC3E,qBAAqB,CAAC;AAExB,MAAM,cAAc,GAAmC;IACrD,CAAC,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,YAAY,CAAC;IACxE,CAAC,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,e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12
12
|
import { SimWafCfnResourceFactory } from "./cfn/sim-waf-cfn-resource-factory.js";
|
|
13
13
|
import { SimWafSets } from "./sim-wafv2-sets.js";
|
|
14
14
|
import type { SimWafWebAcl } from "./web-acl/sim-waf-web-acl.js";
|
|
15
|
+
import { type SimWafUnevaluatableRule } from "./web-acl/sim-waf-unevaluatable-rules.js";
|
|
16
|
+
import type { SimWafWebAclWriteInput } from "./command/web-acl/web-acl.command.js";
|
|
15
17
|
export type { SimWafEvaluationRequest } from "./evaluate/sim-waf-evaluation-request.js";
|
|
16
18
|
/**
|
|
17
19
|
* Simulated AWS WAFv2. Handles SDK commands. Emulates AWS behaviour and state.
|
|
@@ -87,6 +89,16 @@ export declare class SimWafV2 extends SimWafSets {
|
|
|
87
89
|
* nothing here, and `rules()` reports what is covered of each.
|
|
88
90
|
*/
|
|
89
91
|
managedRules(): SimWafManagedRules;
|
|
92
|
+
/**
|
|
93
|
+
* The rules of a web ACL input this simulation cannot evaluate.
|
|
94
|
+
*
|
|
95
|
+
* The simulator's own accessor rather than a WAFv2 operation. `CreateWebACL`
|
|
96
|
+
* refuses a web ACL carrying such a rule, because a web ACL that accepted
|
|
97
|
+
* one would allow a request AWS blocks. A template is deployed rule by rule
|
|
98
|
+
* instead, so the CloudFormation layer asks this first and leaves the rules
|
|
99
|
+
* it names out of the web ACL it writes.
|
|
100
|
+
*/
|
|
101
|
+
unevaluatableWebAclRules(input: SimWafWebAclWriteInput): readonly SimWafUnevaluatableRule[];
|
|
90
102
|
/**
|
|
91
103
|
* Handle a CreateWebACL Command from the SDK.
|
|
92
104
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-wafv2.d.ts","sourceRoot":"","sources":["../../../src/service/wafv2/sim-wafv2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E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AA8B,EACtD,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,cAAc,CAAC,oCAAoC,CAAC,CAM9D;IAED;;OAEG;IACG,sBAAsB,CAC1B,OAAO,EAAE,cAAc,CAAC,gCAAgC,EACxD,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,cAAc,CAAC,sCAAsC,CAAC,CAMhE;IAED;;OAEG;IACH,kBAAkB,IAAI,wBAAwB,CAE7C;IAED;;OAEG;IACH,gBAAgB,IAAI,mBAAmB,CAEtC;CACF"}
|
|
@@ -4,6 +4,7 @@ import { SimWafSdkCommandRouter } from "./sdk/sim-wafv2-sdk-command-router.js";
|
|
|
4
4
|
import { SimWafCommands, } from "./sim-wafv2-commands.js";
|
|
5
5
|
import { SimWafCfnResourceFactory } from "./cfn/sim-waf-cfn-resource-factory.js";
|
|
6
6
|
import { SimWafSets } from "./sim-wafv2-sets.js";
|
|
7
|
+
import { unevaluatableSimWafRules, } from "./web-acl/sim-waf-unevaluatable-rules.js";
|
|
7
8
|
/**
|
|
8
9
|
* Simulated AWS WAFv2. Handles SDK commands. Emulates AWS behaviour and state.
|
|
9
10
|
*
|
|
@@ -100,6 +101,22 @@ export class SimWafV2 extends SimWafSets {
|
|
|
100
101
|
managedRules() {
|
|
101
102
|
return this.commands.managedRules;
|
|
102
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* The rules of a web ACL input this simulation cannot evaluate.
|
|
106
|
+
*
|
|
107
|
+
* The simulator's own accessor rather than a WAFv2 operation. `CreateWebACL`
|
|
108
|
+
* refuses a web ACL carrying such a rule, because a web ACL that accepted
|
|
109
|
+
* one would allow a request AWS blocks. A template is deployed rule by rule
|
|
110
|
+
* instead, so the CloudFormation layer asks this first and leaves the rules
|
|
111
|
+
* it names out of the web ACL it writes.
|
|
112
|
+
*/
|
|
113
|
+
unevaluatableWebAclRules(input) {
|
|
114
|
+
return unevaluatableSimWafRules(input.Rules, {
|
|
115
|
+
regexPatternSets: this.commands.regexPatternSets,
|
|
116
|
+
managedRules: this.commands.managedRules,
|
|
117
|
+
customResponseBodies: input.CustomResponseBodies ?? {},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
103
120
|
/**
|
|
104
121
|
* Handle a CreateWebACL Command from the SDK.
|
|
105
122
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-wafv2.js","sourceRoot":"","sources":["../../../src/service/wafv2/sim-wafv2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAKjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EACL,cAAc,GAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-wafv2.js","sourceRoot":"","sources":["../../../src/service/wafv2/sim-wafv2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAKjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EACL,cAAc,GAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAEL,wBAAwB,GACzB,MAAM,0CAA0C,CAAC;AAKlD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,QAAS,SAAQ,UAAU;IAC7B,UAAU,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,WAAW,GAAG,IAAI,wBAAwB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C;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAwD,EACxD,OAA8B;QAE9B,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,sBAAsB,CAC7D,OAAO,EACP,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SimWafRuleInput, SimWafRuleScope } from "./sim-waf-rule.type.js";
|
|
2
|
+
/**
|
|
3
|
+
* One rule of a web ACL this simulation cannot evaluate, and why.
|
|
4
|
+
*/
|
|
5
|
+
export interface SimWafUnevaluatableRule {
|
|
6
|
+
/** Where the rule sits in the list the web ACL was written with. */
|
|
7
|
+
readonly index: number;
|
|
8
|
+
/** The rule's name, as the reason and a record of it name it. */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** What `CreateWebACL` refuses the rule with. */
|
|
11
|
+
readonly reason: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The rules of a web ACL this simulation cannot evaluate.
|
|
15
|
+
*
|
|
16
|
+
* Each rule is compiled on its own and the refusal is caught, so this answers
|
|
17
|
+
* with exactly what `CreateWebACL` would refuse and nothing else. A rule the
|
|
18
|
+
* simulation can evaluate is compiled twice, once here and once by the write
|
|
19
|
+
* that follows, and compiling is a pure reading of the rule.
|
|
20
|
+
*
|
|
21
|
+
* Only a refusal saying the simulation does not go that far is collected. Rule
|
|
22
|
+
* input WAFv2 itself will not take is left where it is, for the write to raise
|
|
23
|
+
* as it always has.
|
|
24
|
+
*/
|
|
25
|
+
export declare function unevaluatableSimWafRules(rules: readonly SimWafRuleInput[] | undefined, scope: SimWafRuleScope): readonly SimWafUnevaluatableRule[];
|
|
26
|
+
//# sourceMappingURL=sim-waf-unevaluatable-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-waf-unevaluatable-rules.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/web-acl/sim-waf-unevaluatable-rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAC7C,KAAK,EAAE,eAAe,GACrB,SAAS,uBAAuB,EAAE,CAQpC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SimWafUnsimulatedInputException } from "../error/sim-wafv2.error.js";
|
|
2
|
+
import { SimWafRule } from "./sim-waf-rule.js";
|
|
3
|
+
/**
|
|
4
|
+
* The rules of a web ACL this simulation cannot evaluate.
|
|
5
|
+
*
|
|
6
|
+
* Each rule is compiled on its own and the refusal is caught, so this answers
|
|
7
|
+
* with exactly what `CreateWebACL` would refuse and nothing else. A rule the
|
|
8
|
+
* simulation can evaluate is compiled twice, once here and once by the write
|
|
9
|
+
* that follows, and compiling is a pure reading of the rule.
|
|
10
|
+
*
|
|
11
|
+
* Only a refusal saying the simulation does not go that far is collected. Rule
|
|
12
|
+
* input WAFv2 itself will not take is left where it is, for the write to raise
|
|
13
|
+
* as it always has.
|
|
14
|
+
*/
|
|
15
|
+
export function unevaluatableSimWafRules(rules, scope) {
|
|
16
|
+
return (rules ?? []).flatMap((rule, index) => {
|
|
17
|
+
const reason = unevaluatableReason(rule, scope);
|
|
18
|
+
return reason === undefined
|
|
19
|
+
? []
|
|
20
|
+
: [{ index, name: rule.Name ?? `at ${index}`, reason }];
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function unevaluatableReason(rule, scope) {
|
|
24
|
+
try {
|
|
25
|
+
SimWafRule.compile(rule, scope);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error instanceof SimWafUnsimulatedInputException) {
|
|
29
|
+
return error.message;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=sim-waf-unevaluatable-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-waf-unevaluatable-rules.js","sourceRoot":"","sources":["../../../../src/service/wafv2/web-acl/sim-waf-unevaluatable-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiB/C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAA6C,EAC7C,KAAsB;IAEtB,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEhD,OAAO,MAAM,KAAK,SAAS;YACzB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAAqB,EACrB,KAAsB;IAEtB,IAAI,CAAC;QACH,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,+BAA+B,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC,OAAO,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED