Commit Graph

318 Commits

Author SHA1 Message Date
Andrew Pease be36553168 Replace old logo with new logo in README
Updated logo image in README.md.
2025-12-11 11:29:24 -06:00
Andrew Pease 97442e51c7 Update STACK_VERSION to 9.2.2 2025-12-11 10:39:59 -06:00
Andrew Pease 9b48e37035 Remove bash script reference from docstring
- No longer a 'port' - this is now the primary implementation
- Remove reference to elastic-container.sh bash script
2025-12-01 14:42:02 -06:00
Andrew Pease 80c42a1c5e Merge branch 'python-conversion' of github.com:peasead/elastic-container into python-conversion 2025-12-01 14:29:00 -06:00
Andrew Pease 84e48b85c3 Update README with Python venv command and usage
Updated Python virtual environment creation command and changed Elastic Stack version in the .env file. Added usage instructions for the elastic-container.py script.
2025-12-01 14:27:37 -06:00
Andrew Pease c969b7d227 Clean up CLI help output formatting
- Simplify CLI docstring to avoid duplicate command listings
- Remove verbose command descriptions from main help text
- Click automatically generates clean command list from decorators
- Results in cleaner, more professional help output
2025-12-01 14:18:08 -06:00
Andrew Pease b6a1f7d053 Remove 'READY SET GO!' message for professional output
- Replace 'READY SET GO!' with 'Elastic Stack started successfully'
- More professional and consistent with other command outputs
2025-12-01 14:15:20 -06:00
Andrew Pease 3c21bd7d14 Fix Detection Engine timeouts and standardize command output
Detection Engine improvements (kibana_manager.py):
- Increase prepackaged rules installation timeout: 60s → 180s
- Increase bulk enable rules timeout: 60s → 120s
- Fixes timeout errors when installing ~1400 prebuilt detection rules
- Rules install successfully even with previous timeout, this eliminates warnings

