Code Monkey home page Code Monkey logo

Comments (11)

dhfsqxz avatar dhfsqxz commented on May 21, 2024 2

考虑dns验证的会好些,不过要配合证书夹功能自动配置

我现在有四个主域名,都是全 *.example.com 的形式
每个主域名一个证书
再用acme自动续签自动替换证书文件重启nginx
真正的子域名配置和转发都是交给后面的nginx处理
waf只管入口和ssl

from safeline.

0pera avatar 0pera commented on May 21, 2024 2

可以尝试整合acme,已经有非常多的dns认证插件,不需要重新自己写。

至于virtualhost,这是一个非常重要的设计,可以同一个tcp端口提供多个网站的服务。我认为这对于WAF来说应该算是非常基本的功能。
例如:
10.10.10.10上:

listen 443 default_server;
hostname default;
ssl_certificate <随便一个自签署证书>
location / {
404
}

listen 443;
hostname a.com;
ssl_certificate <通配符证书>
location / {
proxy_pass 1.1.1.1
}

listen 443;
hostname b.com;
ssl_certificate <通配符证书>
location / {
proxy_pass 2.2.2.2
}

那么,对于进来的访问,除了https://a.com或者https://b.com的访问以外,所有访问都将返回一个404,对于一些对互联网开放的私有服务非常有帮助。在暴露域名之前,都没法访问到对应的网站。

另外,减少了防火墙的配置,也减少了对公网暴露的入口。同时,由于默认提供了一份自签署的证书,扫描机也没法通过证书的DNS名称关联到任何的域名,避免因证书而导致域名之类被泄露,减少被嗅探到的信息。

@Lorna0

from safeline.

yrluke avatar yrluke commented on May 21, 2024

这件事我们其实很早之前就考虑了,但是考虑到目前集成进来会比较复杂,因为我们在和社区用户交流的过程中发现,并不是所有的用户都能将自己的waf听在80上,我们后期会考虑如何通过一些别的方法来实现这个功能

from safeline.

imgfile avatar imgfile commented on May 21, 2024

bash /root/.acme.sh/acme.sh .......................你自己配置

cp -f /etc/nginx/ssl.crt /root/safeline/resources/nginx/certs/DYYZddcihvrLd_ssl.crt
cp -f /etc/nginx/ssl.key /root/safeline/resources/nginx/certs/tbZPEtZKD_backend.key

docker restart safeline-postgres
docker restart safeline-detector
docker restart safeline-tengine
docker restart safeline-redis
docker restart safeline-mgt-api
docker restart safeline-mario

from safeline.

nmgliangwei avatar nmgliangwei commented on May 21, 2024

+1

from safeline.

0pera avatar 0pera commented on May 21, 2024

不考虑DNS验证吗?Let's Encrypt只能通过DNS验证来签署通配符证书,类如*.example.com。配置通配符证书可以隐藏hostname,对virtualhost比较友好。

from safeline.

Lorna0 avatar Lorna0 commented on May 21, 2024

DNS 验证得配置运营商和 token,用起来比 HTTP 验证要复杂,所以我们还是会优先考虑 HTTP 验证。

@0pera

不考虑DNS验证吗?Let's Encrypt只能通过DNS验证来签署通配符证书,类如*.example.com。配置通配符证书可以隐藏hostname,对virtualhost比较友好。

为什么通过 virtualhost 来提供 web 服务呢,可以分享一下么。

from safeline.

alloneinfo avatar alloneinfo commented on May 21, 2024

目前我的使用步骤:
1、使用 acme.sh 生成相应的证书
2、通过 waf 中的证书管理上传相关的证书,系统生成证书数据(域名、过期时间)等
3、在 /root/safeline/resources/nginx/certs/ 目录找出对应的证书文件名
4、使用 acme.sh --install-cert 命令指定路径、证书名称将证书传到 /root/safeline/resources/nginx/certs/ 覆盖对应的文件
但目前的问题(疑问):这样操作后,系统记录的【过期时间】不变,不知过了系统的【过期时间】会影响到什么。

那如果系统能提供1个重新刷新证书文件的【域名】、【过期时间】等信息的功能再结合 acme.sh 是否就能解决自动部署证书的需求。再有如果系统能自动或手动检索 /root/safeline/resources/nginx/certs/ 中的证书文件信息自动导入 waf 系统,是否也是一个思路呢

from safeline.

Lorna0 avatar Lorna0 commented on May 21, 2024

3.6 版本已支持在界面上申请 Let'sEncrypt 证书,基于 HTTP-01 验证,可以试试。

from safeline.

sagehou avatar sagehou commented on May 21, 2024

HTTP-01方式实现了,当然最好还是能支持DNS-01验证,能够申请泛域名证书,感谢 :D

from safeline.

Lorna0 avatar Lorna0 commented on May 21, 2024

HTTP-01方式实现了,当然最好还是能支持DNS-01验证,能够申请泛域名证书,感谢 :D

可以提个新 issue,方便统计~

from safeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.