Commit Graph
57 Commits
Author SHA1 Message Date
mrcharles 40dfda47f2 fix(security): enable KbdInteractiveAuthentication for SSH 2FA
configure_ssh_2fa only enabled the deprecated ChallengeResponseAuthentication
directive (removed as a usable knob in modern OpenSSH; it no longer controls
keyboard-interactive). The base tsys-sshd-config ships
KbdInteractiveAuthentication no, so on Debian 13 (OpenSSH 9.x/10.x)
keyboard-interactive stayed disabled. With AuthenticationMethods set to
"publickey,keyboard-interactive", sshd -t then failed:

  Disabled method "keyboard-interactive" in AuthenticationMethods list ...
  AuthenticationMethods cannot be satisfied by enabled authentication methods

which aborted provisioning under errexit.

Add the modern KbdInteractiveAuthentication yes directive alongside the
legacy one so 2FA works on both current and older OpenSSH.

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-27 10:37:18 -05:00
mrcharles b19bc87361 fix(security): resolve user home dir for 2FA setup instructions
setup_user_2fa wrote each user's 2FA-setup instructions to the quoted
path "~$user/2fa-setup-instructions.txt". Tilde expansion does not occur
inside double quotes, so the path was treated literally and the write
failed with "No such file or directory", aborting the whole 2FA module
(and thus provisioning) under errexit.

Resolve the home directory explicitly with `getent passwd` and use that
absolute path for both the instructions file and the chown. Skip the
user cleanly if no home directory exists.

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-27 10:16:48 -05:00
mrcharles 5f26f7dca1 fix(provisioning): make wazuh-agent start best-effort
secharden-wazuh.sh did a hard `systemctl start wazuh-agent`. The agent
attempts to reach its manager (tsys-nsm.knel.net) during startup; when
that host is unreachable (e.g. an isolated lab/sandbox VM, or the SIEM
being temporarily down during a fresh build), systemd's start exceeds
its timeout and the whole provisioning aborts under the framework's
errexit.

The agent is already installed and enabled, so it will keep retrying the
manager on its own. Make the start non-fatal with `|| true` so a host can
finish building even when the manager isn't reachable at deploy time.

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-27 10:13:04 -05:00
Charles N Wyble 688b7190e6 refactor(provisioning): make scripts self-locating and read configs locally
All provisioning scripts and modules now resolve their own location via
BASH_SOURCE and derive PROJECT_ROOT_PATH from it, removing a hard
dependency on the current working directory.

- Derive PROJECT_ROOT_PATH/CONFIGFILES_PATH/MODULES_PATH/SCRIPTS_PATH
  from BASH_SOURCE in SetupNewSystem.sh and every module
- Replace all curl ${DL_ROOT}/... downloads with cat of the matching
  local files under ProjectCode/ConfigFiles (the dl.knownelement.com CDN
  is no longer required for a git clone)
- Invoke modules by absolute path instead of cd ./Modules/X && bash ./x
- Fix secharden-audit-agents.sh: wrong path depth (../../ vs ../../..),
  wrong Project-Includes glob, and ConfigFiles/AudidD -> AuditD typo,
  all of which previously crashed the script
- Remove duplicate FrameworkVars source lines

Run from anywhere with: sudo bash ProjectCode/SetupNewSystem.sh

