14 Commits

Author SHA1 Message Date
GraceSolutions 1d21e707b9 Configure default SSH shell with precedence: PS7 > PS5 > unchanged
- Checks for PowerShell 7 at Program Files\PowerShell\7\pwsh.exe
- Falls back to PowerShell 5 at System32\WindowsPowerShell\v1.0\powershell.exe
- Leaves default shell unchanged if neither found
- Sets HKLM\SOFTWARE\OpenSSH\DefaultShell registry value
- Sets DefaultShellCommandOption to '-NoLogo -NoProfile -Command'
- Idempotent: only updates registry if value differs
2026-05-05 17:20:31 -04:00
GraceSolutions dc57ef82fc Change auth methods to opt-out, keep key generation opt-in
Authentication methods now ENABLED by default (opt-out):
- -DisablePubkeyAuthentication (was -EnablePubkeyAuthentication)
- -DisablePasswordAuthentication (unchanged)
- -DisableCertificateAuthentication (was -EnableCertificateAuthentication)

Key generation remains OPT-IN:
- -GenerateKeyPair still requires explicit use

Config changes:
- All auth settings now idempotent (only modify if value differs)
- Certificate auth auto-enables if CA bundle exists
- Disabling cert auth comments out TrustedUserCAKeys line

Updated README with new parameter names and examples
2026-05-04 19:58:41 -04:00
GraceSolutions bb1d0d7420 Use Win32_UserProfile.Loaded to check if user hive is loaded
- Query Win32_UserProfile by SID instead of Test-Path on registry
- Win32_UserProfile.Loaded property explicitly indicates hive status
- Added -Verbose:$False to suppress CIM query output
- Improved logging to show Loaded property value
2026-05-04 10:55:12 -04:00
GraceSolutions 30baf5e70e Fix: Read session user certs from registry, not process identity
- Cert:\CurrentUser resolves to PROCESS identity, not session user
- Now reads directly from HKEY_USERS\{SID}\Software\Microsoft\SystemCertificates\
- Parses certificate blobs from Root and CA store registry keys
- Only attempts if CurrentUserSession is available and hive is loaded
- Skips invalid certificate blobs gracefully
2026-05-04 10:52:17 -04:00
GraceSolutions 903d87acf4 Access logged-in user's certificate store when running as SYSTEM
- Check if user's registry hive is loaded under HKEY_USERS\{SID}
- Use X509Store to access user's Root and CA stores via CurrentUserSession.SID
- Fallback to current process identity if user hive not loaded
- Log which user's certificates are being accessed
- Properly dedupe certificates from all stores by thumbprint
2026-05-04 10:48:38 -04:00
GraceSolutions 103181eedc Suppress CIM verbose, add CurrentUser CA stores, dedupe certificates
- Suppress Get-CIMInstance verbose output in Toolkit.ps1 with -Verbose:$False
- Add CurrentUser Root and CA stores alongside LocalMachine stores
- Dedupe certificates by Thumbprint (Sort-Object -Unique)
- Suppress verbose from Process Select-Object (triggers WMI queries)
- Use explicit property list instead of wildcard for process object
2026-05-04 10:45:47 -04:00
GraceSolutions b0a68e3324 Use __PROGRAMDATA__ variable in sshd_config and limit backups to 3
- TrustedUserCAKeys now uses __PROGRAMDATA__/ssh/... (portable path)
- Backup cleanup: keeps only the last 3 sshd_config backups
- Removes older backups automatically after creating new one
2026-05-04 10:35:18 -04:00
GraceSolutions c10b19fa6e Remove unnecessary individual PEM exports for CA bundle
- Removed -Export switch when creating CA bundle (only bundle is needed)
- Individual certificate directories and PEM files are no longer created
- Only the combined CA bundle file is written to disk
- Updated Example 4 documentation to reflect correct usage
2026-05-04 10:22:27 -04:00
GraceSolutions 40de4368d7 Fix RSABCrypt to RSACng cast error in certificate PEM conversion
- Wrapped CNG key casting in try/catch for both public and private key extraction
- RSABCrypt and other non-CNG implementations now gracefully skip key blob export
- Certificate PEM blob still generated correctly (only separate key blobs affected)
- Demoted public key extraction failure from Warning to Verbose (non-critical)
- Added informative message about key implementation type on failure
2026-05-04 10:09:48 -04:00
GraceSolutions 03a3912a29 Fix TimeSpan error and firewall profile enumeration
- Added ExecutionTimeout and ExecutionTimeoutInterval to ssh-keygen calls (2 min timeout)
- Added ExecutionTimeout and ExecutionTimeoutInterval to sshd -t validation (30 sec timeout)
- Fixed firewall profile enumeration: use string array instead of unavailable type
- Profiles now use simple array: @('Domain', 'Private', 'Public')
2026-05-04 09:39:39 -04:00
GraceSolutions e566ab15f1 Automatic service management and Windows Firewall rules
- Service auto-start and start now happen automatically (no switches)
- Windows Firewall rules created automatically per profile (Domain, Private, Public)
- Dynamic profile enumeration using [Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetSecurity.Profile]
- Added -SSHPort parameter for custom port (default: 22)
- Idempotent firewall rule creation with update support
- Removed -EnableService and -StartService switches (now automatic)
2026-05-01 15:21:54 -04:00
GraceSolutions 825dfdab79 Enhanced OpenSSH configuration with certificate auth, service management, and security features
Features added:
- Certificate authentication with Windows CA trust bridge
- CA filtering via regex inclusion/exclusion expressions
- Password authentication disable option
- Service auto-start and start management
- Config backup before modification (timestamped)
- Config validation (sshd -t) with automatic rollback on failure
- SFTP subsystem configured by default
- Public key management with deduplication
- Key pair generation (ed25519, rsa, ecdsa)

Toolkit enhancements:
- ConvertFrom-CertificateToPEM: Added -IncludePrivateKey, -ThumbprintList, -CreateCABundle
- Updated coding standards in PowershellScripts.md

Documentation:
- Comprehensive README with examples and troubleshooting
- Added .augment folder to .gitignore
2026-05-01 15:17:43 -04:00
GraceSolutions cd982938d3 Detection, Download, and Installation Framework Completed 2026-04-30 20:30:01 -04:00
freedbygrace 0f88d07876 Initial commit 2026-04-30 11:10:23 -04:00