-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
httpjson: Chain request tracer filename sanitization #37551
Labels
Comments
botelastic
bot
added
the
needs_team
Indicates that the issue/PR needs a Team:* label
label
Jan 5, 2024
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
botelastic
bot
removed
the
needs_team
Indicates that the issue/PR needs a Team:* label
label
Jan 5, 2024
kcreddy
changed the title
httpjson: Chain tracer filename sanitization
httpjson: Chain request tracer filename sanitization
Jan 5, 2024
4 tasks
Alternative proposal: diff --git a/x-pack/filebeat/input/httpjson/input.go b/x-pack/filebeat/input/httpjson/input.go
index 928c056d2d..28f5e0c112 100644
--- a/x-pack/filebeat/input/httpjson/input.go
+++ b/x-pack/filebeat/input/httpjson/input.go
@@ -122,6 +122,15 @@ func run(ctx v2.Context, cfg config, pub inputcursor.Publisher, crsr *inputcurso
if cfg.Request.Tracer != nil {
id := sanitizeFileName(ctx.ID)
cfg.Request.Tracer.Filename = strings.ReplaceAll(cfg.Request.Tracer.Filename, "*", id)
+ // Propagate tracer behaviour to all chain children.
+ for i, c := range cfg.Chain {
+ if c.Step != nil { // Request is validated as required.
+ cfg.Chain[i].Step.Request.Tracer = cfg.Request.Tracer
+ }
+ if c.While != nil { // Request is validated as required.
+ cfg.Chain[i].While.Request.Tracer = cfg.Request.Tracer
+ }
+ }
}
metrics := newInputMetrics(reg) |
Merged
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, for each chain step request, we can add request tracer enabled by following config:
But, the filename sanitization only occurs on the base/parent tracer as per https://github.com/elastic/beats/blob/main/x-pack/filebeat/input/httpjson/input.go#L122-L125.
Use file sanitization on chain request/response tracer.
The text was updated successfully, but these errors were encountered: