Skip to content

Commit 8c527a5

Browse files
authored
fix: remove warnings and fix duplicated key (#250)
Signed-off-by: Felipe Zipitria <[email protected]>
1 parent 68bd182 commit 8c527a5

File tree

13 files changed

+28
-29
lines changed

13 files changed

+28
-29
lines changed

content/1-getting-started/1-1-crs-installation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ chapter: false
66
aliases: ["../deployment/install"]
77
---
88

9-
This guide aims to get a CRS installation up and running. This guide assumes that a compatible ModSecurity engine is already present and working. If unsure then refer to the [extended install]({{< ref "1-2-extended_install.md" >}}) page for full details.
9+
This guide aims to get a CRS installation up and running. This guide assumes that a compatible ModSecurity engine is already present and working. If unsure then refer to the [extended install]({{% ref "1-2-extended_install.md" %}}) page for full details.
1010

1111
## Downloading the Rule Set
1212

@@ -74,7 +74,7 @@ gpg: Good signature from "OWASP CRS <[email protected]>" [ultimate]
7474

7575
Once the rule set has been downloaded and verified, extract the rule set files to a well known location on the server. This will typically be somewhere in the web server directory.
7676

77-
The examples presented below demonstrate using Apache. For information on configuring Nginx or IIS see the [extended install]({{< ref "1-2-extended_install.md" >}}) page.
77+
The examples presented below demonstrate using Apache. For information on configuring Nginx or IIS see the [extended install]({{% ref "1-2-extended_install.md" %}}) page.
7878

7979
Note that while it's common practice to make a new `modsecurity.d` folder, as outlined below, this isn't strictly necessary. The path scheme outlined is common on RHEL-based operating systems; the Apache path used may need to be adjusted to match the server's installation.
8080

@@ -114,7 +114,7 @@ mv crs-setup.conf.example crs-setup.conf
114114

115115
### Include-ing the Rule Files
116116

117-
The last step is to tell the web server where the rules are. This is achieved by `include`-ing the rule configuration files in the `httpd.conf` file. Again, this example demonstrates using Apache, but the process is similar on other systems (see the [extended install]({{< ref "1-2-extended_install.md" >}}) page for details).
117+
The last step is to tell the web server where the rules are. This is achieved by `include`-ing the rule configuration files in the `httpd.conf` file. Again, this example demonstrates using Apache, but the process is similar on other systems (see the [extended install]({{% ref "1-2-extended_install.md" %}}) page for details).
118118

119119
```bash
120120
echo 'IncludeOptional {{< param crs_install_dir >}}/crs-setup.conf' >> /etc/httpd/conf/httpd.conf
@@ -124,7 +124,7 @@ echo 'IncludeOptional {{< param crs_install_dir >}}/rules/*.conf' >> /etc/httpd/
124124
echo 'IncludeOptional {{< param crs_install_dir >}}/plugins/*-after.conf' >> /etc/httpd/conf/httpd.conf
125125
```
126126

127-
Now that everything has been configured, it should be possible to restart and begin using the OWASP CRS. The CRS rules typically require a bit of tuning with rule exclusions, depending on the site and web applications in question. For more information on tuning, see [false positives and tuning]({{< ref "2-3-false-positives-and-tuning.md" >}}).
127+
Now that everything has been configured, it should be possible to restart and begin using the OWASP CRS. The CRS rules typically require a bit of tuning with rule exclusions, depending on the site and web applications in question. For more information on tuning, see [false positives and tuning]({{% ref "2-3-false-positives-and-tuning.md" %}}).
128128

129129
```bash
130130
systemctl restart httpd.service
@@ -184,7 +184,7 @@ Depending on your configurated thresholds, this should be detected as a maliciou
184184

185185
### Upgrading from CRS 3.x to CRS 4
186186

187-
The most impactful change is the removal of application exclusion packages in favor of a plugin system. If you had activated the exclusion packages in CRS 3, you should download the plugins for them and place them in the plugins subdirectory. We maintain the list of plugins in our [Plugin Registry](https://github.com/coreruleset/plugin-registry). You can find detailed information on working with plugins in our [plugins documentation]({{< ref "4-about-plugins/" >}}).
187+
The most impactful change is the removal of application exclusion packages in favor of a plugin system. If you had activated the exclusion packages in CRS 3, you should download the plugins for them and place them in the plugins subdirectory. We maintain the list of plugins in our [Plugin Registry](https://github.com/coreruleset/plugin-registry). You can find detailed information on working with plugins in our [plugins documentation]({{% ref "4-about-plugins/" %}}).
188188

189189
In terms of changes to the detection rules, the amount of changes is smaller than in the CRS 2—3 changeover. Most rules have only evolved slightly, so it is recommended that you keep any existing custom exclusions that you have made under CRS 3.
190190

content/1-getting-started/1-2-extended_install.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ chapter: false
66
aliases: ["../deployment/extended_install"]
77
---
88

9-
> All the information needed to properly install CRS is presented on this page. The installation concepts are expanded upon and presented in more detail than the [quick start guide]({{< ref "1-1-crs-installation.md" >}}).
9+
> All the information needed to properly install CRS is presented on this page. The installation concepts are expanded upon and presented in more detail than the [quick start guide]({{% ref "1-1-crs-installation.md" %}}).
1010
1111
## Contact Us
1212

@@ -177,7 +177,7 @@ At a minimum, keep in mind the following:
177177

178178
- CRS does not configure features such as the rule engine, audit engine, logging, etc. This task is part of the initial *engine* setup and is not a job for the rule set. For ModSecurity, if not already done, see the [recommended configuration](https://github.com/owasp-modsecurity/ModSecurity/blob/master/modsecurity.conf-recommended).
179179
- Decide what ModSecurity should do when it detects malicious activity, e.g., drop the packet, return a *403 Forbidden* status code, issue a redirect to a custom page, etc.
180-
- Make sure to configure the anomaly scoring thresholds. For more information see [Anomaly]({{< ref "2-1-anomaly_scoring.md" >}} "Anomaly").
180+
- Make sure to configure the anomaly scoring thresholds. For more information see [Anomaly]({{% ref "2-1-anomaly_scoring.md" %}} "Anomaly").
181181
- By default, the CRS rules will consider many issues with different databases and languages. If running in a specific environment, e.g., without any SQL database services present, it is probably a good idea to limit this behavior for performance reasons.
182182
- Make sure to add any HTTP methods, static resources, content types, or file extensions that are needed, beyond the default ones listed.
183183

@@ -192,7 +192,7 @@ In addition to `crs-setup.conf.example`, there are two other ".example" files wi
192192
- `rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example`
193193
- `rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example`
194194

195-
These files are designed to provide the rule maintainer with the ability to modify rules (see [false positives and tuning]({{< ref "2-3-false-positives-and-tuning.md" >}}#rule-exclusions)) without breaking forward compatibility with rule set updates. These two files should be renamed by removing the `.example` suffix. This will mean that installing updates will *not* overwrite custom rule exclusions. To rename the files in Linux, use a command similar to the following:
195+
These files are designed to provide the rule maintainer with the ability to modify rules (see [false positives and tuning]({{% ref "2-3-false-positives-and-tuning.md" %}}#rule-exclusions)) without breaking forward compatibility with rule set updates. These two files should be renamed by removing the `.example` suffix. This will mean that installing updates will *not* overwrite custom rule exclusions. To rename the files in Linux, use a command similar to the following:
196196

197197
```bash
198198
mv rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
@@ -203,7 +203,7 @@ mv rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example rules/RESPONSE-999-
203203

204204
The engine should support the `Include` directive out of the box. This directive tells the engine to parse *additional* files for directives. The question is where to put the CRS rules folder in order for it to be included.
205205

206-
Looking at the CRS files, there are quite a few ".conf" files. While the names attempt to do a good job at describing what each file does, additional information is available in the [rules]({{< ref "3-about-rules/rules.md" >}}) section.
206+
Looking at the CRS files, there are quite a few ".conf" files. While the names attempt to do a good job at describing what each file does, additional information is available in the [rules]({{% ref "3-about-rules/rules.md" %}}) section.
207207

208208
### Includes for Apache
209209

content/2-how-crs-works/2-3-false-positives-and-tuning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ aliases: ["../concepts/false_positives_tuning"]
1212

1313
CRS provides _generic_ attack detection capabilities. A fresh CRS deployment has no awareness of the web services that may be running behind it, or the quirks of how those services work. It is possible that *genuine* transactions may cause some CRS rules to match in error, if the transactions happen to match one of the generic attack behaviors or patterns that are being detected. Such a match is referred to as a *false positive*, or false alarm.
1414

15-
False positives are particularly likely to happen when operating at higher [paranoia levels]({{< ref "2-2-paranoia_levels.md" >}} "Page describing paranoia levels."). While paranoia level 1 is designed to cause few, ideally zero, false positives, higher paranoia levels are increasingly likely to cause false positives. Each successive paranoia level introduces additional rules, with *higher* paranoia levels adding *more aggressive* rules. As such, the higher the paranoia level is the more likely it is that false positives will occur. That is the cost of the higher security provided by higher paranoia levels: the additional time it takes to tune away the increasing number of false positives.
15+
False positives are particularly likely to happen when operating at higher [paranoia levels]({{% ref "2-2-paranoia_levels.md" %}} "Page describing paranoia levels."). While paranoia level 1 is designed to cause few, ideally zero, false positives, higher paranoia levels are increasingly likely to cause false positives. Each successive paranoia level introduces additional rules, with *higher* paranoia levels adding *more aggressive* rules. As such, the higher the paranoia level is the more likely it is that false positives will occur. That is the cost of the higher security provided by higher paranoia levels: the additional time it takes to tune away the increasing number of false positives.
1616

1717
### Example False Positive
1818

content/3-about-rules/rule_writing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ chapter: false
77

88
> From years of experience, the CRS project has assembled a wealth of knowledge and advice on how to write clear and efficient WAF rules, as this page outlines.
99
10-
The CRS project's advice on rule writing is contained within the [contribution guidelines]({{< ref "6-1-contribution-guidelines.md" >}}), a document which can also be found in plain text form in CRS releases for offline reference. The guidelines contain invaluable guidance and tips on how to write rules, including:
10+
The CRS project's advice on rule writing is contained within the [contribution guidelines]({{% ref "6-1-contribution-guidelines.md" %}}), a document which can also be found in plain text form in CRS releases for offline reference. The guidelines contain invaluable guidance and tips on how to write rules, including:
1111

1212
- effective regular expression writing
1313
- consistent formatting and indentation

content/3-about-rules/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: What's In The Rules
2+
title: "What's In The Rules"
33
weight: 20
44
disableToc: false
55
chapter: false

content/4-about-plugins/4-1-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Available plugins include:
162162

163163
## How to Write a Plugin
164164

165-
For information on writing a new plugin, refer to the development documentation on [writing plugins]({{< ref "4-2-writing-plugins.md" >}}).
165+
For information on writing a new plugin, refer to the development documentation on [writing plugins]({{% ref "4-2-writing-plugins.md" %}}).
166166

167167
## Collection Timeout
168168

content/6-development/6-1-contribution-guidelines.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ SecRule ARGS "foo" "id:1,phase:1,pass,t:none"
138138
CRS uses `\x5c` to represent the backslash `\` character in regular expressions. Some of the reasons for this are:
139139

140140
* It's portable across web servers and WAF engines: it works with Apache, Nginx, and Coraza.
141-
* It works with the [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}}) for building optimized regular expressions.
141+
* It works with the [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}}) for building optimized regular expressions.
142142

143143
The older style of representing a backslash using the character class `[\\\\]` must _not_ be used. This was previously used in CRS to get consistent results between Apache and Nginx, owing to a quirk with how Apache would "double un-escape" character escapes. For future reference, the decision was made to stop using this older method because:
144144

145145
* It can be confusing and difficult to understand how it works.
146-
* It doesn't work with [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}}).
146+
* It doesn't work with [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}}).
147147
* It doesn't work with Coraza.
148148
* It isn't obvious how to use it in a character class, e.g., `[a-zA-Z<portable-backslash>]`.
149149

@@ -300,21 +300,21 @@ Optimizing regular expressions is hard. Often, a change intended to improve the
300300
mailto|mms|mumble|maven
301301
```
302302

303-
An optimized version (produced by the [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}})) could look like this:
303+
An optimized version (produced by the [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}})) could look like this:
304304

305305
```python
306306
m(?:a(?:ilto|ven)|umble|ms)
307307
```
308308

309309
The above expression is an optimization because it reduces the number of backtracking steps when a branch fails. The regular expressions in the CRS are often comprised of lists of tens or even hundreds of words. Reading such an expression in an optimized form is difficult: even the _simple_ optimized example above is difficult to read.
310310

311-
In general, contributors should not try to optimize contributed regular expressions and should instead strive for clarity. New regular expressions will usually be required to be submitted as a `.ra` file for the [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}}) to process. In such a file, the regular expression is decomposed into individual parts, making manual optimizations much harder or even impossible (and unnecessary with the `crs-toolchain`). The `crs-toolchain` performs some common optimizations automatically, such as the one shown above.
311+
In general, contributors should not try to optimize contributed regular expressions and should instead strive for clarity. New regular expressions will usually be required to be submitted as a `.ra` file for the [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}}) to process. In such a file, the regular expression is decomposed into individual parts, making manual optimizations much harder or even impossible (and unnecessary with the `crs-toolchain`). The `crs-toolchain` performs some common optimizations automatically, such as the one shown above.
312312

313313
Whether optimizations make sense in a contribution is assessed for each case individually.
314314

315315
## Rules Compliance with Paranoia Levels
316316

