@@ -86,6 +86,31 @@ passed to the authorization plugins. For commands that return chunked HTTP
8686response, such as ` logs ` and ` events ` , only the HTTP request is sent to the
8787authorization plugins.
8888
89+ ### Response body size and partial buffering
90+
91+ The internal buffer that holds the response body between the daemon's HTTP
92+ handler and the plugin's response authorization callback (` responseModifier ` ,
93+ defined in [ ` pkg/authorization/response.go ` ] ( https://github.com/moby/moby/blob/master/pkg/authorization/response.go ) )
94+ has a fixed capacity of 64 KiB (` maxBufferSize ` ).
95+
96+ For most non-streaming endpoints the full response is buffered for plugin
97+ inspection regardless of total size, because Go's ` encoding/json ` encoder
98+ serializes the complete payload into a single underlying write. The
99+ streaming-response exclusion noted above (for example, ` logs ` and ` events ` )
100+ is the practical effect of this 64 KiB threshold combined with the
101+ ` io.WriteFlusher ` write pattern used by streaming handlers, where each write
102+ is immediately drained to the client and is therefore no longer available
103+ for plugin inspection by the time the handler returns.
104+
105+ > [ !NOTE]
106+ > Plugins that depend on ` ResponseBody ` inspection for redaction or
107+ > content-filtering should restrict their policies to endpoints whose
108+ > response is produced as a single write (typical of REST-style API
109+ > responses). For commands whose responses are streamed or are likely to
110+ > exceed the buffer through multiple writes, do not rely on ` ResponseBody `
111+ > for security-relevant decisions; perform the filtering in a separate
112+ > layer in front of the daemon.
113+
89114During request/response processing, some authorization flows might
90115need to do additional queries to the Docker daemon. To complete such flows,
91116plugins can call the daemon API similar to a regular user. To enable these
0 commit comments