Skip to content

Conversation

aphralG
Copy link
Contributor

@aphralG aphralG commented Oct 3, 2025

Proposed changes

Added syslog server port option in agent config

syslog_server:
    port: 1514

Default value is 1514, agent will parse the NGINX config for Nap syslog server directives, when one is found agent will check if the host is valid and then check if the port matches the configured syslog server port in the config (or default if not set)
If the agent fails to find a valid syslog server it will log the following warning, which contains the configured port

level=WARN msg="Could not find available local NGINX App Protect syslog server configured on port 565. Security violations will not be collected."

Changed NapSyslogServers in NginxConfigContext to a single value as we no longer allow multiple syslog servers.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@aphralG aphralG self-assigned this Oct 3, 2025
@aphralG aphralG requested a review from a team as a code owner October 3, 2025 12:39
@github-actions github-actions bot added the chore Pull requests for routine tasks label Oct 3, 2025
napSyslogServersMap := make(map[string]bool)
for _, server := range napSyslogServers {
napSyslogServersMap[server] = true
func (oc *Collector) findAvailableSyslogServers(ctx context.Context, napSyslogServer string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func (oc *Collector) findAvailableSyslogServers(ctx context.Context, napSyslogServer string) string {
func (oc *Collector) findAvailableSyslogServer(ctx context.Context, napSyslogServer string) string {

fs.String(
SyslogServerPort,
DefSyslogServerPort,
"The port Agent will start the syslog server for Nginx App Protect Security violations on",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"The port Agent will start the syslog server for Nginx App Protect Security violations on",
"The port Agent will start the syslog server on for logs collection",

Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.98%. Comparing base (383ce95) to head (b6501d8).

Files with missing lines Patch % Lines
internal/collector/otel_collector_plugin.go 83.33% 2 Missing and 1 partial ⚠️
internal/model/config.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
+ Coverage   84.88%   84.98%   +0.10%     
==========================================
  Files         100      100              
  Lines       14520    14522       +2     
==========================================
+ Hits        12325    12342      +17     
+ Misses       1734     1717      -17     
- Partials      461      463       +2     
Files with missing lines Coverage Δ
internal/config/config.go 85.70% <100.00%> (+0.13%) ⬆️
internal/config/defaults.go 100.00% <ø> (ø)
internal/config/flags.go 100.00% <ø> (ø)
internal/config/types.go 85.41% <ø> (ø)
internal/datasource/config/nginx_config_parser.go 79.08% <100.00%> (-0.28%) ⬇️
internal/model/config.go 88.67% <0.00%> (ø)
internal/collector/otel_collector_plugin.go 81.97% <83.33%> (-0.19%) ⬇️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 383ce95...b6501d8. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Akshay2191 Akshay2191 self-requested a review October 14, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants