Skip to content

feat: auto-scan containers, tunnel stability, and SSH container proxy#72

Merged
hsinatfootprintai merged 1 commit intomainfrom
feat--auto-rescan
Mar 30, 2026
Merged

feat: auto-scan containers, tunnel stability, and SSH container proxy#72
hsinatfootprintai merged 1 commit intomainfrom
feat--auto-rescan

Conversation

@hsinatfootprintai
Copy link
Copy Markdown
Contributor

ClamAV Auto-Scan

  • Subscribe to container creation events and auto-enqueue ClamAV scan after 2-minute delay (previously waited 24h for next scan cycle)

Tunnel SSH Stability

  • Close yamux session on context cancel for clean shutdown
  • Close write side of TCP connections in bidirectional proxy to properly propagate EOF (fixes SSH connections hanging/dropping)
  • Apply fix on both tunnel client and tunnel server sides

SSH Container Proxy

  • Add Containarium ASCII banner to containarium-shell for interactive sessions
  • Show container name, user, IP, and host in banner
  • Extract eth0 IP correctly (skip Docker bridge)
  • Create .hushlogin for new users to suppress host MOTD
  • Setup script: auto-configure sudoers, sshd MOTD suppression, and banner

## ClamAV Auto-Scan
- Subscribe to container creation events and auto-enqueue ClamAV scan
  after 2-minute delay (previously waited 24h for next scan cycle)

## Tunnel SSH Stability
- Close yamux session on context cancel for clean shutdown
- Close write side of TCP connections in bidirectional proxy to
  properly propagate EOF (fixes SSH connections hanging/dropping)
- Apply fix on both tunnel client and tunnel server sides

## SSH Container Proxy
- Add Containarium ASCII banner to containarium-shell for interactive sessions
- Show container name, user, IP, and host in banner
- Extract eth0 IP correctly (skip Docker bridge)
- Create .hushlogin for new users to suppress host MOTD
- Setup script: auto-configure sudoers, sshd MOTD suppression, and banner

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// Success!
// Success! Create .hushlogin to suppress host MOTD (user lands in container via containarium-shell)
hushPath := filepath.Join("/home", username, ".hushlogin")
_ = os.WriteFile(hushPath, nil, 0644)

Check failure

Code scanning / gosec

Expect WriteFile permissions to be 0600 or less Error

Expect WriteFile permissions to be 0600 or less
// Close session when context is cancelled (enables clean shutdown)
go func() {
<-ctx.Done()
session.Close()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
io.Copy(localConn, stream)
// Close write side of local conn to signal EOF
if tc, ok := localConn.(*net.TCPConn); ok {
tc.CloseWrite()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
io.Copy(stream, localConn)
// Close write side of stream to signal EOF
if cs, ok := stream.(interface{ CloseWrite() error }); ok {
cs.CloseWrite()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
go func() {
io.Copy(stream, localConn)
if cs, ok := stream.(interface{ CloseWrite() error }); ok {
cs.CloseWrite()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
go func() {
io.Copy(localConn, stream)
if tc, ok := localConn.(*net.TCPConn); ok {
tc.CloseWrite()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
@hsinatfootprintai hsinatfootprintai merged commit ec74129 into main Mar 30, 2026
4 of 5 checks passed
@hsinatfootprintai hsinatfootprintai deleted the feat--auto-rescan branch March 30, 2026 02:29
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.

3 participants