317-
The rules in CRS are organized into **paranoia levels** (PLs) which makes it possible to define how aggressive CRS is. See the documentation on [paranoia levels]({{< ref "2-2-paranoia_levels" >}}) for an introduction and more detailed explanation.
317+
The rules in CRS are organized into **paranoia levels** (PLs) which makes it possible to define how aggressive CRS is. See the documentation on [paranoia levels]({{% ref "2-2-paranoia_levels" %}}) for an introduction and more detailed explanation.
318318

319319
Each rule that is placed into a paranoia level must contain the tag `paranoia-level/N`, where *N* is the PL value, however this tag can only be added if the rule does **not** use the nolog action.
320320

content/6-development/6-2-crs-toolchain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ crs-toolchain --help
6868

6969
## The `regex` Command
7070

71-
The `regex` command provides sub-commands for everything surrounding regular expressions, especially the "assembly" of regular expressions from a specification of its components (see [Assembling Regular Expressions]({{< ref "6-3-assembling-regular-expressions.md" >}}) for more details).
71+
The `regex` command provides sub-commands for everything surrounding regular expressions, especially the "assembly" of regular expressions from a specification of its components (see [Assembling Regular Expressions]({{% ref "6-3-assembling-regular-expressions.md" %}}) for more details).
7272

7373
### Example Use
7474

