Code Monkey home page Code Monkey logo

documentation's Issues

Add a new known issue for replacement phase 1 rules

If completely replacing a CRS phase 1 rule (not just updating a rule target etc. but completely replacing a rule, i.e. the operator is being modified) then this cannot occur in the REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf file because any anomaly scoring will be wiped and set to 0 immediately after when REQUEST-901-INITIALIZATION.conf executes.

RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf is also no good as the replacement rule needs to come before REQUEST-949-BLOCKING-EVALUATION.conf/RESPONSE-959-BLOCKING-EVALUATION.conf so that the replacement rule correctly contributes to anomaly scoring totals. Otherwise, things like early blocking mode can start to break.

Document corner case as a known issue.

Include two ideas as solutions:

  • SecRuleRemoveById and then add new rule, all after the includes
  • Add in a custom REQUEST-902-CUSTOM-RULES-POST-INIT file, or something similar, if there are going to be many such replacement rules

Reference: coreruleset/coreruleset#2878

Improve go-ftw / Docker documentation

Findings by @dune73:

  • I had to install docker-compose (Ubuntu 22.04). Docker compose command becomes docker-compose. The documentation explains the need for docker-compose in older installs, but it only explains this under go-ftw, not in the docker section, where I kind of expect such an explanation.
  • The code block uses > as prompt, while other code blocks use $.
  • The code block does not explain you need to be root to run this. sudo would probably make this easier. The twist is that you may not be root to install go-ftw afterwards or the binary can't be found for the testing user.
  • The docker ps is a bit hidden within the same code block as the compose.
  • I'm getting a go-httpbin container instead of the httpbin indicated in the docker ps output
  • The ftw files presented further down below in the documentation do not correspond with the docker container composed. That means you need to adjust the log file within the .ftw.yaml. The doc explains that we're mounting the log volumes, but it does not indicate the path and I had to look for it in the compose file without this being explained anywhere. We are providing docker-compose.yaml. Why don't we provide a preconfigured .ftw.apache.docker.yaml etc.?

feat(docs): Expose tooling for rule developers

Motivation

We need more input from new contributors. Currently, we are relying more and more on a lot of internal and external tools to write our rules. Not everybody may know them, while they are so helpful to create better rules.

I think we should have something like a "Great tools for rule writers" page to bring the rule writing practices from the 2000s to the 2020s.

And maybe even end with a full-fledged "rule writing walkthrough" that strings all the tools together to create a sample rule (could be moved to a separate issue if we want to do that).

Proposed solution

At least, we could make a list of useful tools and links to them.

For example:

At best we could have the list, and also create a 'walkthrough' for creating a rule that goes from:

  • a payload
  • to one of the online IDEs above to play with payload variances and backend behavior with regards to spacing, comments, etc.
  • to thinking of a regexp
  • to making and testing it in regex101
  • when to modify an existing rule and when to create a new rule (which should be somewhat discouraged unless it's really a new attack technique.)
  • then to create a regexp-assemble data file
  • generate the rule with crs-toolchain
  • testing the rule (link to our own upcoming documentation on go-ftw)

Alternatives

Karel always just does a web search for 'execute postgres online'. But there's a bigger chance that people might give up.

Additional context

N/A

Merge in new 'Early Blocking' blog post content

Once the 'Early Blocking' blog post is finalised and published, I will merge the new content into the existing content we have on early blocking mode.

Some of the existing content is probably out of date. Also, the blog post probably has some clearer explanations here and there.

feat(docs): explain how to use Go-FTW

Motivation

Currently we don’t have documented how to set up and run go-ftw for rule developers.

Proposed solution

Create a documentation page under development and explain:

  • links to installing and running docker & docker-compose
  • downloading go-ftw
  • for macOS, trusting the ftw binary one time with right click and Open
  • add template for .ftw.yaml
  • running ftw
  • running ftw on one rule only
  • running ftw on a subset (regexp)
  • remembering to docker-compose down & up after changing a rule

Btw, my .ftw.yaml (if it's not already doc'd somewhere) is:

---
logfile: 'tests/logs/modsec2-apache/error.log'
logtype:
  name: 'apache'
  timeregex:  '\[([A-Z][a-z]{2} [A-z][a-z]{2} \d{1,2} \d{1,2}\:\d{1,2}\:\d{1,2}\.\d+? \d{4})\]'
  timeformat: 'ddd MMM DD HH:mm:ss.S YYYY'

We should have Nginx/Coraza too, maybe in the future and do it in steps.

Alternatives

Explain it manually to people 30 times. πŸ˜‰

Additional context

N/A

Rework section about AWS WAF

As far as we know, the AWS WAF "Core rule set (CRS) managed rule group" is not based on the OWASP CRS. (If anyone from AWS is reading this and knows otherwise, please reach out to us.)

This needs to be stated to avoid anyone getting confused and thinking the AWS CRS is the actual CRS.

Proposal for multi version documentation

Some parts of our documentation will face the problem that they need to describe different major versions, with non-compatible changes.

After reviewing a bit our options, we can:

  • have a base file that can be included. This base file should be (somehow) independent of the version. For version-specific stuff, we use the include shortcode from the theme
    An example layout for this is:
base/install.md (base with no "specific" version)
v3/install.md 
  - (include "base/install.md)
  - add specific content (files, etc)
v4/install.md
  - (include "base/install.md)
  - add specific content (files, etc)

Another option is to use tabbed content with a specific version. This has the advantage that you always have the content in one file.

Let me know what you think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.