Mais conteúdo relacionado
Semelhante a NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法! (20)
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
- 5. ©2023 F5
5
5
DELIVERING MODERN APPLICATIONS AT SCALE ACROSS SEAMLESSLY ACROSS MULTI-CLOUD
NGINX Plus
All-In-One Software
ロードバランサー、コンテンツキャッシュ、
Webサーバ
安定、高速、高機能
必要となるリソースは最小
NGINX
Management Suite
NGINX+統合管理ソフトウェア
NGINX+のロードバランサやAPI
Gateway、更にマルチクラウド環境に
おいても容易に管理が可能。
GUI/CLIに加えAPIでの制御が可能
NGINX App Protect
アプリケーションに特化した
Web Application Firewall
NGINX+にシームレスに統合可能な
新しいWAF。 F5の実績に基づき、
高速な高品質なWAFを実現
High quality Support
NGINX 製品
- 6. ©2023 F5
6
6
DELIVERING MODERN APPLICATIONS AT SCALE ACROSS SEAMLESSLY ACROSS MULTI-CLOUD
NGINX 製品
NGINX Service Mesh
NGINX Plusで複雑な
マイクロサービス、アプリケーション間の
通信問題を解決するシンプルな
サービスメッシュソリューション。
Amazon EKS, Azure AKS対応
NGINX Ingress
Controller
Kubernetes環境への
外部アクセスをコントロール。
NGINX機能をIngressリソース
を通じて管理可能。
NGINX App Protect対応
High quality Support
NGINX Instance
Manager
NGINX OSS、NGINX Plusを管理。
簡易なヒストリカルなトラフィック・
ステータス情報やコンフィグファイル
管理を提供。ネットワーク内をスキャンし
NGINXインスタンスの検出も可能
- 7. ©2023 F5
7
7
Web
KIC
SP MS
SP MS
L7
LB
NGINX Plus
NGINX
Controller
NGINX Plus
Web server
NGINX Unit
App server
CODE CUSTOMER
App
NGINX Product Portfolio
L4-L7 LB
API GW
Per app WAF
高速・高品質 Web Server
Web Application Server
NGINX Plus
Sidecar proxy
SP MS
高頻度のアプリケーションリリースを実現する、
高い柔軟性・効率・品質のアプリケーション基盤
Container Ingress
Service
Service Mesh
L7
LB
Revese Proxy /Cache
/ API GW / Per app WAF
MONOLOTHIC
MICROSERVICES
NGINX Plus
K8s IC
CI/CD
DevSecOps
NGINX
Instance
Manager
- 10. ©2023 F5
10
10
Web
KIC
SP MS
NGINX Plus
CODE
App
NGINXによる高度なセキュリティの実現
NGINX Plus
Sidecar proxy
SP MS
L7
LB
MONOLOTHIC
MICROSERVICES
NGINX Plus
CUSTOMER
DDoS
Web脆弱性
ユーザ認証
機密
データ
認証
データ
- 16. ©2023 F5
16
16
DDoS攻撃の概要 / Rate Limitの概要
• インターネットに展開されるアプリケーションは常に攻撃者のターゲットになる可能性がある
• DDoS攻撃(Distributed Denial of Service attack/分散型サービス妨害攻撃)は対象の
サービスに、通常をはるかに超えるトラフィックを送信することにより、サービスの停止などを目的とする
• 具体的な被害としては、トラフィック増大によるネットワークの遅延、サービスの停止、アプリケーションの高
負荷による想定外の動作などが引き起こされる
• 通常の利用時に想定される通信量を超える大きな通信が発生した場合には、Rate Limitを用いて応
答の遅延や、余分な通信を拒否することにより不要なトラフィックを減らし、プラットフォーム全体の可用
性を向上させる
DDoS
攻撃
対策
- 17. ©2023 F5
17
17
Rate Limit 設定例
• httpコンテキスト内でlimit_req_zone directiveを用いて共有メモリやRate Limitの条件をパラメータで指定
• 対象となる通信に対しlimit_req指定しレート制限を有効にする
http {
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
server {
listen 80;
location / {
limit_req zone=req;
proxy_pass http://my_backend;
}
}
}
- 18. ©2023 F5
18
18
limit_req_zone / limit_req Directive
• 書式:limit_req_zone <key> zone=<共有メモリ名>:<共有メモリサイズ> rate=<制限するレート>;
• <key>:レート制限を行う通信を識別する条件。例えば、クライアントIPを識別の条件としてレー
ト制限を実行する場合、$binary_remote_addr変数を指定する。この場合、それぞれのユニー
クなIPアドレスからのリクエストに対しrateのパラメータで指定したレート制限を実施する
• zone:レート制限のステータスを保持する共有メモリを指定する。この共有メモリを用いて、
NGINXのワーカプロセス間でステータスをシェアする
• rate:レート制限を行うためのレートの最大値を指定する。NGINXでは各リクエストについて指定
した値のレートで通信が行われているかミリ秒単位での評価を行う
• 書式:limit_req zone=<共有メモリ名> ;
• <共有メモリ名>:limit_req_zoneで予め作成した、共有メモリ名を指定
- 19. ©2023 F5
19
19
Rate Limit 設定例:rate
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
server {
listen 80;
location / {
limit_req zone=req;
proxy_pass http://my_backend;
}
1sec 1sec
503
$remote_addr:192.168.1.1
rate 1r/sを超える
リクエストを拒否
- 20. ©2023 F5
20
20
Rate Limit 設定例:burst
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
server {
listen 80;
location / {
limit_req zone=req burst=2;
proxy_pass http://my_backend;
}
$remote_addr:192.168.1.1
指定したレートを超える通信を、burstで
指定した数だけキューイング
1sec 1sec
503
rate 1r/sを超えるリクエストの内、burstで
指定した数は指定したレート(1r/s)で転送
すでにburstで指定した数キューイングした状態で
新たなリクエストを受けた場合リクエストを拒否
1sec
- 21. ©2023 F5
21
21
Rate Limit 設定例:nodelay
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
server {
listen 80;
location / {
limit_req zone=req burst=2 nodelay;
proxy_pass http://my_backend;
}
$remote_addr:192.168.1.1
1sec
503
burstでキューイングしたリクエスト
を即座に転送
burstで指定した数を超える
リクエストを拒否
- 22. ©2023 F5
22
22
Rate Limit 設定例:delay
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
server {
listen 80;
location / {
limit_req zone=req burst=2 delay=1;
proxy_pass http://my_backend;
}
$remote_addr:192.168.1.1
1sec
503
1sec
burstでキューイングしたリクエストの内、burst数から
delay数を引いた数は、指定したレート(1r/s)で転送
burstで指定した数を超える
リクエストを拒否
delayで指定した数
は即座に転送
- 23. ©2023 F5
23
23
•access_log – NGINX宛の通信の詳細を出力
• log_format directiveを用いて出力する情報を設定
•error_log – NGINXが出力するメッセージ
• level というパラメータにて情報の詳細さを設定
Error & Access Logs
TIPS
- 24. ©2023 F5
24
24
• リクエストの拒否
Rate Limit ログ
==> /var/log/nginx/error.log <==
2020/04/01 00:35:48 [error] 22149#22149: *4744 limiting requests, excess: 3.000 by zone "req", client:
10.10.10.32, server: , request: "GET / HTTP/1.0", host: "10.10.10.1"
==> /var/log/nginx/access.log <==
10.10.10.32 - - [01/Apr/2020:00:35:48 +0900] "GET / HTTP/1.0" 503 197 "-" "ApacheBench/2.3"
• burstによるDelay
==> /var/log/nginx/error.log <==
2020/04/01 00:35:48 [warn] 22149#22149: *4743 delaying request, excess: 2.000, by zone "req", client:
10.10.10.32, server: , request: "GET / HTTP/1.0", host: "10.10.10.1"
==> /var/log/nginx/access.log <==
10.10.10.32 - - [01/Apr/2020:00:35:49 +0900] "GET / HTTP/1.0" 200 68 "-" "ApacheBench/2.3"
• リクエストが指定のZone(条件)でリミットに到達し、503を応答している
• リクエストが指定のZone(条件)でリミットに到達し、burstにより応答を遅らせている
- 25. ©2023 F5
25
25
Rate Limit 動作確認
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
limit_req zone=req;
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
limit_req zone=req burst=2 nodelay;
limit_req_zone $remote_addr zone=req:1M rate=1r/s;
limit_req zone=req burst=2 nodelay;
limit_req_dry_run on;
Rate Limit
1
2
3
https://f5j-nginx-plus-lab2.readthedocs.io/en/latest/class1/module02/module02.html#ratelimit
- 26. ©2023 F5
26
26
Rate Limit 設定 応用編
geo $limit {
default 1;
10.0.0.0/8 0;
192.168.0.0/24 0;
}
map $limit $limit_key {
0 "";
1 $binary_remote_addr;
}
limit_req_zone $limit_key zone=req_zone:10m rate=5r/s;
server {
location / {
limit_req zone=req_zone burst=10 nodelay;
# ...
}
}
送信元IPアドレスに応じて
limitの変数に値をセット
limitの値に応じて
limit_keyの変数に値をセット
limit_keyがブランクの場合、
Rate Limitを実施しない
- 27. ©2023 F5
27
27
• limit_req_dry_run
• limit_req_log_level
• limit_req_status
その他 Rate Limit 関連Directive
https://nginx.org/en/docs/http/ngx_http_limit_req_module.html?#limit_req_zone
- 30. ©2023 F5
30
30
OpenID Connect 設定方法
• NGINXが提供するGitHubからスクリプトと設定サンプルを取得します
• 手順にしたがって設定する事により容易に環境の構築が可能です
https://github.com/nginxinc/nginx-openid-connect
- 31. ©2023 F5
31
31
OpenID Connect 設定方法
• 大まかな設定順序
NGINXと連携する認可サーバの準備
NGINXが提供する設定ガイド:
ActiveDirectory Federation Service
Amazon Congnito
Keycloak
Okta
OneLogin
PingFederate and PingOne for Enterprise
https://docs.nginx.com/nginx/deployment-guides/single-
sign-on/active-directory-federation-services/
NGINX Plusを動作させるホストにて対象のGithub
repositoryからファイルを取得
シェルスクリプトを実行し、認可サーバのOpenID
Connect設定を取得。一部コンフィグファイルを動作
環境に合わせて修正
NGINX Plusの設定
認可サーバの設定
0
1
2
- 32. ©2023 F5
32
32
OpenID Connect 設定例
root@ubuntu:/etc/nginx/conf.d# git clone https://github.com/nginxinc/nginx-openid-connect
root@ubuntu:/etc/nginx/conf.d/nginx-openid-connect# ./configure.sh
http://172.28.14.135:8080/auth/realms/master/.well-known/openid-configuration
configure.sh: NOTICE: Downloading ./idp_jwk.json
configure.sh: NOTICE: Configuring ./frontend.conf ... no change
configure.sh: NOTICE: Configuring ./openid_connect_configuration.conf
configure.sh: NOTICE: - $oidc_authz_endpoint ... ok
configure.sh: NOTICE: - $oidc_token_endpoint ... ok
configure.sh: NOTICE: - $oidc_jwt_keyfile ... ok
configure.sh: NOTICE: - $oidc_hmac_key ... ok
configure.sh: NOTICE: - $oidc_pkce_enable ... ok
configure.sh: NOTICE: Success - test configuration with 'nginx -t'
1
2
- 33. ©2023 F5
33
33
OpenID Connect 設定例
# ファイルのコピー
root@ubuntu:/etc/nginx/conf.d/nginx-openid-connect# cp frontend.conf ../
root@ubuntu:/etc/nginx/conf.d/nginx-openid-connect# cp idp_jwk.json ../
root@ubuntu:/etc/nginx/conf.d/nginx-openid-connect# cp openid_connect_configuration.conf ../
root@ubuntu:/etc/nginx/conf.d/nginx-openid-connect# cp openid_connect.js ../
root@ubuntu:/etc/nginx/conf.d/nginx-openid-connect# cp openid_connect.server_conf ../
# ファイルの修正
# openid_connect_configuration.conf 内、$oidc_clientと$oidc_client_secretに値を入力
# frontend.conf 内、OIDC接続後の転送先など指定
3
4
- 34. ©2023 F5
34
34
• nginx-plus-module-njs をインストールし、nginx.conf
の先頭でモジュールをロード
• http blockでconf.d配下の*.confファイルをinclude
OpenID Connect 設定ファイルの関連性
nginx/
conf.d/
nginx.conf
frontend.conf
• OIDC ConnectのRelying Partyとして外部に公開する
サービスの設定
• 外部に公開するサービスの先頭で
”conf.d/openid_connect.server_conf”をinclude
openid_connect_configuration.conf
• OIDC ConnectのRelying Partyとして外部に認可サーバ
と連携する際に必要となるパラメータの設定・管理
• 設定ファイル末尾で、js_import directiveを用いて
“conf.d/openid_connect.js”をインポート
openid_connect.server_conf
• OIDC ConnectのRelying Partyとして外部に認可サーバ
と連携するために必要となる、OIDCのCode Exchangeな
ど、各種URLと設定を提供する。
• 処理内容に応じて、 js_content directiveを用いて、
openid_connect.jsで定義した関数を用いる
openid_connect.js
• OIDC ConnectのRelying Partyとして外部に認可サーバ
と連携するために必要となる、認証機能などをNJSによる機
能拡張で実現する
http block
OIDC JS機能拡張
OIDC URL・機能
OIDC パラメータ
サービス・プロキシ
Include / Import
機能・設定の参照
- 35. ©2023 F5
35
35
OIDC 設定例:auth_jwt / auth_jwt_claim_set
• frontend.confや、openid_connect.server_conf, openid_connect_configuration.confで利用さ
れているDirective
# frontend.confの例
auth_jwt "" token=$session_jwt;
• 書式:auth_jwt <relam> [token=$variable]
• JSON Web Tokenのvalidationを有効にする
• tokenにはJSON Web Tokenを含む値を指定する。CookieやHTTP Headerなど
openid_connect.jsで
id_token内容を変数に格納
# openid_connect_configuration.confの例
auth_jwt_claim_set $jwt_audience aud
• 書式:auth_jwt_claim_set $variable <名称>
• JWT Claimに指定した名称で変数の内容を指定する
audにjwt_audienceの内容を
格納
- 36. ©2023 F5
36
36
OpenID Connect 動作確認
OIDCのRelying Party
として動作
認可サーバ
1
2
3
クライアントブラウザからアプリケーションに接続。
OIDCのRelying Partyとして動作するNGINXが認可サーバへリダイレクト
1
認可サーバ(Keycloak)でユーザの認証。正しく認証できたたことを確認
し、再度NGINXへリダイレクト
2
NGINXでユーザを評価。正しいユーザで有ることを確認し、アプリケーション
へリクエストを転送
3
https://f5j-nginx-plus-lab2.readthedocs.io/en/latest/class1/module03/module03.html#oidc
- 37. ©2023 F5
37
37
• NGINX Plusを用いてOpenID ConnectのRPとして動作させる方法を確認
• NGINXが提供するGitHubのサンプルコードを用いて設定する方法を確認
Module Summary
- 43. ©2023 F5
43
43
NGINX App Protectの設定例:基本設定
load_module modules/ngx_http_app_protect_module.so;
http {
server {
listen 80;
app_protect_enable on;
app_protect_security_log_enable on;
app_protect_security_log "/etc/nginx/log-default.json" syslog:server=elk:5144;
location /application01 {
root /usr/share/nginx/html;
app_protect_policy_file "/etc/nginx/security-policy.json";
index index.html index.htm;
}
}
}
• NGINX Plusをインストールしたホストで、NGINX App Protectをインストール
• NGINX App Protect モジュールをロードし、WAF/セキュリティログに関する設定を行う
- 44. ©2023 F5
44
44
NGINX App Protectの設定例:セキュリティポリシー
{
"policy":{
"name":"evasions_enabled",
"template":{ "name":"POLICY_TEMPLATE_NGINX_BASE" },
"applicationLanguage":"utf-8",
"enforcementMode":"blocking",
"blocking-settings":{
"violations":[
{
"name":"VIOL_JSON_FORMAT",
"alarm":true,
"block":true
},
{
"name":"VIOL_EVASION",
"alarm":true,
"block":true
},
}
"signature-settings": {
"signatureStaging": false,
"placeSignaturesInStaging": false,
"attackSignatureFalsePositiveMode": "disabled",
"minimumAccuracyForAutoAddedSignatures": "low"
},
"server-technologies": [
{
"serverTechnologyName": "MongoDB"
},
{
"serverTechnologyName": "Unix/Linux"
},
{
"serverTechnologyName": "PHP"
}
]
}
}
- 45. ©2023 F5
45
45
NGINX App Protectの設定例:セキュリティポリシー
Protection Mechanism Description
Attack Signatures デフォルトのポリシーでOWASP top 10の攻撃パターンをカバーします。ユーザはSignature setを有効・無効にすることが可能です
Signature attack for Server
Technologies
サーバテクノロジを選択し、適切なシグネチャセットを利用
Threat Campaigns
攻撃のキャンペーンとして知られるパターンを検出します。誤検知が少なく正確な対応が可能ですが、一連のキャンペーンに該当しない攻撃パ
ターンは検出しません。この設定ではデフォルトで有効ですが、それぞれのViolationを無効にすることも可能です。
HTTP Compliance
Body部を持つGET、Body部の無いPOSTを除いたすべてのHTTPに対するCompliance Checkがデフォルトで有効になります。デフォルトで
無効となっているうちいくつかは有効にすることも可能です。NGINXパーサーにて処理されるHTTP Versionが含まれないリクエストなどについて
は、AppProtectでは検知のみ行います。これらのチェックは無効にすることはできません
Evasion Techniques
すべてのevasion techniquesがデフォルトで有効であり、それぞれの設定を無効にすることが可能です。この項目にはDirectory Traversal
やBad Escaped Characterなどの攻撃が含まれます
Data Guard
レスポンスデータ内のクレジットカードとアメリカの社会保障番号をマスキング処理することが可能です。
デフォルトで無効となっており、有効にすることが可能です`
Parameter parsing アルファベット・数字のプレーンテキスト、XML、JSON等、自動的に検知した型に応じて動作し、値の型を自動的をサポートします
Disallowed meta characters
パラメータ名、値、URL、ヘッダーなどJSON・XMLに含まれる内容を検知します。メタキャラクターやシグネチャやViolation等、複合的に判断し
それらのRatingから攻撃の判定を行い、ブロックします。
Disallowed file type extension
デフォルトで予め設定されたファイルタイプが無効となっています。
• bak, bat, bck, bkp, cfg, conf, config, ini, log, old, sav, save, temp, tmp
• bin, cgi, cmd, com, dll, exe, msi, sys, shtm, shtml, stm
• cer, crt, der, key, p12, p7b, p7c, pem, pfx
• dat, eml, hta, htr, htw, ida, idc, idq, nws, pol, printer, reg, wmz
Supported Security Policy Features:提供する主なセキュリティ機能
- 46. ©2023 F5
46
46
NGINX App Protectの設定例:セキュリティポリシー機能
Protection Mechanism Description
Cookie enforcement
デフォルトですべてのクッキーが有効です。ユーザは特定のクッキーやワイルドカードまたは除外設定を指定でき、指定の内容に応じた処理がなさ
れます。また、レスポンスの内、Cookieに関連する要素としてHttpOnly、Secure、SameSite等の属性に関する指定も可能です
Sensitive Parameters デフォルトのポリシーではセキュリティログ上の「パスワード」をマスクします。更にパラメータを追加することが可能です。
JSON Content
JSON Content ProfileはJSONの値に対し、シグネチャ、メタキャラクタ、不正な内容などの検出をします。デフォルトのポリシーでは、
パラメータ階層の深さをチェックします。その他に、サイズの制限、JSONデータの最大長、値の最大長、配列の最大長、JSONパー
スの容認について設定が可能です。JSONスキーマの適用などサポートしていません。
XML Content
XML Content ProfileはXMLの値に対し、シグネチャ、メタキャラクタ、不正な内容などの検出をします。デフォルトのポリシーでは、
パラメータ階層の深さをチェックします。その他に、サイズの制限、要素の最大数など指定が可能です。SOAP等、XML Schemaや
Web Serviceはサポートしていません。
Allowed methods HTTPの許可するメソッドを指定可能です。デフォルトではすべてのHTTPメソッドが許可されています
Black & White IP listing 個別に、IPアドレスの許可・拒否を指定することが可能です。
Trust XFF header デフォルトで無効になっています。個別にカスタムのXFFを指定し、制御することが可能です。
gRPC Content
gRPC Content ProfileはgRPCの値に対し、シグネチャ、メタキャラクタ、不正な内容などの検出をします。把握されていないフィー
ルドの禁止や、サイズの制限など可能です。gRPC APIの制御の場合にはnterface Definition Language (IDL) をポリシーに
割り当てる必要があります
Supported Security Policy Features:提供する主なセキュリティ機能
- 47. ©2023 F5
47
47
NGINX App Protectの設定例:ブロックページ
{
"policy": {
"name": "blocking_page",
"template": { "name": "POLICY_TEMPLATE_NGINX_BASE" },
"applicationLanguage": "utf-8",
"enforcementMode": "blocking",
"response-pages": [
{
"responseContent": "<html><head><title>Custom Reject
Page</title></head><body>This is a custom response page, it is supposed to overwrite the
default page with custom text.<br><br>Your support ID is: <%TS.request.ID()%><br><br><a
href='javascript:history.back();'>[Go Back]</a></body></html>",
"responseHeader": "HTTP/1.1 302 OK¥¥r¥¥nCache-Control: no-cache¥¥r¥¥nPragma:
no-cache¥¥r¥¥nConnection: close",
"responseActionType": "custom",
"responsePageType": "default"
}
]
}
}
Custom Block Page
"response-pages": [
{
"responsePageType": "ajax",
"ajaxEnabled": true,
"ajaxPopupMessage": "My customized popup message! Your support ID is:
<%TS.request.ID()%>"
}
]
"response-pages": [
{
"responseContent": "",
"responseHeader": "HTTP/1.1 403 FORBIDDEN¥r¥nContent-Type:
application/grpc+proto¥r¥nGrpc-status: 7¥r¥nGrpc-message: Blocked by NGINX
App Protect, Your support ID is <%TS.request.ID()%>¥r¥nSupport-ID:
<%TS.request.ID()%>¥r¥nCache-Control: no-cache¥r¥nPragma: no-
cache¥r¥nConnection: close",
"responseActionType": "custom",
"responsePageType": "default"
}
]
Custom Block Page:Ajax
Custom Block Page:gRPC
- 48. ©2023 F5
48
48
NGINX App Protectの設定例:セキュリティログ
{
"filter": {
"request_type": "all"
},
"content": {
"format": "default",
"max_request_size": "any",
"max_message_size": "5k"
}
}
Simple Log
"content": {
"format": "user-defined",
"format_string": "Request ID %support_id%: %method% %uri% received on %date_time% from IP %ip_client% had the following
violations: %violations%",
"max_request_size": "any",
"max_message_size": "5k" }
A Verbose Custom Format Message
"content": {
"format": "user-defined",
"format_string": "client_ip=%ip_client%,client_port=%src_port%,request=%request%,violations=%violations%,signature_ids=%sig_ids%",
"max_request_size": "any",
"max_message_size": "5k" }
A Verbose Custom Format Message
- 49. ©2023 F5
49
49
"content": {
"format": "user-defined",
"format_string": "client_ip=%ip_client%,client_port=%src_port%,…..",
"max_request_size": "any",
"max_message_size": "5k" }
Attribute Name Description
attack_type A list of comma separated names of suspected attacks identified in a transaction.
blocking_exception_reason The blocking exception reason when a configured violation was not blocked.
bot_anomalies Comma-separated list of anomalies that were detected.
bot_category The category of the detected bot.
client_class
The classification of the client. It can have one of the following values: N/A, Suspicious Browser, Malicou
Bot, Untrusted Bot. If the client is classified as standard browser, then the value is N/A.
bot_signature_name The name of the detected bot.
date_time The date and time the request was received by App Protect.
dest_port The port assigned to listen to incoming requests.
enforced_bot_anomalies Comma-separated list of anomalies that caused the request to be blocked.
request_body_base64 The body of the request (if exists) encoded in Base64. Suitable for binary content.
grpc_service
The service name of the gRPC request (derived from the URI). Applicable only to requests that are proce
Profile. The value is N/A in other cases.
grpc_method
The method name of the gRPC request (derived from the URI). Not to be confused with ‘http_method`.
that are processed by a gRPC Content Profile. The value is N/A in other cases.
headers The headers part of the request including the query string but not the body.
ip_client
The source IP of the client initiating the request Note: if a proxy is being used, this may differ from the IP
header.
is_truncated_bool A flag that returns true if a request is truncated in the security logs, or false if it is not.
method The method of request. For example, GET, POST, HEAD.
outcome
•One of the following:PASSED: the request was sent to the backend server.
•REJECTED: the request was blocked.
outcome_reason
•One of the following:SECURITY_WAF_OK: allowed with no violations (legal request).
•SECURITY_WAF_VIOLATION: blocked due to security violations.
•SECURITY_WAF_FLAGGED: allowed, although it has violations (illegal).
policy_name The name of the App Protect policy for which the violation was triggered.
protocol The protocol used, either HTTP or HTTPS if terminating SSL on App Protect.
request
The entire request including headers, query string, and data in its original encoding. If the request conta
text encoding that the log destination does not support, then this field may not be rendered correctly. In
using the request_body_base64 and headers fields instead.
request_status
•The status of client request made to Web Application as assigned by the App Protect policy. The possib
request was blocked due to a violation encountered. A blocking response page was returned to the clien
•alerted: The request contains violation(s) but is not blocked (typical in cases where the enforcement m
•passed: A successful request with no violations.
NGINX App Protectの設定例:セキュリティログ
A Verbose Custom Format Message
「%<属性の名称>%」を用いて自由に
セキュリティログへ情報を出力することが可能
• App Protect独自にログを生成
• フィルタリングが可能
(all/illegal/blocked)
• syslog(TCP)にて出力
- 50. ©2023 F5
50
50
WAF(NGINX App Protect) 動作確認
脆弱なWEBアプリケーション
WAFによるブロック機能を提供していない環境で、脆弱なWEBアプリケー
ションに対して、意図しないログインが許可(攻撃)されてしまうことを確認
1
WAFで適切な設定を行い、1の内容が正しく防御できていることを確認
2
2
1 1
意図しないログインを許可!
https://f5j-nginx-plus-lab2-security.readthedocs.io/en/latest/class1/module03/module03.html
- 51. ©2023 F5
51
51
• NGINX App Protectにより通信の防御が可能であることを確認しました
• NGINX Plusが動作する様々な環境で利用することが可能であり、Webサーバ、リバースプ
ロキシ、更にコンテナ環境のコンテナや、Ingressコントローラでも利用が可能であることを確
認
Module Summary