Security Manager
Comprehensive security management and monitoring tool for system hardening and threat detection.
Security Manager
A comprehensive tool for managing security aspects of Lambda Softworks' Linux automation scripts, including firewall configuration, encryption, monitoring, and compliance checks.
Features
- Firewall configuration and management
- Configuration file encryption
- Security monitoring and alerting
- Audit logging setup
- Automatic security incident response
- Security updates management
- System security scanning
- Compliance checking
Installation
- Download the script from the Lambda Softworks Customer Portal:
- Log in to your Lambda Softworks Customer Portal account
- Navigate to the Files section
- Download the security-manager.sh script
Prerequisites
- Bash shell
- Python 3 (for dashboard)
- jq (for JSON processing)
- yq (for YAML processing, optional)
- Root or sudo privileges
Installation Steps
- Clone the repository:
git clone https://github.com/yourusername/lambda-scripts.git cd lambda-scripts/admin-tools
- Make the script executable:
chmod +x security-manager.sh
- Install dependencies:
For Debian/Ubuntu:
sudo apt-get update sudo apt-get install -y python3 jq auditd ufw
For RHEL/CentOS:
sudo yum install -y python3 jq audit firewalld
Usage
Basic Commands
- Setup firewall:
sudo ./security-manager.sh --setup-firewall 10.0.0.0/8 192.168.1.0/24
- Enable security monitoring:
sudo ./security-manager.sh --enable-monitoring /etc/lambdasoftworks /opt/lambdasoftworks
- Setup audit logging:
sudo ./security-manager.sh --setup-audit detailed local2 90
Advanced Options
--encrypt-config DIR KEY
: Encrypt configuration files--auto-response BREACH ATTACK EMAIL
: Configure automatic responses--incident-response ACTION
: Handle security incidents--check-updates
: Check for security updates--apply-updates [--security-only]
: Apply security updates--scan TYPE [--include-deps] [--generate-report]
: Run security scan--compliance-check STANDARD [--generate-report]
: Run compliance check
Configuration
Security Configuration
# /etc/lambdasoftworks/security.yml security: # Access Control allowed_users: - root - lambdasoftworks allowed_groups: - lambdasoftworks - backup # Network Security allowed_networks: - 10.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16 # Encryption encryption: required: true minimum_strength: 256 algorithms: - aes-256-gcm - chacha20-poly1305 # Authentication auth: mfa_required: true password_policy: min_length: 16 require_special: true require_numbers: true max_age_days: 90 # Logging audit_logging: enabled: true retention_days: 90 syslog_facility: local2
Logs and Data Storage
Log File Location
/var/log/lambdasoftworks/security-manager.log
Backup Location
/etc/lambdasoftworks/backups/
Report Location
/var/log/lambdasoftworks/security-reports/
Cross-Platform Compatibility
Linux Support
- RHEL/CentOS 7+
- Ubuntu 18.04+
- Debian 10+
- Other Linux distributions with systemd
Service Support
- UFW/Firewalld
- Auditd
- Systemd
Examples
Security Setup
# Setup firewall sudo ./security-manager.sh --setup-firewall 10.0.0.0/8 192.168.1.0/24 # Enable monitoring sudo ./security-manager.sh --enable-monitoring /etc/lambdasoftworks /opt/lambdasoftworks # Setup audit logging sudo ./security-manager.sh --setup-audit detailed local2 90
Security Management
# Encrypt configuration sudo ./security-manager.sh --encrypt-config /etc/lambdasoftworks /etc/lambdasoftworks/keys/backup.key # Configure auto-response sudo ./security-manager.sh --auto-response lockdown block-ip admin@company.com # Run security scan sudo ./security-manager.sh --scan full --include-deps --generate-report
Troubleshooting
Common Issues
Permission Errors
- Ensure the script is run with sudo
- Check directory permissions
- Verify user has necessary privileges
Security Issues
- Verify security configurations
- Check firewall rules
- Review security logs
Report Generation Issues
- Check log directory permissions
- Verify HTML template access
- Check disk space
Debug Mode
To enable debug logging:
sudo DEBUG=1 ./security-manager.sh [OPTIONS]