-
Notifications
You must be signed in to change notification settings - Fork 260
feat(edge-services): add documentation for WAF #4599
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
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
44c0b16
feat(edge): add waf doc
RoRoJ 226729a
feat(waf): continue doc
RoRoJ 11133a9
feat(es): more waf
RoRoJ 85aea0b
feat(edge): more waf
RoRoJ 3cbda0e
feat(edge): continue waf
RoRoJ 4af3a80
fix(waf): diagrams and flows
RoRoJ 1472815
fix(waf): fix faq
RoRoJ d8e4ddb
fix(edge): fixed todo
RoRoJ 38d0e39
feat(edge-services): doc for api public beta
RoRoJ 8ddab0e
fix(edge-services): images
RoRoJ 4272222
fix(edge): corrections
RoRoJ 4a51088
Update pages/edge-services/reference-content/understanding-waf.mdx
RoRoJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+40.6 KB
...dge-services/reference-content/assets/scaleway-edge-services-pipeline-diag.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.7 KB
pages/edge-services/reference-content/assets/scaleway-edge-services-waf-diag.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+84.6 KB
pages/edge-services/reference-content/assets/scaleway-waf-add-on.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
pages/edge-services/reference-content/understanding-waf.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| --- | ||
| meta: | ||
| title: Understanding Edge Services Web Application Firewall (WAF) | ||
| description: Learn how to protect your web applications with Scaleway Edge Services Web Application Firewall (WAF). Discover the principles, paranoia levels, and limitations of WAF, and find out how to define exclusions for optimal security and performance. | ||
| content: | ||
| h1: Understanding Edge Services Web Application Firewall (WAF) | ||
| paragraph: Learn how to protect your web applications with Edge Services Web Application Firewall (WAF). Discover the principles, paranoia levels, and limitations of WAF, and find out how to define exclusions for optimal security and performance. | ||
| tags: edge-services web-application-firewall waf paranoia-levels exclusions | ||
| dates: | ||
| validation: 2025-03-03 | ||
| creation: 2025-03-03 | ||
| categories: | ||
| - network | ||
| --- | ||
|
|
||
| <Message type="note"> | ||
| WAF is in Public Beta, and currently available only via the [Edge Services API](https://www.scaleway.com/en/developers/api/edge-services/). It will be coming soon to the Scaleway console. | ||
| </Message> | ||
|
|
||
| If your Edge Services pipeline points towards a Load Balancer origin, you can choose to enable the **W**eb **A**pplication **F**irewall (WAF) feature, for added protection. This documentation page gives a detailed overview of WAF, and the different settings, modes and functionalities available. | ||
|
|
||
| ## WAF overview | ||
|
|
||
| When enabled, WAF protects your Load Balancer backend from potential threats. | ||
|
|
||
| It does so by evaluating each request to your Load Balancer origin, to determine whether it is potentially malicious. Four different rulesets can be used to evaluate requests, each more aggressive than the last. The ruleset to use is determined by the **paranoia level** set by the user. | ||
|
|
||
| For requests judged to be malicious, WAF can either block them from passing to your origin (as shown in the diagram below), or simply log them but allow them to pass, depending on the settings you choose. | ||
|
|
||
| You can set **exclusions**, so that certain requests are not evaluated by WAF and are allowed to pass directly to your Load Balancer origin. Exclusion filters are based on the request path and/or HTTP request type. | ||
|
|
||
| <Lightbox src="scaleway-edge-services-waf-diag.webp" alt="A diagram shows how Edge Services WAF deals with three different types of HTTP request. A request meeting the criteria for WAF exclusion is passed directly to the Load Balancer origin. A benign request is first checked by the WAF rules, then allowed to pass to the Load Balancer origin. A malicious request is checked by the rules, and blocked from passing to the Load Balancer origin." /> | ||
|
|
||
| ## WAF in an Edge Services pipeline | ||
|
|
||
| In an Edge Services pipeline, WAF sits before the origin stage. This means that WAF only protects your origin, it does not protect or filter requests towards the cache. | ||
|
|
||
| <Lightbox src="scaleway-edge-services-pipeline-diag.webp" alt="A diagram shows the elements and workflow of an Edge Services pipeline. The user connects to the customizable Edge Services endpoint (with its SSL/TLS certificate), which fetches content from the Edge Services cache, which itself fetches content to cache from an origin which is either an Object Storage bucket or Load Balancer. A Web Application Firewall sits between the cache and origin, protecting the origin from threats." /> | ||
|
|
||
| If you have both WAF and cache enabled, requests that can be served by the cache will not go through WAF. Only requests that cannot be served by the cache will be filtered by WAF, and allowed to pass to the origin or not depending on your WAF configuration. | ||
|
|
||
| ## WAF ruleset and paranoia levels | ||
|
|
||
| Scaleway Edge Services WAF uses the [OWASP **C**ore **R**ule **S**et (CRS)](https://coreruleset.org/). This is an industry standard, open source ruleset for WAF, which protects against multiple categories of attack such as SQL injection and cross-site scripting. Full details are available in the [OWASP CRS documentation](https://coreruleset.org/docs/). | ||
|
|
||
| **Paranoia level settings** are an integral part of the core ruleset. They dictate how aggressive the ruleset should be when judging whether a given request is malicious or not. The paranoia level is rated from 1 to 4, which each being more aggressive and more sensitive to potential threats than the last. | ||
|
|
||
| The four levels are: | ||
|
|
||
| - **1 - Minimal protection**: Basic security, suitable for environments with low sensitivity, prioritizing minimal false alerts. | ||
| - **2 - Moderate protection**: Solid protection for environments dealing with real-world customer data. | ||
| - **3 - Strong protection**: Banking-standard security, prioritizing safety but prone to frequent false alerts. | ||
| - **4 - Maximum protection**: Hyper-paranoid rules, fit for protecting the most critical and sensitive assets. | ||
|
|
||
| The higher the paranoia level, the more likely you are to have **false positives**. This is when WAF classes a request as malicious, when in fact it is not. | ||
|
|
||
| - At level 1, the ruleset is unlikely to trigger false positives, however it is also more likely to miss threats and aggressions and classify them as benign. | ||
|
|
||
| - At level 4, the ruleset is so aggressive that it detects almost every possible attack, however it is also highly likely to trigger a significant number of false positives whereby a lot of legitimate traffic will be classed as malicious. | ||
|
|
||
| | | Level 1 | Level 2 | Level 3 | Level 4 | | ||
| |---|---|---|---|---| | ||
| | Number of threats detected | Lowest | Moderately Low | Moderately High | Highest | | ||
| | Number of false positives | Lowest | Moderately Low | Moderately High | Highest | | ||
|
|
||
| Choosing a paranoia level therefore means trading off **how hard it is for an attacker to go undetected** against **how much legitimate traffic is incorrectly classified as malicious**. This depends on your use case, and the sensitivity of the application and assets being protected by WAF. | ||
|
|
||
| - Anyone running an HTTP server on the internet could benefit from level 1 protection. | ||
| - If real user data is involved, consider level 2. | ||
| - For online banking, consider level 3 | ||
| - For crown-jewel level assets, consider level 4. | ||
|
|
||
| Find out more about paranoia levels in the [official OWASP CRS documentation](https://coreruleset.org/docs/2-how-crs-works/2-2-paranoia_levels/). | ||
|
|
||
| Read on to find out how you can use **exclusions** to mitigate the effect of some false positives. | ||
|
|
||
| ## WAF exclusions | ||
|
|
||
| WAF **exclusions** are filters that allow matching requests (based on **path** and/or **HTTP request type**) to bypass WAF entirely. | ||
|
|
||
| You can set up to 100 exclusions after enabling WAF on a given pipeline. | ||
|
|
||
| - **Path filter**: Define a regular expression to filter for in request paths, e.g. `/api/v1/.*` | ||
| - **HTTP request filter**: Define one or more HTTP request types to filter requests for, e.g. `GET`, `DELETE`, `POST` etc. | ||
|
|
||
| Each exclusion can consist of: | ||
|
|
||
| - A path filter only, OR | ||
| - An HTTP request filter only (which itself can filter for multiple request types on an `ANY` basis), OR | ||
| - One path filter and one HTTP request filter. In this case, only requests matching **both** filters will be considered to meet the criteria for exclusion. | ||
|
|
||
| ## WAF limitations | ||
|
|
||
| - WAF is in Public Beta, and currently available only via the [Edge Services API](https://www.scaleway.com/en/developers/api/edge-services/). | ||
| - WAF is only compatible with Load Balancer origins. It cannot be enabled for Object Storage bucket origins. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @RoRoJ here |
||
| - WAF protects your origin only, and not your cache. | ||
| - You can add a maximum of 100 WAF exclusions | ||
| - You cannot currently specify exclusions at the individual rule level. Requests matching exclusion filters bypass WAF entirely. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RoRoJ here