Skip to content

Commit 2d435dc

Browse files
authored
Merge pull request #533 from globaldatanet/pullrequests/vboufleur/fix/misc
4.6.1
2 parents 3f538a2 + 2f290b9 commit 2d435dc

File tree

10 files changed

+42
-19
lines changed

10 files changed

+42
-19
lines changed

.github/workflows/waf_test_ipSets.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ jobs:
7171
run: |
7272
export STACK_NAME=WAFStack
7373
task deploy config=ipSetsTests
74+
- name: Sleep for 30 seconds
75+
uses: jakejarvis/wait-action@master
76+
with:
77+
time: '30s'
7478
- name: 🗑️ Remove Firewall from AWS
7579
run: |
7680
export STACK_NAME=WAFStack

.github/workflows/waf_test_rateBasedwithScopeDown.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ jobs:
7171
run: |
7272
export STACK_NAME=WAFStack
7373
task deploy config=rateBasedwithScopeDownTests
74+
- name: Sleep for 30 seconds
75+
uses: jakejarvis/wait-action@master
76+
with:
77+
time: '30s'
7478
- name: 🗑️ Remove Firewall from AWS
7579
run: |
7680
export STACK_NAME=WAFStack

.github/workflows/waf_test_regexPatternSets.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
run: |
7171
export STACK_NAME=WAFStack
7272
task deploy config=regexPatternSetsTests
73+
- name: Sleep for 30 seconds
74+
uses: jakejarvis/wait-action@master
75+
with:
76+
time: '30s'
7377
- name: 🗑️ Remove Firewall from AWS
7478
run: |
7579
export STACK_NAME=WAFStack

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Released
44

5+
## 4.6.1
6+
### Fixed
7+
- Bug Fix: Resolved "code not found" error in WAF WCU Quota check. Kudos to [@vboufleur](https://github.com/vboufleur) for fixing this.
8+
- WAFConfig Updates: Kudos to [@vboufleur](https://github.com/vboufleur) for fixing this.
9+
- - Added OptimizeUnassociatedWebACL property.
10+
- - Fixed an issue where CDK rejected deployments if the first character of CustomResponseBodies properties was uppercase.
11+
- Fix: Corrected imports in UnusedNotification Lambda.
12+
513
## 4.6.0
614
### Added
715
- Automated IP Set Management: The AutoUpdatedManagedIpSet feature now supports automated management of IP sets through AWS Firewall Factory.

lib/lambda/SendUnusedResourceNotification/messengers/slack/notification.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MessageAttachment } from "@slack/types";
33
import { PolicySummary } from "@aws-sdk/client-fms";
44
import { AccountWebAcls, FmsPolicy } from "../../../SharedComponents/types/index";
55
import {getProductPrice} from "../../../../tools/helpers/pricing";
6-
import { pricing, general } from "../../../../types/enums";
6+
import { PriceRegions, RegionString } from "../../../../types/enums";
77
import * as packageJsonObject from "../../../../../package.json";
88

99

@@ -29,8 +29,8 @@ export async function unusedNotificationSlack(
2929

3030

3131
const region = process.env.AWS_DEFAULT_REGION || "us-east-1";
32-
const policyPrice = Number(await getProductPrice(pricing.PriceRegions[region as general.RegionString],"AWSFMS","WAFv2"));
33-
const webAclPrice = Number(await getProductPrice(pricing.PriceRegions[region as general.RegionString] as pricing.PriceRegions,"awswaf",undefined,"Web ACL"));
32+
const policyPrice = Number(await getProductPrice(PriceRegions[region as RegionString],"AWSFMS","WAFv2"));
33+
const webAclPrice = Number(await getProductPrice(PriceRegions[region as RegionString] as PriceRegions,"awswaf",undefined,"Web ACL"));
3434

3535

3636
const totalcost = (allFMSPolicies.length * policyPrice) + (totalWafs * webAclPrice);

lib/lambda/SendUnusedResourceNotification/messengers/teams/notification.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
2-
3-
4-
5-
61
import { IncomingWebhook } from "./IncomingWebhook";
72
import { PolicySummary } from "@aws-sdk/client-fms";
83
import { AccountWebAcls, FmsPolicy } from "../../../SharedComponents/types/index";
94
import * as AdaptiveCards from "adaptivecards";
105
import {getProductPrice} from "../../../../tools/helpers/pricing";
11-
import { pricing, general } from "../../../../types/enums";
6+
import { PriceRegions, RegionString } from "../../../../types/enums";
127
import * as packageJsonObject from "../../../../../package.json";
138
import {addAccount} from "../../helper";
149

@@ -131,8 +126,8 @@ export async function unusedNotificationTeams(AllWAFs: AccountWebAcls[], UniqueU
131126

132127

133128
const region = process.env.AWS_DEFAULT_REGION || "us-east-1";
134-
const policyPrice = Number(await getProductPrice(pricing.PriceRegions[region as general.RegionString],"AWSFMS","WAFv2"));
135-
const webAclPrice = Number(await getProductPrice(pricing.PriceRegions[region as general.RegionString] as pricing.PriceRegions,"awswaf",undefined,"Web ACL"));
129+
const policyPrice = Number(await getProductPrice(PriceRegions[region as RegionString],"AWSFMS","WAFv2"));
130+
const webAclPrice = Number(await getProductPrice(PriceRegions[region as RegionString] as PriceRegions,"awswaf",undefined,"Web ACL"));
136131

137132
const totalcost = (allFMSPolicies.length * policyPrice) + (totalWafs * webAclPrice);
138133
const potentialsavings = ((UniqueUnusedFMSPolicies.length)*policyPrice) + ((totalWafs - wafsInUse)*webAclPrice);

lib/tools/helpers/web-application-firewall/quotas-and-capacity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {getcurrentManagedRuleGroupVersion} from "./rulegroups";
1212
/**
1313
* Service Quota Code for Firewall Manager Total WAF WCU in account & region
1414
*/
15-
const WCU_QUOTA_CODE = "L-D86ED2F3";
15+
const WCU_QUOTA_CODE = "L-1E778CA5";
1616

1717
/**
1818
* Service Quota Code for Firewall Manager policies per organization per Region
@@ -726,4 +726,4 @@ export async function isWcuQuotaReached(deploymentRegion: string, runtimeProps:
726726
guidanceHelper.getGuidance("noIpReputationList", runtimeProps);
727727
}
728728
return wcuLimitReached;
729-
}
729+
}

lib/types/config/waf.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export interface WafConfig {
8686
* Replace web ACLs that are currently associated with in-scope resources with the web ACLs created by this policy - Default is False
8787
*/
8888
readonly OverrideCustomerWebACLAssociation?: boolean;
89+
90+
/**
91+
* Automatically remove protections from resources that leave the policy scope and clean up resources that
92+
* Firewall Manager is managing for accounts when those accounts leave policy scope - Default is False
93+
*/
94+
readonly OptimizeUnassociatedWebACL?: boolean;
95+
8996
/**
9097
* Specifies whether this is for an Amazon CloudFront distribution or for a regional application.
9198
* A regional application can be
@@ -162,15 +169,15 @@ export type CustomResponseBodies = {
162169
/**
163170
* @TJS-pattern [\s\S]*
164171
*/
165-
Content: string;
172+
content: string;
166173
/**
167174
* AWS WAF Content Type
168175
*
169176
* The type of content in the payload that you are defining in the Content string.
170177
*
171178
* @see https://docs.aws.amazon.com/waf/latest/APIReference/API_CustomResponseBody.html
172179
*/
173-
ContentType: CustomResponseBodiesContentType;
180+
contentType: CustomResponseBodiesContentType;
174181
};
175182
};
176183

@@ -392,6 +399,7 @@ export interface ManagedServiceData {
392399
preProcessRuleGroups: any,
393400
postProcessRuleGroups: any,
394401
overrideCustomerWebACLAssociation: boolean,
402+
optimizeUnassociatedWebACL?: boolean,
395403
loggingConfiguration: {
396404
logDestinationConfigs: string[]
397405
}
@@ -446,4 +454,4 @@ export interface NotStatementProperty {
446454
*/
447455
export interface SubVariables {
448456
[key: string]: string;
449-
}
457+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aws-firewall-factory",
3-
"version": "4.6.0",
3+
"version": "4.6.1",
44
"bin": {
55
"firewallfactory": "bin/aws-firewall-factory.js"
66
},

0 commit comments

Comments
 (0)