Default HSTS pinning time and Let's Encrypt certificate life time
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label. For the Community Edition issue tracker: - https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=bug For the Enterprise Edition issue tracker: - https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary Let's encrypt will only serve you a 3 month certificate and the default HSTS value is one year. When this 3 month period from LE expires, you are stuck with a broken domain and will have to move domains. ### Steps to reproduce 1. Set up gitlab to get a Let's Encrypt certificate and watch what happens after 3 months. ### Example Project N/A ### What is the current *bug* behavior? Not screwing the domain over by allowing a default HSTS value to be greater than LE's 3 month period if you are using LE certificates. ### What is the expected *correct* behavior? See above. ### Relevant logs and/or screenshots N/A ### Output of checks N/A #### Results of GitLab environment info <details> <summary>Expand for output related to GitLab environment info</summary> <pre> System information System: Debian 9.5 Proxy: no Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknown GitLab information Version: 11.1.4-ee Revision: d17962f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.8 URL: https://<censored>.red-m.net HTTP Clone URL: https://<censored>.red-m.net/some-group/some-project.git SSH Clone URL: git@<censored>.red-m.net:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: no GitLab Shell Version: 7.1.4 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git </pre> </details> #### Results of GitLab application Check <details> <summary>Expand for output related to the GitLab application check</summary> <pre> Checking GitLab Shell ... GitLab Shell version >= 7.1.4 ? ... OK (7.1.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 17/9 ... ok 16/10 ... ok 16/11 ... ok 16/12 ... ok 17/13 ... ok 17/15 ... ok 3/21 ... ok 15/23 ... ok 5/27 ... ok 32/28 ... ok 5/29 ... ok 3/30 ... ok 91/31 ... ok 91/32 ... ok 2/33 ... ok 16/34 ... ok 89/35 ... ok 17/36 ... ok 17/37 ... ok 3/38 ... ok 21/39 ... ok 10/40 ... ok 3/41 ... ok 3/42 ... ok 3/43 ... ok 3/44 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Sidekiq ... Running? ... yes Number of Sidekiq processes ... 1 Checking Sidekiq ... Finished Reply by email is disabled in config/gitlab.yml Checking LDAP ... LDAP is disabled in config/gitlab.yml Checking LDAP ... Finished Checking GitLab ... Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 17/9 ... yes 16/10 ... yes 16/11 ... yes 16/12 ... yes 17/13 ... yes 17/15 ... yes 3/21 ... yes 15/23 ... yes 5/27 ... yes 32/28 ... yes 5/29 ... yes 3/30 ... yes 91/31 ... yes 91/32 ... yes 2/33 ... yes 16/34 ... yes 89/35 ... yes 17/36 ... yes 17/37 ... yes 3/38 ... yes 21/39 ... yes 10/40 ... yes 3/41 ... yes 3/42 ... yes 3/43 ... yes 3/44 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.17.1) Git user has default SSH configuration? ... yes Active users: ... 105 Elasticsearch version 5.1 - 5.5? ... skipped (elasticsearch is disabled) Checking GitLab ... Finished </pre> </details> ### Possible fixes When `gitlab-ctl reconfigure`ing don't allow when LE certs are being used to have a HSTS timer higher than 3 months.
issue