T09 · Insecure Skill Coding Practices
- Location
scripts/install.sh:96- Finding
Malformed redirections prevent security configuration and scheduled monitoring from being installed
- Content
View full analysis
/etc/ssh/sshd_config # Security hardening (added by vps-security-hardening) Port $SSH_PORT PermitRootLogin no PasswordAuthentication no MaxAuthTries 3 ClientAliveInterval 300 ClientAliveCountMax 2 X11Forwarding no EOF ``` ```bash # scripts/install.sh:186-197 cat > /etc/cron.d/agent-security <> 'EOF' # VPS Security Hardening - Automated Tasks # Daily briefing at 08:00 0 8 * * * root $SKILL_DIR/scripts/daily-briefing.sh # Log size check every 6 hours 0 */6 * * * root $SKILL_DIR/scripts/audit-log-monitor.sh # Weekly security report (Sundays) 0 9 * * 0 root $SKILL_DIR/scripts/weekly-report.sh EOF ``` ```bash # scripts/daily-briefing.sh:65-95 cat <> EOF 📊 *DAILY SECURITY BRIEFING* *Date:* ${date} *Status:* ${risk_level} ━━━━━━━━━━━━━━━━━━━━━━━ 🛡️ *SECURITY SUMMARY* ━━━━━━━━━━━━━━━━━━━━━━━ 🔐 Credential Access: ${cred_access} 📝 SSH Config Changes: ${ssh_changes} 🔑 SSH Keys Accessed: $(ausearch -ts today -k agent_ssh_keys 2>/dev/null | grep -c 'type=PATH' || echo 0) 🚪 Successful Logins: ${successful_logins} 🚫 Failed Logins: ${failed_logins} 🧱 Firewall Changes: $(ausearch -ts today -k agent_firewall 2>/dev/null | grep -c 'type=PATH' || echo 0) ━━━━━━━━━━━━━━━━━━━━━━━ ⚡ *ACTIVITY SUMMARY* ━━━━━━━━━━━━━━━━━━━━━━━ 🤖 Agent Directory Changes: ${file_changes} ⚠️ Privilege Escalation Attempts: ${priv_esc} 📁 Security Repo Changes: $(ausearch -ts today -k agent_security_repo 2>/dev/null | grep -c 'type=PATH' || echo 0) ━━━━━━━━━━━━━━━━━━━━━━━ 📈 *RISK ASSESSMENT* ━━━━━━━━━━━━━━━━━━━━━━━ Score: ${risk_score}/100 Level: ${risk_level} ``` ### Technical Analysis The correct heredoc syntax is `cat <>file <` operator instea ...[truncated 2037 chars]- Remediation
View remediation
> /etc/ssh/sshd_config < /etc/cron.d/agent-security <
