首页 > 其他分享 >长亭waf-ce 版本试用

长亭waf-ce 版本试用

时间:2023-06-26 23:00:13浏览次数:40  
标签:nginx -- waf ce etc 长亭 safeline resources

最近长亭提供了ce 版本的waf ,部分开源了(部分管理UI,t1k 部分,部分语义分析自动机引擎)

运行

 
networks:
  safeline-ce:
    name: safeline-ce
    driver: bridge
    ipam:
      driver: default
      config:
      - gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
        subnet: ${SUBNET_PREFIX}.0/24
    driver_opts:
      com.docker.network.bridge.name: safeline-ce
 
services:
  postgres:
    container_name: safeline-postgres
    restart: always
    image: postgres:15.2
    volumes:
    - ./resources/postgres/data:/var/lib/postgresql/data
    - /etc/localtime:/etc/localtime:ro
    environment:
    - POSTGRES_USER=safeline-ce
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?postgres password required}
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.2
    cap_drop:
    - net_raw
    command: [postgres, -c, max_connections=200]
  redis:
    container_name: safeline-redis
    restart: always
    image: redis:7.0.11
    volumes:
      - ./resources/redis/data:/data
      - /etc/localtime:/etc/localtime:ro
    command: redis-server --appendonly yes --requirepass  ${POSTGRES_PASSWORD}
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.3
    cap_drop:
      - net_raw
    sysctls:
      net.core.somaxconn: "511"
  management:
    container_name: safeline-mgt-api
    restart: always
    image: chaitin/safeline-mgt-api:${IMAGE_TAG:?image tag required}
    volumes:
    - ./resources/management:/resources/management
    - ./resources/nginx:/resources/nginx
    - ./logs:/logs
    - /etc/localtime:/etc/localtime:ro
    ports:
    - ${MGT_PORT:-9443}:1443
    environment:
    - MANAGEMENT_RESOURCES_DIR=/resources/management
    - NGINX_RESOURCES_DIR=/resources/nginx
    - DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@127.0.0.1/safeline-ce
    - MANAGEMENT_LOGS_DIR=/logs/management
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.4
    cap_drop:
    - net_raw
  detector:
    container_name: safeline-detector
    restart: always
    image: chaitin/safeline-detector:${IMAGE_TAG}
    volumes:
    - ./resources/detector:/resources/detector
    - ./logs/detector:/logs/detector
    - /etc/localtime:/etc/localtime:ro
    environment:
    - LOG_DIR=/logs/detector
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.5
    cap_drop:
    - net_raw
  mario:
    container_name: safeline-mario
    restart: always
    image: chaitin/safeline-mario:${IMAGE_TAG}
    volumes:
    - ./resources/mario:/resources/mario
    - ./logs/mario:/logs/mario
    - /etc/localtime:/etc/localtime:ro
    environment:
    - LOG_DIR=/logs/mario
    - GOGC=100
    - DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce
    - REDIS_URL=redis://:${POSTGRES_PASSWORD}@safeline-redis:6379/0
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.6
    cap_drop:
    - net_raw
  tengine:
    container_name: safeline-tengine
    restart: always
    image: chaitin/safeline-tengine:${IMAGE_TAG}
    volumes:
    - ./resources/nginx:/etc/nginx
    - ./resources/management:/resources/management
    - ./resources/detector:/resources/detector
    - ./logs/nginx:/var/log/nginx
    - /etc/localtime:/etc/localtime:ro
    - ./resources/cache:/usr/local/nginx/cache
    - /etc/resolv.conf:/etc/resolv.conf
    environment:
    - MGT_ADDR=${SUBNET_PREFIX}.4:9002
    ulimits:
      nofile: 131072
    network_mode: host

.env 文件

SAFELINE_DIR=$PWD
IMAGE_TAG=latest
MGT_PORT=9443
POSTGRES_PASSWORD=evgpqNU9MglspscuudHwd5GwuQPxv7Vn
SUBNET_PREFIX=169.254.0
  • 启动
docker-compose up -d

说明

目前来说ce 版本提供的配置能力(ui 上)还是比较少的,而且很不灵活,可以结合safeline-open-platform 提供的api 进行添加,整体上实际长亭waf 是基于了tengine
同时开发了自己的nginx 扩展模块,参考构建参数

 
Tengine version: Tengine/2.3.3
nginx version: nginx/1.18.0
built by gcc 11.2.0 (Ubuntu 11.2.0-19ubuntu1) 
built with OpenSSL 1.1.1o  3 May 2022 (running with OpenSSL 1.1.1t  7 Feb 2023)
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf --add-module=modules/ngx_http_upstream_check_module --add-module=modules/ngx_http_upstream_dynamic_module --add-module=modules/ngx_http_upstream_session_sticky_module --add-module=src/http/modules/t1k --add-module=modules/ngx_brotli/filter --with-openssl-async --with-http_v2_module --with-http_realip_module --with-stream --with-stream_ssl_module --with-stream_sni --with-dispatch --with-dispatch_ssl_module --with-dispatch_sni --with-pcre-jit --with-jemalloc --with-cpu-opt=amd64 --with-cc-opt='-fpie -O2 -fstack-protector-strong -Wextra -Wformat -Werror=format-security -Wno-implicit-fallthrough -D_FORTIFY_SOURCE=2 -DNGX_SECURE_MEM -I/opt/ssl/include' --with-ld-opt='-fpie -Wl,-z,relro -L/opt/ssl/lib -ldl -Wl,-rpath,/opt/ssl/lib' --with-exec-ld-opt=-pie

对于web 站点管理部分基于了api 以及生成nginx 配置,参考生成配置

 


作为一个可以免费使用的,还是很不错的,值得试用下

参考资料

https://github.com/chaitin/safeline
https://github.com/chaitin/lua-resty-t1k
https://github.com/chaitin/yanshi
https://github.com/chaitin/safeline-open-platform
http://demo.waf-ce.chaitin.cn/image.tar.gz
https://github.com/chaitin/safeline-open-platform/tree/master/series_20/api_doc
https://tengine.taobao.org/

标签:nginx,--,waf,ce,etc,长亭,safeline,resources
From: https://www.cnblogs.com/rongfengliang/p/17507389.html

相关文章

  • 猿大师办公助手VUE网页在线打开编辑保存微软Office、金山WPS文档,并强制修改留痕。
    很多OA的在线办公系统中,都需要多个人修改编辑Office文档,这样很容易版本混乱并且极易出错,如果这时候启用强制留痕并且启用留痕,就可以记录每个人的操作记录,方便文档管理,降低操作风险。 实现方法: 第一步:安装猿大师办公助手,下载地址:http://www.yuanofficer.com/xiazai/  并且......
  • 【Linux】systemd.timer replace the crontab or at jobs
    systemd架构学习Systemd的第一步,就是搞懂"单元"(unit)是什么。简单说,单元就是Systemd的最小功能单位,是单个进程的描述。一个个小的单元互相调用和依赖,组成一个庞大的任务管理系统,这就是Systemd的基本思想。由于Systemd要做的事情太多,导致单元有很多不同的种类,大概一......
  • CF1144G Two Merged Sequences
    CF1144GTwoMergedSequences题意现在给你一个长度为\(n\)的序列你要把它拆成一个严格递增序列和一个严格递减序列如果不可行输出\(NO\)如果可行输出\(YES\)并输出每个数属于递增序列还是递减序列题解感觉脑子瓦特了,感觉这个\(dp\)的状态设计是比较自然的。首先我们考......
  • celery笔记八之数据库操作定时任务
    本文首发于公众号:Hunter后端原文链接:celery笔记八之数据库操作定时任务前面我们介绍定时任务是在celery.py中的app.conf.beat_schedule定义,这一篇笔记我们介绍一下如何在Django系统中的表里来操作这些任务。依赖及migrate操作beat的启动表介绍手动操作定时任务1......
  • LabVIEW Excel工具包快速读写EXCEL样式模板生成测试报告制作
    LabVIEWExcel工具包快速读写EXCEL样式模板生成测试报告制作原创文章,转载请说明出处,资料来源:http://imgcs.cn/5c/673187774245.html......
  • MYSQL 将excel里面的数据直接生成sql语句
    如何使用EXCEL生成SQL语句? 将光标放到新的列上里面,然后在公式栏里面输入如下公式:="insertintotvalues('"&A1&"','"&B1&"','"&C1&"','"&D1&"')" 效果图: 然后拖动公式往下,就可以将所有的数据生成S......
  • CentOS 7 修改默认 yum 源
    修改CentOS默认yum源为mirrors.aliyun.com1、首先备份系统自带的yum源配置文件[root@localhost~]#mv/etc/yum.repos.d/centos.repo/etc/yum.repos.d/CentOS-Base.repo.backup2、进入yum配置文件所在文件夹[root@localhost~]#cd/etc/yum.repos.d/3、下载aliyun的......
  • Linux ssh: Could not resolve hostname xxxx: Name or service not known
    linux(centos)在配置互信时,出现报错:ssh:Couldnotresolvehostnamexxxx:Nameorservicenotknown出现这种错误是因为系统/etc/hosts中配置的主机名与HOSTNAME的不一致造成。例如:/etc/hosts中这样配置baoyw-dbhostname中这样配置baoywdb......
  • Pytorch | `torch.multiprocessing.spawn` 函数的使用
    torch.multiprocessing.spawn是PyTorch中用于启动多进程的函数,可以用于分布式训练等场景。其函数签名如下:torch.multiprocessing.spawn(fn,args=(),nprocs=1,join=True,daemon=False,start_method='spawn',)参数:fn(function)–函数被称......
  • .NETCore项目在Windows下构建Docker镜像并本地导出分发到CentOS系统下
    在Windows下使用Docker,我们选择DockerDesktop这个软件,非常方便。DockerDesktop介绍及安装DockerDesktop是适用于Mac、Linux或Windows环境的一键安装应用程序,使您能够构建和共享容器化应用程序和微服务。它提供了一个简单的GUI(图形用户界面),允许您直接从机器管理容器、应用程......