Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix waf rules #500

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions cdk/src/components/waf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,13 @@ export class WAF extends wafv2.CfnWebACL {
// if request ends in .sql
searchString: '.sql',
fieldToMatch: {
singleHeader: {
name: ':path',
},
uriPath: {},
},
positionalConstraint: 'ENDS_WITH',
textTransformations: [
{
priority: 0,
type: 'URL_DECODE',
type: 'NONE',
},
],
},
Expand All @@ -143,15 +141,13 @@ export class WAF extends wafv2.CfnWebACL {
// if requested path is wp-admin
searchString: '/wp-admin',
fieldToMatch: {
singleHeader: {
name: ':path',
},
uriPath: {},
},
positionalConstraint: 'CONTAINS',
positionalConstraint: 'STARTS_WITH',
textTransformations: [
{
priority: 0,
type: 'URL_DECODE',
type: 'NONE',
},
],
},
Expand All @@ -173,15 +169,13 @@ export class WAF extends wafv2.CfnWebACL {
// if requested path is wp-content
searchString: '/wp-content',
fieldToMatch: {
singleHeader: {
name: ':path',
},
uriPath: {},
},
positionalConstraint: 'CONTAINS',
positionalConstraint: 'STARTS_WITH',
textTransformations: [
{
priority: 0,
type: 'URL_DECODE',
type: 'NONE',
},
],
},
Expand All @@ -203,15 +197,13 @@ export class WAF extends wafv2.CfnWebACL {
// if requested path is swagger
searchString: '/swagger',
fieldToMatch: {
singleHeader: {
name: ':path',
},
uriPath: {},
},
positionalConstraint: 'CONTAINS',
positionalConstraint: 'STARTS_WITH',
textTransformations: [
{
priority: 0,
type: 'URL_DECODE',
type: 'NONE',
},
],
},
Expand Down