🤖 Generated with [Crush](https://github.com/charmassociates/crush)

Assisted-by: GLM-5 via Crush <crush@charm.land>
2026-07-25 13:49:39 -05:00
mrcharles 2930eeaf27 ssh pub key regression, need to use cat instead of curl 2025-07-29 13:54:39 -05:00
mrcharles 31e66864ad . 2025-07-14 13:02:42 -05:00
mrcharles 0006eefcf1 . 2025-07-14 12:58:25 -05:00
mrcharles abfaf765e6 . 2025-07-14 12:55:48 -05:00
mrcharles 1f2bd31380 . 2025-07-14 12:53:41 -05:00
mrcharles 93cea874a8 . 2025-07-14 12:50:48 -05:00
mrcharles a898ebc59d . 2025-07-14 12:49:26 -05:00
mrcharles 7a7d23f36c . 2025-07-14 12:42:22 -05:00
mrcharles f9f32612bb . 2025-07-14 12:37:04 -05:00
mrcharles 09063bfee4 case matters... 2025-07-14 12:36:03 -05:00
mrcharles 5bbaff89e9 refactored to use vendored shell framework. lets test. 2025-07-14 12:34:33 -05:00
mrcharles a710fc7b4e removed debugging bits 2025-07-14 11:04:21 -05:00
mrcharles c6e458de8b . 2025-07-14 11:03:08 -05:00
mrcharles e31bab4162 . 2025-07-14 11:01:19 -05:00
mrcharles 86740b8c7d . 2025-07-14 10:59:32 -05:00
mrcharles f585f90b7f . 2025-07-14 10:55:54 -05:00
mrcharles 24c10b6f35 it hallucinated print_header 2025-07-14 10:50:42 -05:00
mrcharles 634a998d7e testing 2025-07-14 10:48:59 -05:00
mrcharlesandClaude a632e7d514 Implement comprehensive two-factor authentication for SSH and web services
- Complete rewrite of secharden-2fa.sh with full 2FA implementation
- SSH 2FA using Google Authenticator with publickey + TOTP authentication
- Cockpit web interface 2FA with custom PAM configuration
- Webmin 2FA support with automatic detection and configuration
- User setup automation with QR codes and backup codes generation
- Gradual rollout support using nullok for phased deployment
- Automatic configuration backup and restore procedures
- Add 2fa-validation.sh security test for comprehensive validation
- Create TSYS-2FA-GUIDE.md with complete implementation documentation
- Add DEVELOPMENT-GUIDELINES.md with coding standards and best practices
- Optimize package installation with single apt-get commands for performance

The 2FA implementation provides enterprise-grade security while maintaining
usability and proper emergency access procedures. Includes comprehensive
testing, documentation, and follows established security best practices.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 10:23:07 -05:00
mrcharles 6609d7d9e3 sigh. 2025-07-11 11:52:28 -05:00
mrcharles 0588b2dd60 ifdev for dev boxes, they have less hardened ssh config because vscode remote etc 2025-07-11 11:48:53 -05:00
mrcharles f2dc2ce29e automation. no prompts! 2025-07-02 18:52:43 -05:00
mrcharles d1ef7118d5 debian fails... let's see if this fixes it. 2025-07-02 18:47:21 -05:00
mrcharles 160d1b26cc fixed in ubuntu. will test on debian next. 2025-07-02 18:44:46 -05:00
mrcharles ce5bb0be6f . 2025-07-02 18:43:18 -05:00
mrcharles ce1bf7d220 i think this is right... 2025-07-02 18:41:58 -05:00
mrcharles 0175a00458 got to handle the other condition... 2025-07-02 18:25:31 -05:00
mrcharles 0f52d19229 remove debugging 2025-07-02 18:21:56 -05:00
mrcharles 0937036155 had inverse logic. fixed. still shouldn't have caused script to error though... hmm... 2025-07-02 18:15:03 -05:00
mrcharles 02a874f713 . 2025-07-02 18:10:47 -05:00
mrcharles 259a4f07b7 got further . hmm... 2025-07-02 18:09:06 -05:00
mrcharles f06d8b1fe5 ok. i think this is the last of the regressions. 2025-07-02 18:06:26 -05:00
mrcharles d76613c0dc . 2025-07-02 18:00:01 -05:00
mrcharles 5deaecd79f . 2025-07-02 17:57:44 -05:00
mrcharles c58c3f116e . 2025-07-02 17:55:56 -05:00
mrcharles e4e1c66111 . 2025-07-02 17:52:14 -05:00
mrcharles d60c03b116 some more resillience 2025-07-02 17:45:56 -05:00
mrcharles 6cdc7bbba7 this code is going to be quite resillient when done.. 2025-07-02 17:43:17 -05:00
mrcharles 197d8e2d27 ubuntu bug workaround 2025-07-02 12:23:31 -05:00
mrcharles 7457db098f . 2025-07-02 08:15:55 -05:00
mrcharles 109acf07be . 2025-07-02 08:14:06 -05:00
mrcharles 86cded93c5 . 2025-07-02 08:11:26 -05:00
mrcharles ce45ec1684 . 2025-07-02 08:08:16 -05:00
mrcharles 15074a99f4 . 2025-07-02 08:07:45 -05:00
mrcharles 982389fb63 . 2025-07-02 07:56:53 -05:00
mrcharles ede6aa0562 no more curl 2025-07-02 07:54:13 -05:00