moby--moby/api/server
Sebastiaan van Stijn 55fd77f724
set ReadHeaderTimeout to address G112: Potential Slowloris Attack (gosec)
After discussing in the maintainers meeting, we concluded that Slowloris attacks
are not a real risk other than potentially having some additional goroutines
lingering around, so setting a long timeout to satisfy the linter, and to at
least have "some" timeout.

    libnetwork/diagnostic/server.go:96:10: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
        srv := &http.Server{
            Addr:    net.JoinHostPort(ip, strconv.Itoa(port)),
            Handler: s,
        }
    api/server/server.go:60:10: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
                srv: &http.Server{
                    Addr: addr,
                },
    daemon/metrics_unix.go:34:13: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
            if err := http.Serve(l, mux); err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
                      ^
    cmd/dockerd/metrics.go:27:13: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
            if err := http.Serve(l, mux); err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-22 12:13:28 +02:00
..
backend/build API: add "prune" events 2020-07-28 12:41:14 +02:00
httpstatus errdefs: move GetHTTPErrorStatusCode to api/server/httpstatus 2022-03-21 12:22:39 +01:00
httputils api/server/httputils: move WriteJSON() together with ReadJSON() 2022-04-11 21:37:57 +02:00
middleware api: add const for 'X-Registry-Auth' 2022-07-29 23:04:34 +02:00
router ImageService.GetImage(): pass context 2022-09-07 16:53:45 +02:00
errorhandler.go errdefs: move GetHTTPErrorStatusCode to api/server/httpstatus 2022-03-21 12:22:39 +01:00
middleware.go api/server: remove "Logging" from config 2022-04-23 23:38:30 +02:00
server.go set ReadHeaderTimeout to address G112: Potential Slowloris Attack (gosec) 2022-09-22 12:13:28 +02:00
server_test.go api/server: use constants for http methods 2019-10-13 17:30:19 +02:00