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

update CoreRuleset payload for dikastes' new WAF engine #2991

Merged

Conversation

electricjesus
Copy link
Member

@electricjesus electricjesus commented Nov 8, 2023

Description

Now that we're changing the WAF engine in Dikastes from Modsecurity to Coraza, this PR provides mainly two changes that ties into that changel:

  1. a few changes to command-line invocation, and
  2. an update to the coreruleset version

Here is a more detailed breakdown on the changes in this PR

  • update dikastes command-line options to reflect new cli options for dikastes that runs coraza-based waf (pkg/render/applicationlayer/applicationlayer.go)
  • bumped coreruleset version v3.3.5 to v4.0.0-rc2
  • move and reorganise coreruleset delivery
    • removed the 'go:generate'-based workflow, this removes the generated artifacts and reduces the possibility of not updating it everytime we need an update to coreruleset. This also means we replace generated files with embedded references in applicationlayer renderer and controller.
    • reorganise how we do the customisations: all our custom CRS behaviour in its own tigera.conf file
    • coreruleset files now follow a rules subdirectory format, which is the original file/directory structure in github.com/coreruleset/coreruleset

Depends on https://github.com/tigera/calico-private/pull/6862 but that PR also depends on this one.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

- now embedded, no need to rely on go:generate
- reorganise how we do the customisations, put all our custom CRS behaviour in its own tigera.conf file
@electricjesus electricjesus added kind/enhancement New feature or request enterprise Feature applies to enterprise only labels Nov 8, 2023
@marvin-tigera marvin-tigera added this to the v1.32.0 milestone Nov 8, 2023
@danudey danudey modified the milestones: v1.32.0, v1.32.1, v1.32.2 Dec 2, 2023
@electricjesus electricjesus marked this pull request as ready for review December 6, 2023 15:22
@electricjesus electricjesus requested a review from a team as a code owner December 6, 2023 15:22
@electricjesus electricjesus changed the title move and reorganise coreruleset delivery update CoreRuleset payload for dikastes' new WAF engine Dec 7, 2023
ModSecurityRulesetConfigMapName = "modsecurity-ruleset"
ModSecurityRulesetHashAnnotation = "hash.operator.tigera.io/modsecurity-ruleset"
CalicoLogsVolumeName = "var-log-calico"
CalicologsVolumePath = "/var/log/calico"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used within this file, should probably be private

To be honest, I suspect that is true of many of these variables, but since we're touching this one we should make it private.

Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - one minor nit about variables being public.

@electricjesus electricjesus merged commit acd9d13 into tigera:master Dec 7, 2023
3 checks passed
@electricjesus electricjesus deleted the update-ruleset-for-coraza branch December 7, 2023 16:32
@danudey danudey modified the milestones: v1.32.2, v1.32.3 Dec 15, 2023
mikestephen pushed a commit to mikestephen/operator that referenced this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-pr-required enterprise Feature applies to enterprise only kind/enhancement New feature or request release-note-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants