Skip to content
Merged
Show file tree
Hide file tree
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: 30 additions & 0 deletions calico-enterprise/operations/cnx/access-the-manager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,36 @@ Instead of creating an ingress or load balancer yourself, you can let the operat

1. Point your hostname at that address in DNS.

1. Optional: if you protect the web console with a [Gateway WAF](../../threat/gateway-waf/overview.mdx) policy that uses the Core Rule Set, Kibana Discover fails with HTTP `403`. The Core Rule Set reads Kibana's search requests as attacks. To allow them, create this `GlobalWAFPlugin`:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
1. Optional: if you protect the web console with a [Gateway WAF](../../threat/gateway-waf/overview.mdx) policy that uses the Core Rule Set, Kibana Discover fails with HTTP `403`. The Core Rule Set reads Kibana's search requests as attacks. To allow them, create this `GlobalWAFPlugin`:
1. Optional: If you also use [Gateway WAF](../../threat/gateway-waf/overview.mdx), you need to add a WAF exception to prevent traffic to the web console from being blocked. Create a `GlobalWAFPlugin` resource like the following:


```yaml
apiVersion: applicationlayer.projectcalico.org/v3
kind: GlobalWAFPlugin
metadata:
name: kibana-exceptions
spec:
before: |
SecRule SERVER_NAME "@streq <web-console-hostname>" "id:100000001,phase:1,pass,nolog,t:none,t:lowercase,chain"
SecRule REQUEST_METHOD "@streq POST" "t:none,chain"
SecRule REQUEST_FILENAME "@streq /tigera-kibana/internal/bsearch" "t:none,t:urlDecodeUni,t:normalizePath,ctl:requestBodyAccess=Off"
SecRule SERVER_NAME "@streq <web-console-hostname>" "id:100000002,phase:1,pass,nolog,t:none,t:lowercase,chain"
SecRule REQUEST_FILENAME "@beginsWith /tigera-kibana/" "t:none,t:urlDecodeUni,t:normalizePath,ctl:ruleRemoveTargetById=931100;ARGS:url,ctl:ruleRemoveTargetById=934110;ARGS:url"
```

Replace the following:
* `<web-console-hostname>`: The hostname you set in `spec.ingressGateway.hostname`, in lowercase. For example, `manager.example.com`.

Then add `kibana-exceptions` to the `spec.plugins` list in your existing `default` `GlobalWAFPolicy`. Keep any plugins that are already in the list. If `spec.plugins` doesn't exist yet, add it:

```yaml
spec:
plugins:
- kind: GlobalWAFPlugin
name: kibana-exceptions
```

On your web console host, the WAF stops inspecting the body of Kibana search requests. For every Kibana request, rules `931100` and `934110` no longer check the `url` argument. The WAF still inspects all other traffic. For more about plugins, see [Write custom rules with plugins](../../threat/gateway-waf/write-custom-rules.mdx).

:::note

If your cluster uses OIDC, set the `Authentication` resource's `managerDomain` to `https://` plus that hostname (as in the example below). The host must match `spec.ingressGateway.hostname`, or the operator reports the $[prodname] web console as degraded:
Expand Down
2 changes: 2 additions & 0 deletions calico-enterprise/threat/gateway-waf/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ kubectl logs -n <namespace> \

For how to write exception rules within your namespace's ID range, see [Write custom rules with plugins](./write-custom-rules.mdx).

If Kibana Discover in the web console returns `403`, see the optional WAF step in [Configure access to the web console](../../operations/cnx/access-the-manager.mdx).
Comment thread
electricjesus marked this conversation as resolved.

:::caution

`SecRuleRemoveById` can only target rule IDs within your namespace's allocated range. You cannot remove Core Rule Set baseline rules (IDs `900000`–`999999`) or Tigera-managed rules — the admission webhook will reject the plugin with `ProtectedIDRemoval`.
Expand Down
Loading