Skip to content

feat: unattended config support and Docker UFW hardening - #127

Merged
buildplan merged 10 commits into
mainfrom
feat/phase1-security-hardening
Nov 1, 2026
Merged

buildplan merged 10 commits into
mainfrom
feat/phase1-security-hardening

Conversation

@buildplan

Copy link
Copy Markdown
Owner

No description provided.

Comment thread README.md Dismissed
Comment thread README.md Dismissed
Comment thread README.md Dismissed
Comment thread README.md Fixed
Comment thread README.md Dismissed
Comment thread README.md Fixed
Comment thread README.md Dismissed
Comment thread README.md Fixed
Comment thread README.md Dismissed
Comment thread README.md Fixed
Comment thread README.md Fixed
Comment thread README.md Fixed
@buildplan buildplan added the enhancement New feature or request label Nov 1, 2026
@buildplan
buildplan requested a balanced review from Copilot November 1, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical defects risk SSH lockout, allow Docker traffic to bypass UFW protections, and enable spoofed packets to trigger bans against innocent users.

7 open issues
What changed in this PR

Adds unattended provisioning to the Debian/Ubuntu hardening script and optional Docker firewall protection, alongside SSH safety and runtime reliability improvements.

Changes:

  • Adds safe DU_* configuration parsing, quiet-mode defaults, validation, and an example configuration.
  • Adds Docker DOCKER-USER rules and updates SSH, 2FA, intrusion prevention, and credential handling.
  • Updates usage and recovery documentation, release metadata, and script checksums.
File Description
README.md Documents unattended setup, Docker protection, and revised SSH recovery steps.
du_setup.sh.sha256 Updates the published script checksum.
du_setup.sh Implements configuration-driven provisioning, firewall hardening, and reliability fixes.
du_setup.env.example Provides documented configuration options for unattended runs.

Review effort: Balanced

Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread README.md Fixed
Comment thread README.md Dismissed

Copilot AI left a comment

Copy link
Copy Markdown

Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread README.md Resolved
Comment thread README.md Fixed
Comment thread README.md Dismissed
Comment thread README.md Dismissed
Comment thread README.md Dismissed
Comment thread README.md Dismissed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread du_setup.sh Resolved
Comment thread README.md Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread du_setup.sh
local opts="$1"
[[ -n "$opts" ]] || return 1
local flag_re='^(restrict|cert-authority|no-touch-required|verify-required|(no-)?(port-forwarding|agent-forwarding|x11-forwarding|pty|user-rc))(,(.*))?$'
local val_re='^(command|principals|from|expiry-time|environment|permitopen|permitlisten|tunnel)="(([^"\\]|\\.)*)"(,(.*))?$'
Comment thread du_setup.sh Outdated
Comment on lines +2942 to +2943
# Enforce >= 1024-bit RSA modulus minimum matching sshd
(( blob_len >= 143 )) || rc=1
Comment thread du_setup.sh Outdated

local host_val sshd_dump
host_val=$(hostname 2>/dev/null || printf 'localhost')
if ! sshd_dump=$("$sshd_bin" -T -C "user=${username},host=${host_val},addr=127.0.0.1" 2>/dev/null); then
Comment thread du_setup.sh
print_error "Quiet mode aborted: User '$DU_USERNAME' already exists and DU_USE_EXISTING_USER is false."
exit 1
fi
existing_home=$(getent passwd "$DU_USERNAME" | cut -d: -f6)
Comment thread du_setup.sh
print_info "Skipping custom .bashrc configuration."
log "Skipped custom .bashrc for $USERNAME."
return 0
fi

print_info "Preparing custom .bashrc for '$USERNAME'..."

temp_source_bashrc=$(mktemp "/tmp/custom_bashrc_source.XXXXXX")
temp_source_bashrc=$(mktemp "${RUN_TMP_DIR:-/tmp}/custom_bashrc_source.XXXXXX")
Comment thread du_setup.sh
Comment on lines +6238 to +6241
if [[ -n "${DU_TAILSCALE_FLAGS:-}" ]]; then
local -a raw_ts_flags=()
local flag
read -ra raw_ts_flags <<< "${DU_TAILSCALE_FLAGS}"
@buildplan buildplan self-assigned this Nov 1, 2026
@buildplan
buildplan requested a balanced review from Copilot November 1, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@buildplan
buildplan requested a balanced review from Copilot November 1, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Comment thread README.md Fixed
Comment thread README.md Dismissed
@buildplan
buildplan merged commit fd5574f into main Nov 1, 2026
12 checks passed
@buildplan
buildplan deleted the feat/phase1-security-hardening branch November 1, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants