feat(appsec): contrib/labstack/echo.v4 transparent response body analysis#3578
Conversation
BenchmarksBenchmark execution time: 2025-06-06 12:39:16 Comparing candidate commit 0403c7d in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 21 metrics, 0 unstable metrics. |
9950270 to
9179334
Compare
998d77d to
39ae9eb
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
eliottness
left a comment
There was a problem hiding this comment.
The Bind issue make this problematic from a security standpoint. We can either remove it for now or find another access point to call our SDK.
Sidenote: Not sure calling the public SDK inside the contribs make sense especially since we want to put special telemetry for the SDK and the same MonitorHTTPResponseBody and MonitorParsedHTTPBody are available in instrumentation/appsec/httpsec
| func (c appsecContext) XML(code int, i any) error { | ||
| if err := appsec.MonitorHTTPResponseBody(c.Request().Context(), i); err != nil { | ||
| return err | ||
| } | ||
| return c.Context.XML(code, i) | ||
| } | ||
|
|
||
| func (c appsecContext) XMLPretty(code int, i any, indent string) error { | ||
| if err := appsec.MonitorHTTPResponseBody(c.Request().Context(), i); err != nil { | ||
| return err | ||
| } | ||
| return c.Context.XMLPretty(code, i, indent) | ||
| } |
There was a problem hiding this comment.
These should probably come with a small rework of this function to support xml struct tags
There was a problem hiding this comment.
a6e04f2 to
c3b7c4c
Compare
c3b7c4c to
1d762c1
Compare

What does this PR do?
Automatically collect HTTP response body information in the echo contrib.
Motivation
Provides improved coverage for AAP features such as the API catalog response schemas & data classification.
Reviewer's Checklist
golangci-lint runlocally.Unsure? Have a question? Request a review!