feat: additional NATS auth options#1315
feat: additional NATS auth options#1315mfreeman451 wants to merge 4 commits intofalcosecurity:masterfrom
Conversation
|
Welcome @mfreeman451! It looks like this is your first PR to falcosecurity/falcosidekick 🎉 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mfreeman451 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Michael Freeman <mfreeman451@gmail.com>
Signed-off-by: Michael Freeman <mfreeman451@gmail.com>
Signed-off-by: Michael Freeman <mfreeman451@gmail.com>
Signed-off-by: Michael Freeman <mfreeman451@gmail.com>
85c168f to
11e0dcb
Compare
|
/kind feature |
|
/area outputs |
|
|
||
| hostPort := strings.TrimSpace(config.Nats.HostPort) | ||
| tlsRequested := cfg.MutualTLS || !cfg.CheckCert || config.TLSClient.CaCertFile != "" || | ||
| strings.HasPrefix(hostPort, "natss://") || strings.HasPrefix(hostPort, "tls://") |
|
|
||
| hostPort := strings.TrimSpace(config.Nats.HostPort) | ||
| tlsRequested := cfg.MutualTLS || !cfg.CheckCert || config.TLSClient.CaCertFile != "" || | ||
| strings.HasPrefix(hostPort, "natss://") || strings.HasPrefix(hostPort, "tls://") |
There was a problem hiding this comment.
| strings.HasPrefix(hostPort, "natss://") || strings.HasPrefix(hostPort, "tls://") | |
| strings.HasPrefix(hostPort, "tls://") |
natss:// is not a standard NATS URI scheme. The NATS Go client recognizes nats:// and tls://. While our NewClient regex happens to accept natss://, using it here as a TLS trigger could confuse users into thinking it's supported.
What was the intent behind natss://? If it's for symmetry with https://, could we just document tls:// as the way to enable TLS?
| } | ||
|
|
||
| func validateNatsAuthFile(path, configKey string) error { | ||
| _, err := os.ReadFile(path) |
There was a problem hiding this comment.
| _, err := os.ReadFile(path) | |
| _, err := os.Stat(path) |
os.ReadFile loads the entire file into memory just to check if it's readable. os.Stat would be sufficient here and is the pattern used elsewhere in the codebase (e.g., outputs/logstash.go:45).
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Nit: extra blank line before the closing brace.
| } | |
| } | |
| } | |
| } |
What type of PR is this?
Any specific area of the project related to this PR?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1316
Special notes for your reviewer: