TMAegisベータ
nginx のその他のルール

NGINX

TMA-NGINX-4.1.5

Disable weak ciphers

高レベル 1自動nginx

説明

The ssl_protocols directive must be used to disable weak protocols and exclusively enable TLS 1.3. In a TLS 1.3-only configuration, the ssl_ciphers directive is no longer necessary, as the protocol itself mandates a small, non-negotiable set of highly secure AEAD ciphers (Authenticated Encryption with Associated Data). Per the benchmark audit, weak ciphers are excluded by allowing only TLS 1.3: every ssl_protocols directive must be exactly TLSv1.3. 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.

チェック方法

監査方法: シェルコマンド

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=="ssl_protocols"{n++; if(NF!=2 || a(2)!="TLSv1.3") 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 (n>0&&!bad)?"compliant":"noncompliant"}'
期待される出力
compliant

修正方法

修正方法: ガイダンスまたは IaC パッチ

Set 'ssl_protocols TLSv1.3;' (ssl_ciphers is then not needed) and 'ssl_prefer_server_ciphers off;'. Then run nginx -t and reload nginx.

プロパティ

オペレーティングシステム
すべて
タグ
nginxtls
参照
CIS NGINX Benchmark v3.0.0 - 4.1.5 Disable weak ciphers

このホストをチェック

監査が許可されているマシンで実行してください。スキャンは読み取り専用です。

shell
tmaegis scan --target nginx