Output formatting improvements (docker_manager.py):
- Remove bash-style separators (##### lines)
- Standardize all command output to match 'start' command style
- Use consistent cyan for actions, green for success
- Add blank lines before final success messages
- Commands affected: stop, destroy, restart, stage
2025-12-01 13:40:08 -06:00
Andrew Pease 9ff4c0a994 Remove bash script - Python implementation is now primary
- Delete elastic-container.sh
- Python script (elastic-container.py) fully replaces bash functionality
- Tested on macOS, Ubuntu, and Rocky Linux
- All features working: intelligent container detection, Detection Engine, Fleet Server
2025-11-25 14:19:47 -06:00
Andrew Pease 257dee3dec Update README with Rocky Linux support and tested platforms
- Add Rocky Linux to tested platforms list
- Fix RPM distributions Docker installation instructions
  - Use Docker's official repository instead of distro packages
  - Add docker-ce installation steps for proper compose plugin support
- Update Operating System section with specific tested distributions
- Maintain consistent formatting across all OS sections
- Remove untested platforms (Arch, Windows native)
2025-11-25 14:07:05 -06:00
Andrew Pease 567ade6158 Add cross-platform IP detection with WSL support
- Add _is_wsl() helper function to detect Windows Subsystem for Linux
  - Checks /proc/version for microsoft/wsl keywords
  - Checks WSL environment variables (WSL_DISTRO_NAME, WSL_INTEROP)

- Enhance get_host_ip() to support all platforms:
  - Native Linux: hostname -I (unchanged)
  - WSL: Automatically detected, uses hostname -I
  - macOS: ifconfig en0 (unchanged)
  - Native Windows: Parse ipconfig output for IPv4 address
  - Fallback: 0.0.0.0 for local Docker (unchanged)

- No changes to existing Linux/macOS behavior
- Script now automatically adapts to environment
- Tested and working on macOS and Ubuntu
2025-11-25 12:45:04 -06:00
Andrew Pease 37e7f9a771 Update README for Python implementation
- Replace all bash script documentation with Python
- Add Python 3.10+ requirement prominently
- Add platform-specific installation instructions:
  - macOS with Homebrew
  - Ubuntu/Debian with deadsnakes PPA
  - Fedora/RHEL/Rocky/CentOS
  - Windows WSL2
- Add virtual environment setup for each platform
- Document all Python commands (start, stop, restart, status, etc.)
- Add intelligent start behavior documentation
- Add --force-setup flag documentation
- Add command reference table
- Enhance troubleshooting section for Python issues
- Add project structure section
- Remove bash-specific content (script is still in repo for reference)
2025-11-24 15:35:21 -06:00
Andrew Pease b2807465cd Phase 6: Add intelligent container state detection
- Add check_containers_exist() method to DockerManager
  - Detects if containers exist and if they're running
  - Returns tuple (containers_exist, containers_running)

- Enhance start command with smart behavior:
  - Already running: instant exit (no-op)
  - Stopped: quick start without reconfiguration (~30 sec)
  - Not exist: full setup with Detection Engine and Fleet (~5 min)
  - Add --force-setup flag to force reconfiguration

- Enhance stop command:
  - Already stopped: instant exit (no-op)
  - Not exist: helpful error message

- Enhance restart command:
  - Not exist: error with guidance to run start
  - Stopped: starts containers instead of restarting
  - Running: normal restart behavior

- Major improvement: subsequent starts are 10x faster
- Better user experience with clear status messages
- Idempotent operations - safe to run multiple times
2025-11-24 14:24:15 -06:00
Andrew Pease 99208cac34 Phase 5: Add main CLI entry point
- Create elastic-container.py as the main executable script
  - Click-based command-line interface
  - Commands implemented: stage, start, stop, destroy, restart, status, clear, help
  - Support for -v/--verbose flag across all commands
  - Full orchestration of Config, DockerManager, and KibanaManager

- Main 'start' command workflow:
  - Check prerequisites (Python version, Docker)
  - Validate passwords changed from defaults
  - Start containers via DockerManager
  - Configure Detection Engine and install rules via KibanaManager
  - Wait for Fleet Server initialization
  - Configure Fleet Server settings and agent policies
  - Display success message with login URL and credentials (verbose mode)

- All commands include:
  - Proper error handling and user-friendly messages
  - Keyboard interrupt (Ctrl+C) handling
  - Verbose mode with detailed output and stack traces
  - Consistent exit codes

- Add .gitignore for Python artifacts and sensitive files

- 344 lines completing the Python conversion
- Full feature parity with bash script achieved
2025-11-24 12:58:29 -06:00
Andrew Pease 5af2203103 Phase 4: Add Kibana and Fleet configuration module
- Create KibanaManager class for Detection Engine and Fleet setup
  - configure_detection_engine() method:
    - Wait for Kibana to be ready with retry logic
    - Enable Detection Engine API
    - Install prepackaged detection rules
    - Bulk enable rules by OS (Linux/Windows/macOS)

  - setup_fleet() method:
    - Check if Fleet is already initialized
    - Extract and configure CA certificate fingerprint
    - Configure Fleet Server host URLs
    - Set up Elasticsearch output with SSL verification
    - Create default agent policy with monitoring
    - Install Elastic Defend integration with EDRComplete preset

- Full API integration with Kibana Fleet and Detection Engine APIs
- Comprehensive error handling with helpful messages
- Support for verbose logging mode
- 475 lines implementing bash script parity
2025-11-24 12:52:03 -06:00
Andrew Pease 27001122eb Phase 3: Add Docker and utility modules
- Create DockerManager class for all container operations
  - Auto-detect docker compose vs docker-compose
  - Implement stage, start, stop, destroy, restart, status
  - Add clear_documents() for data stream clearing
  - Extract CA fingerprint for Fleet configuration
  - Comprehensive error handling and validation

- Create utility functions module
  - get_host_ip() for Linux/macOS IP detection
  - check_python_version() requiring 3.10+
  - run_command() helper with verbose support
  - show_docker_error() for formatted error messages
  - check_prerequisites() for system validation
2025-11-24 12:49:26 -06:00
Andrew Pease 1981c72e19 Phase 2: Add configuration management module
- Create Config class to load and validate .env file
- Validate passwords are changed from default 'changeme'
- Provide type-safe access to all configuration values
- Support detection rule flags (Linux/Windows/macOS)
- Helpful error messages for missing or invalid config
2025-11-20 08:42:04 -06:00
Andrew Pease 31800837a5 Phase 1: Add Python project foundation
- Add requirements.txt with click, requests, python-dotenv
- Create lib/ package structure with __init__.py
2025-11-20 08:39:03 -06:00
Andrew Pease 92f7df3f83 Merge pull request #61 from OtterHacker/main
Change elastic agent docker path
2025-10-09 16:02:16 -05:00
Andrew Pease d57cd81ab5 Update access instructions in README.md
Clarified instructions for accessing the application.
2025-10-09 15:56:09 -05:00
Andrew Pease 3f8c8dfe9f Revise login credentials in README
Updated login instructions for accessing the application.
2025-10-09 15:55:41 -05:00
Andrew Pease 05d82ac210 Merge pull request #62 from eric-forte-elastic/user_pass_restrict_to_verbose
[FR] Restrict User Pass Info Echo to Verbose
2025-10-09 15:54:58 -05:00
eric-forte-elastic 5d09baca1e Restrict user pass info echo to verbose mode 2025-10-09 16:43:01 -04:00
OtterHacker c016e746ba Merge pull request #1 from OtterHacker/OtterHacker-patch-1
Fix Elastic Agent Docker image pull path
2025-09-20 09:29:48 +02:00
OtterHacker 8405eef86a Fix Elastic Agent Docker image pull path 2025-09-20 09:29:10 +02:00
Colson Wilhoit bf9ebca3fa Merge pull request #58 from koelslaw/patch-1
Update .env to resolve Kibana ESA-2025-07
2025-05-07 10:08:01 -05:00
Kirk K b03392cce8 Update .env
resolve https://discuss.elastic.co/t/kibana-8-17-6-8-18-1-or-9-0-1-security-update-esa-2025-07/377868
2025-05-07 08:41:18 -05:00
Colson Wilhoit 371790d5fb Merge pull request #57 from webhead404/stack-v9
updates elastic to version 9
2025-05-03 10:28:11 -05:00
webhead404 073ff811de boolean not string 2025-05-02 21:28:56 -05:00
webhead404 f23cb184ce set default fleet server to true 2025-05-02 21:28:10 -05:00
webhead404 ab19ff61af updates elastic to version 9 2025-05-02 16:37:07 -05:00
Andrew Pease 2fff5fb9a9 Merge pull request #46 from desertSniper87/main
[master] Update README.md to add JVM heap size
2025-04-02 13:59:30 -05:00
Colson Wilhoit 35ae6ce165 Update .env 2025-02-11 11:47:55 -06:00
Colson Wilhoit b917a1b000 Merge pull request #53 from joaogabriel01/main
feat: add required applications check to start command flow
2025-01-15 10:14:28 -06:00
Colson Wilhoit 16a7bfb151 Update .env 2024-12-07 01:09:08 -06:00
Colson Wilhoit 16fe78e482 Update .env 2024-11-12 19:55:48 -06:00
João Azevedo aade962323 feat: add required applications check to start command flow 2024-10-30 23:25:54 -03:00
Colson Wilhoit dde3cd3e6a Update .env 2024-09-09 10:42:51 -05:00
Colson Wilhoit a676895787 Update elastic-container.sh 2024-09-04 15:46:23 -05:00
Colson Wilhoit a4dbd8c635 Update .env 2024-08-26 11:32:04 -05:00
Colson Wilhoit 4ae2544d72 Update .env 2024-08-06 09:26:47 -05:00
Andrew Pease d4d3782c54 Merge pull request #48 from kOld/main
Preserve fleet state on restarts and only setup fleet when needed
2024-07-28 14:17:23 -05:00
Élio Severiano be5139063c Preserve fleet state across restarts 2024-07-27 20:01:33 +01:00
Élio Severiano 9e7f13df0e Only setup fleet when needed 2024-07-27 19:59:56 +01:00
Andrew Pease 05c0b91a36 Update README.md 2024-07-03 14:25:03 -05:00
Andrew Pease 5c0ff3346b Update .env 2024-07-03 14:10:10 -05:00
Andrew Pease 72e2879d63 Merge pull request #47 from peasead/issue-44
Update README.md
2024-07-01 22:48:18 -05:00
Andrew Pease 0ef92f1e7b Update README.md 2024-07-01 22:48:03 -05:00
Samidhya Sarker 528d40c8f0 [master] Update README.md to add JVM heap size 2024-06-28 00:42:38 +06:00
Colson Wilhoit f74129a546 Update README.md 2024-06-06 13:02:11 -05:00