AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 922254
Accepted
Maris B.
Maris B.
Asked: 2018-07-18 02:37:21 +0800 CST2018-07-18 02:37:21 +0800 CST 2018-07-18 02:37:21 +0800 CST

Let's Encrypt certbot 的 `enhance` 命令到底是什么?

  • 772

Let's Encrypt certbot 有enhance一个子命令,其描述为“向现有配置添加安全增强”。

我可以在 certbot 的 CLI 帮助文件中找到的唯一附加信息是:

增强:通过向现有配置添加安全增强功能来帮助强化 TLS 配置。

仍然不清楚在现有配置中添加了哪些附魔。修改了哪些文件等...我对使用 Ubuntu + Apache HTTP Server 的配置(使用--apache选项)特别感兴趣。

lets-encrypt
  • 1 1 个回答
  • 2455 Views

1 个回答

  • Voted
  1. Best Answer
    Lenniey
    2018-07-18T04:01:54+08:002018-07-18T04:01:54+08:00

    我也找不到它,所以我查看了源代码(和另一个文档),其中指出:

    security:
      Security parameters & server settings
    
      --rsa-key-size N      Size of the RSA key. (default: 2048)
      --must-staple         Adds the OCSP Must Staple extension to the
                            certificate. Autoconfigures OCSP Stapling for
                            supported setups (Apache version >= 2.3.3 ). (default:
                            False)
      --redirect            Automatically redirect all HTTP traffic to HTTPS for
                            the newly authenticated vhost. (default: Ask)
      --no-redirect         Do not automatically redirect all HTTP traffic to
                            HTTPS for the newly authenticated vhost. (default:
                            Ask)
      --hsts                Add the Strict-Transport-Security header to every HTTP
                            response. Forcing browser to always use SSL for the
                            domain. Defends against SSL Stripping. (default: None)
      --uir                 Add the "Content-Security-Policy: upgrade-insecure-
                            requests" header to every HTTP response. Forcing the
                            browser to use https:// for every http:// resource.
                            (default: None)
      --staple-ocsp         Enables OCSP Stapling. A valid OCSP response is
                            stapled to the certificate that the server offers
                            during TLS. (default: None)
      --strict-permissions  Require that all configuration files are owned by the
                            current user; only needed if your config is somewhere
                            unsafe like /tmp/ (default: False)
    

    并在我的测试环境中尝试过:

    certbot --authenticator webroot --installer apache
    
    [...]
    Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
    -------------------------------------------------------------------------------
    1: No redirect - Make no further changes to the webserver configuration.
    2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
    new sites, or if you're confident your site works on HTTPS. You can undo this
    change by editing your web server's configuration.
    -------------------------------------------------------------------------------
    Select the appropriate number [1-2] then [enter] (press 'c' to cancel):2
    
    Enabled Apache rewrite module
    Redirecting vhost in /etc/apache2/sites-enabled/example.conf to ssl vhost in /etc/apache2/sites-enabled/example.ssl.conf
    
    -------------------------------------------------------------------------------
    Congratulations! You have successfully enabled https://example.com and https://www.example.com
    
    You should test your configuration at:
    https://www.ssllabs.com/ssltest/analyze.html?d=example.com
    
    
    
    certbot enhance --hsts
    
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator None, Installer apache
    
    Which certificate would you like to use to enhance your configuration?
    -------------------------------------------------------------------------------
    1: example.com
    -------------------------------------------------------------------------------
    Press 1 [enter] to confirm the selection (press 'c' to cancel):
    
    Which domain names would you like to enable the selected enhancements for?
    -------------------------------------------------------------------------------
    1: example.com
    2: www.example.com
    -------------------------------------------------------------------------------
    Select the appropriate numbers separated by commas and/or spaces, or leave input
    blank to select all options shown (Enter 'c' to cancel):
    
    Adding Strict-Transport-Security header to ssl vhost in /etc/apache2/sites-enabled/example.ssl.conf
    
    
    
    certbot enhance --uir
    
    Plugins selected: Authenticator None, Installer apache
    
    Which certificate would you like to use to enhance your configuration?
    -------------------------------------------------------------------------------
    1: example.com
    -------------------------------------------------------------------------------
    Press 1 [enter] to confirm the selection (press 'c' to cancel):
    
    Which domain names would you like to enable the selected enhancements for?
    -------------------------------------------------------------------------------
    1: example.com
    2: www.example.com
    -------------------------------------------------------------------------------
    Select the appropriate numbers separated by commas and/or spaces, or leave input
    blank to select all options shown (Enter 'c' to cancel):
    
    Adding Upgrade-Insecure-Requests header to ssl vhost in /etc/apache2/sites-enabled/example.ssl.conf
    

    您可以猜测其余选项(没有全部尝试)。

    它在启用站点的 ssl.conf 中添加了以下几行:

    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
    Header always set Strict-Transport-Security "max-age=31536000"
    Header always set Content-Security-Policy upgrade-insecure-requests
    

    这些在我的启用站点的 non-ssl.conf 中:

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.example.com [OR]
    RewriteCond %{SERVER_NAME} =example.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    
    • 5

相关问题

  • 为具有分布式流量的多个 Apache 服务器使用 Lets Encrypt SSL

  • 我是否需要在 LAMP 中为 HTTPS 网站配置端口 80?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve