Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(box): Secure TTYD with HTTPS & HTTP Basic Authentication #20

Merged
merged 41 commits into from
Jun 22, 2022

Conversation

mrzzy
Copy link
Owner

@mrzzy mrzzy commented Jun 19, 2022

Purpose

Closes: #19

Contents

Secure TTYD with HTTPS & HTTP Basic Authentication:

  • configures ttyd to use HTTPS with TLS certificates at /etc/ssl/certs/ttyd.pem & /etc/ssl/private/ttyd.key
  • adds a iptables route from HTTPS (443) to TTYD (7681).
    • This is required as TTYD runs as an unprivileged user & does not have the permissions to listen on a privileged port: 443.
  • enables HTTP basic authentication on TTYD using password passed by devbox_ttyd_password Ansible var & web_term_password Packer var.
  • For security, when no password is not set, TTYD will longer run on boot so as to prevent an unauthenticated web terminal from being exposed to the public internet.

Refactored to remove hardcode of mrzzy as user name.

box/packer/variables.pkr.hcl Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
box/ansible/roles/devbox/defaults/main.yaml Outdated Show resolved Hide resolved
mrzzy added 25 commits June 20, 2022 19:02
Exposing an unauthenticated web shell poses a security risk
…to '_production'

having a switch that defaults to false makes more semantic sense that a
switch that always defaults to true.
box/packer/image.pkr.hcl Outdated Show resolved Hide resolved
box/packer/variables.pkr.hcl Outdated Show resolved Hide resolved
@mrzzy mrzzy merged commit 47c29ea into main Jun 22, 2022
@mrzzy mrzzy deleted the feat/certbot-tls branch June 22, 2022 21:42
@mrzzy mrzzy mentioned this pull request Jun 24, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Secure TTYD with Let Encrypt TLS Certs
1 participant