-
Notifications
You must be signed in to change notification settings - Fork 155
docs(nginx-one): add local troubleshooting and verification guide for security monitoring #1861
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
870dc89
docs(nginx-one): improve security monitoring setup verification
kamalchaturvedi aa64e00
docs(nginx-one): add local security monitoring troubleshooting guide
kamalchaturvedi 515ac0c
Update content/nginx-one-console/waf-integration/waf-security-dashboa…
kamalchaturvedi 6dc3fd5
Apply suggestions from code review
kamalchaturvedi 956916f
Merge branch 'main' into main
travisamartin 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
180 changes: 180 additions & 0 deletions
180
...nsole/waf-integration/waf-security-dashboard/local-dataplane-troubleshooting.md
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,180 @@ | ||
| --- | ||
| nd-content-type: how-to | ||
| nd-docs: DOCS-000 | ||
| nd-product: NONECO | ||
| title: Troubleshoot security monitoring on the local data plane | ||
| description: "Check the local NGINX Agent and OpenTelemetry Collector configuration when F5 WAF for NGINX security events do not appear in NGINX One Console." | ||
| weight: 450 | ||
| toc: true | ||
| nd-keywords: "security monitoring, troubleshooting, local data plane, nginx-agent, opentelemetry collector, secops_dashboard, WAF events" | ||
| nd-summary: > | ||
| Use this guide when F5 WAF for NGINX security events do not appear in the NGINX One Console security dashboard even after you complete the setup flow. | ||
| It walks through the local data plane checks for invalid log profiles, missing OpenTelemetry log pipelines, and debug logging. | ||
| These checks help confirm whether NGINX Agent is receiving, parsing, and forwarding security events correctly. | ||
| nd-audience: operator | ||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| Use this guide when you completed [Set up security monitoring]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/set-up-security-monitoring.md" >}}), sent test traffic, and still do not see F5 WAF for NGINX security events in the NGINX One Console dashboard. | ||
|
|
||
| This guide focuses on the **local data plane**. It helps you verify four things: | ||
|
|
||
| 1. Whether the embedded OpenTelemetry Collector is dropping security logs because the deployed log profile format is wrong. | ||
| 2. Whether the NGINX Agent embedded OpenTelemetry Collector is the only process listening on port `1514`. | ||
| 3. Whether the NGINX agent generated OpenTelemetry Collector config has the expected security log pipeline. | ||
| 4. Whether debug logging shows the collector forwarding security logs to NGINX One Console. | ||
|
|
||
| --- | ||
|
|
||
| ## Before you begin | ||
|
|
||
| Before you begin, ensure you have: | ||
|
|
||
| - Access to the data plane host where NGINX Plus, F5 WAF for NGINX, and NGINX Agent are running. | ||
| - Permission to read `/var/log/nginx-agent/` and `/etc/nginx-agent/`. | ||
| - Security monitoring already configured by following [Set up security monitoring]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/set-up-security-monitoring.md" >}}). | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Check for invalid log profile errors | ||
|
|
||
| Check whether NGINX Agent's embedded OpenTelemetry Collector is rejecting incoming F5 WAF for NGINX security logs. This happens when the logs don't match the format the security monitoring pipeline expects. | ||
|
|
||
| Open the collector log on the data plane: | ||
|
|
||
| ```shell | ||
| sudo tail -f /var/log/nginx-agent/opentelemetry-collector-agent.log | ||
| ``` | ||
|
|
||
| Look for either of the following errors: | ||
|
|
||
| ```text | ||
| Security violation log body is not a string. All security violation logs will be dropped until the collector is restarted. | ||
| ``` | ||
|
|
||
| ```text | ||
| Security violation log does not appear to be CSV format. Ensure the NAP logging profile uses the secops-dashboard-log format. All security violation logs will be dropped until the collector is restarted. | ||
| ``` | ||
|
|
||
| If you see either message, the data plane probably isn't using the NGINX One Console default `secops_dashboard` log profile for `app_protect_security_log`. Make sure every http, server, or location block that should log violations uses this profile. | ||
|
|
||
| ### Fix | ||
|
|
||
| 1. In NGINX One Console, redeploy the default [`secops_dashboard` log profile]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/default-log-profile.md" >}}) to the affected instance. | ||
| 2. Update the NGINX configuration so `app_protect_security_log` points to that deployed bundle. | ||
| 3. Restart NGINX Agent to reset the embedded OpenTelemetry Collector after you correct the log profile. | ||
|
|
||
| After the restart, send a new test request and check the dashboard again. | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Check that port `1514` is reserved for the collector | ||
|
|
||
| F5 WAF for NGINX sends security logs to `syslog:server=127.0.0.1:1514`. If another process is listening on port `1514`, the NGINX Agent embedded OpenTelemetry Collector may never receive the security logs. | ||
|
|
||
| Run the following command on the data plane: | ||
|
|
||
| ```shell | ||
| sudo ss -ltnp | grep 1514 | ||
| ``` | ||
|
|
||
| Confirm that no unexpected process is listening on port `1514`. If another service is bound to that port, stop or reconfigure it. The embedded collector needs port `1514` free to receive F5 WAF for NGINX security logs. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Verify the generated OpenTelemetry log pipeline | ||
|
|
||
| If the collector log does **not** show either invalid-log-profile error, verify that the generated OpenTelemetry Collector config still contains the security log pipeline. | ||
|
|
||
| {{< call-out "note" >}}NGINX Agent generates this security log pipeline only when at least one `http`, `server`, or `location` block is set up with `app_protect_security_log` pointing to `syslog:server=127.0.0.1:1514`. If no protected context uses that syslog destination, the pipeline isn't generated. Without it, no WAF security logs are forwarded to NGINX One Console.{{< /call-out >}} | ||
|
|
||
| Open the generated collector config: | ||
|
|
||
| ```shell | ||
| sudo grep -A 12 "logs/default:" /etc/nginx-agent/opentelemetry-collector-agent.yaml | ||
| ``` | ||
|
|
||
| Confirm it includes the following pipeline: | ||
|
|
||
| ```yaml | ||
| logs/default: | ||
| receivers: | ||
| - tcplog/nginx_app_protect | ||
| processors: | ||
| - securityviolationsfilter/default | ||
| - batch/default_logs | ||
| - resource/default | ||
| exporters: | ||
| - otlp/default | ||
| ``` | ||
|
|
||
| This pipeline accepts F5 WAF for NGINX security logs from `tcplog/nginx_app_protect`. It filters and batches the logs, then exports them to NGINX One Console through `otlp/default`. | ||
|
|
||
| If this pipeline is missing or materially different, the collector isn't set up as expected for security monitoring. In that case, review any custom collector configuration merged through `nginx-agent.conf`, then restart NGINX Agent so it regenerates the collector config. | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Enable debug logging for the collector pipeline | ||
|
|
||
| If the collector log doesn't show the invalid-log-profile errors and the generated pipeline looks correct, turn on debug logging. This lets you confirm the embedded collector is processing and forwarding security logs. | ||
|
|
||
| Add the following configuration to the end of `/etc/nginx-agent/nginx-agent.conf`: | ||
|
|
||
| ```yaml | ||
| collector: | ||
| exporters: | ||
| debug: {} | ||
| pipelines: | ||
| logs: | ||
| default: | ||
| receivers: | ||
| - tcplog/nginx_app_protect | ||
| processors: | ||
| - securityviolationsfilter/default | ||
| - batch/default_logs | ||
| exporters: | ||
| - otlp/default | ||
| - debug | ||
| ``` | ||
|
|
||
| Restart NGINX Agent so the updated collector configuration is applied. | ||
|
|
||
| The `debug` exporter causes the embedded OpenTelemetry Collector to write its processed log output to: | ||
|
|
||
| ```text | ||
| /var/log/nginx-agent/opentelemetry-collector-agent.log | ||
| ``` | ||
|
|
||
| Use this to confirm the collector is handling F5 WAF for NGINX security events locally. It continues forwarding them to NGINX One Console through `otlp/default`. | ||
|
|
||
| {{< call-out "note" >}}The debug exporter increases log volume. Remove it after troubleshooting so the collector log returns to its normal verbosity.{{< /call-out >}} | ||
|
|
||
| --- | ||
|
|
||
| ## What to do next | ||
|
|
||
| After each fix: | ||
|
|
||
| 1. Restart NGINX Agent. | ||
| 2. Send a new test request through the protected application path. For example requests, see [Example test requests for a default blocking policy]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/set-up-security-monitoring.md#example-test-requests-for-a-default-blocking-policy" >}}). | ||
| 3. Check `/var/log/nginx-agent/opentelemetry-collector-agent.log`. | ||
| 4. Recheck the **WAF** > **Security Dashboard** and **Event Logs** tab in NGINX One Console. | ||
|
|
||
| If the collector is processing events locally but the dashboard remains empty, gather the following and provide them to F5 support: | ||
|
|
||
| - NGINX Agent configuration: `/etc/nginx-agent/nginx-agent.conf` | ||
| - Generated OpenTelemetry Collector configuration: `/etc/nginx-agent/opentelemetry-collector-agent.yaml` | ||
| - NGINX Agent log: `/var/log/nginx-agent/agent.log` | ||
| - Embedded OpenTelemetry Collector log: `/var/log/nginx-agent/opentelemetry-collector-agent.log` | ||
|
|
||
| --- | ||
|
|
||
| ## References | ||
|
|
||
| For more information, see: | ||
|
|
||
| - [Set up security monitoring]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/set-up-security-monitoring.md" >}}) | ||
| - [secops_dashboard log profile]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/default-log-profile.md" >}}) | ||
| - [Security dashboard reference]({{< ref "/nginx-one-console/waf-integration/waf-security-dashboard/dashboard-metrics-reference.md" >}}) | ||
| - [Export NGINX instance metrics]({{< ref "/nginx-one-console/agent/configure-otel-metrics.md" >}}) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.