content/6-development/6-3-assembling-regular-expressions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases: ["../development/regex_assembly"]
1010
1111
## Specification Format
1212

13-
The files containing regular expression specifications (`.ra` suffix, under `regex-assembly`) contain one regular expression per line. These files are meant to be processed by the [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}}).
13+
The files containing regular expression specifications (`.ra` suffix, under `regex-assembly`) contain one regular expression per line. These files are meant to be processed by the [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}}).
1414

1515
### Example
1616

@@ -110,7 +110,7 @@ The following example is intentionanlly simple (and meaningless) to illustrates
110110
##!<
111111
```
112112

113-
Processors are defined in the [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}}).
113+
Processors are defined in the [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}}).
114114

115115
### Nesting
116116

@@ -322,7 +322,7 @@ The exact contents of the included file, including processor directives, with su
322322
323323
### Description
324324
325-
The include processor reduces repetition across assembly files. Repeated blocks can be put into a file in the `include` directory and then be included with the `include` processor comment. Include files are normal assembly files, hence include files can also contain further include directives. The only restriction is that included files must not contain the prefix or suffix markers. This is a technical limitation in the [crs-toolchain]({{< ref "6-2-crs-toolchain.md" >}}).
325+
The include processor reduces repetition across assembly files. Repeated blocks can be put into a file in the `include` directory and then be included with the `include` processor comment. Include files are normal assembly files, hence include files can also contain further include directives. The only restriction is that included files must not contain the prefix or suffix markers. This is a technical limitation in the [crs-toolchain]({{% ref "6-2-crs-toolchain.md" %}}).
326326
327327
The contents of an include file could, for example, be the alternation of accepted HTTP methods:
328328
@@ -358,7 +358,7 @@ it{{quotes}}s{{opt-lazy-wspace}}possible
358358
359359
Note that the include processor does not have a body, thus the end marker is optional.
360360
361-
Please see [Include-Except processor]({{< ref "6-3-assembling-regular-expressions.md#include-except-processor" >}}) for how suffix replacements work.
361+
Please see [Include-Except processor]({{% ref "6-3-assembling-regular-expressions.md#include-except-processor" %}}) for how suffix replacements work.
362362
363363
## Include-Except processor
364364

content/6-development/6-5-testing-the-rule-set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Excellent, our containers are running, now we can start our tests.
4949

5050
### Using your own environment for testing {#use-own-env}
5151

52-
If you have your own environment set up, you can configure that for testing. Please [follow these instructions]({{< ref "1-1-crs-installation.md#installing-a-compatible-waf-engine" >}}) to install the WAF server locally.
52+
If you have your own environment set up, you can configure that for testing. Please [follow these instructions]({{% ref "1-1-crs-installation.md#installing-a-compatible-waf-engine" %}}) to install the WAF server locally.
5353

5454
> [!NOTE]
5555
> Remember: The supported platform is ModSecurity 2 with Apache httpd. If you want to run the tests against nginx, you can do that too, but nginx uses libmodsecurity3, which is not fully compatible with Apache httpd + ModSecurity 2.

0 commit comments

Comments
 (0)