TMA-NGINX-2.4.4
Ensure send_timeout is set to 10 seconds or less, but not 0
MittelStufe 1Automatisiertnginx
Beschreibung
The send_timeout directive sets a timeout for transmitting a response to the client between two successive write operations. Every send_timeout must be between 1 and 10 seconds and the directive must be set (default 60s). Evaluated on the merged configuration printed by `nginx -T` (all included files; needs permission to read them). CIS marks this recommendation Manual; the automated check implements its audit procedure.
So wird geprüft
Prüfmethode: Shell-Befehl
shell
out=$(nginx -T 2>/dev/null) || exit 1; printf '%s\n' "$out" | awk '{l=$0; o=""; q=""; for(i=1;i<=length(l);i++){c=substr(l,i,1); if(q!=""){o=o c; if(c==q) q=""; continue} if(c=="\""||c=="\047"){q=c; o=o c; continue} if(c=="#") break; if(c==";"||c=="{"){print o c; o=""; continue} if(c=="}"){if(o~/[^[:space:]]/) print o; print "}"; o=""; continue} o=o c} if(o~/[^[:space:]]/) print o}' | awk 'function a(i, x){x=$i; sub(/;$/,"",x); gsub(/["\047]/,"",x); return x} function inb(n, i){for(i=1;i<=sp;i++) if(st[i]==n) return 1; return 0} ($1=="send_timeout"){v=a(2); m=1; if(v~/m$/) m=60; sub(/[ms]$/,"",v); seen[$1]=1; if(v*m<1||v*m>10) bad=1} {o=gsub(/\{/,"{"); c=gsub(/\}/,"}"); while(o-->0){sp++; b=$1; sub(/\{.*/,"",b); st[sp]=b} while(c-->0 && sp>0) sp--} END{print (seen["send_timeout"]&&!bad)?"compliant":"noncompliant"}'- Erwartete Ausgabe
compliant
So wird behoben
Behebungsmethode: Anleitung oder Infrastruktur-Patch
Set 'send_timeout 10;' in the http block. Then run nginx -t and reload nginx.
Eigenschaften
- Betriebssysteme
- Beliebig
- Tags
- nginxdos
- Referenz
- CIS NGINX Benchmark v3.0.0 - 2.4.4 Ensure send_timeout is set to 10 seconds or less, but not 0
Diesen Host prüfen
Führen Sie dies auf einem Rechner aus, den Sie prüfen dürfen. Der Scan ist schreibgeschützt.
shell
tmaegis scan --target nginx