From ec1ef66fb46145dce55375fef1bb816c45ea2a0e Mon Sep 17 00:00:00 2001 From: "xiaobing.wang" Date: Wed, 15 May 2024 14:45:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documents/docs/04-practice/03-apisix.md | 4 ++++ .../docs/04-practice/{05-kong.md => 04-kong.md} | 17 ++++++++++------- ...4-safeline-cloud.md => 05-safeline-cloud.md} | 0 3 files changed, 14 insertions(+), 7 deletions(-) rename documents/docs/04-practice/{05-kong.md => 04-kong.md} (72%) rename documents/docs/04-practice/{04-safeline-cloud.md => 05-safeline-cloud.md} (100%) diff --git a/documents/docs/04-practice/03-apisix.md b/documents/docs/04-practice/03-apisix.md index 2d35e1a..25cb1ea 100644 --- a/documents/docs/04-practice/03-apisix.md +++ b/documents/docs/04-practice/03-apisix.md @@ -16,6 +16,10 @@ apisix:https://github.com/apache/apisix ## 使用方式 +### 版本要求 +* APISIX >= 3.5.0 +* Safeline >= 5.6.0 + ### 准备工作 社区版雷池的检测引擎默认以 unix socket 的方式提供服务,我们需要把他修改为 tcp 方式,供 t1k 插件调用。 diff --git a/documents/docs/04-practice/05-kong.md b/documents/docs/04-practice/04-kong.md similarity index 72% rename from documents/docs/04-practice/05-kong.md rename to documents/docs/04-practice/04-kong.md index dceb8a9..8d23d28 100644 --- a/documents/docs/04-practice/05-kong.md +++ b/documents/docs/04-practice/04-kong.md @@ -1,16 +1,20 @@ --- -title: "Kong 联动雷池" +title: "Kong 集成雷池" --- -# Kong 联动雷池 +# Kong 集成雷池 -Kong 是一个云原生、快速、可扩展和分布式的微服务抽象层(也称为 API 网关或 API 中间件)。它通过插件提供了丰富的流量控制、安全、监控和运维功能。 +[Kong](https://github.com/Kong/kong) 是一个云原生、快速、可扩展和分布式的微服务抽象层(也称为 API 网关或 API 中间件)。它通过插件提供了丰富的流量控制、安全、监控和运维功能。 # 使用方式 +### 版本要求 +* Kong >= 2.6.x +* Safeline >= 5.6.0 + ### 准备工作 -参考 [APISIX 联动雷池](/docs/04-practice/03-apisix) 的准备工作。 +参考 [APISIX 联动雷池](/docs/practice/apisix#准备工作) 的准备工作。 ### 安装 Kong 插件 @@ -22,8 +26,7 @@ Kong 是一个云原生、快速、可扩展和分布式的微服务抽象层( ```shell luarocks install kong-safeline ``` -2. 启用 safeline 插件 -在 kong.conf 配置文件中添加以下配置: +2. 启用 safeline 插件,在 kong.conf 配置文件中添加以下配置: ```shell plugins = bundled,safeline # Comma-separated list of plugins this node # should load. By default, only plugins @@ -48,7 +51,7 @@ curl -X POST http://localhost:8001/services/{service}/plugins \ ### 测试防护效果 模拟简单的 SQL 注入攻击访问 kong ,如果返回 403 Forbidden,说明防护生效。 ```shell -$ curl -X POST http://kong:8000?1=1%20and%202=2 +$ curl -X POST http://localhost:8000?1=1%20and%202=2 # you will receive a 403 Forbidden response {"code": 403, "success":false, "message": "blocked by Chaitin SafeLine Web Application Firewall", "event_id": "8b41a021ea9541c89bb88f3773b4da24"} diff --git a/documents/docs/04-practice/04-safeline-cloud.md b/documents/docs/04-practice/05-safeline-cloud.md similarity index 100% rename from documents/docs/04-practice/04-safeline-cloud.md rename to documents/docs/04-practice/05-safeline-cloud.md