How redborder/redborder-intrusion works
Project Type and Purpose
• The project is a packaged software tool intended for installing and managing the "redborder intrusion" system on Rocky Linux 9.
• It primarily serves as an intrusion detection solution (a variant of redborder-ips) but now using snort3 (and notably without barnyard2). It includes system initialization routines, configuration management (using Chef templates), and various operational scripts for managing sensor tasks.
• Since the product is distributed via an RPM (packaging and spec files are present), it’s designed for system-level deployment in enterprise/security environments.
File Structure for Architectural Clues
• There is a clear separation between packaging, deployment, and execution resources.
• Key directories and files:
• .github: Contains CI/CD workflows (e.g., rpm.yml) to automate builds and testing.
• packaging: Contains RPM packaging components including a spec file and Makefile for building the package.
• resources:
▫ bin: Contains shell scripts (e.g., rb_bypass.sh, rb_clean_logs_snort.sh, etc.) that are likely executable commands to control or interact with the intrusion detection system.
▫ lib: Contains various utility scripts and libraries written in Ruby and shell (such as rb_config_utils.rb, rb_functions.sh, wizard_helper.rb) which encapsulate configuration and operational logic.
▫ scripts: Contains Ruby scripts that automate tasks (such as sensor association, configuration initialization, and updates). These come together as supporting components for dynamic actions like initializing and setting up configuration via a wizard.
▫ systemd: Contains a service file (rb-init-conf.service) that integrates the intrusion detection tool with the system’s init system, ensuring that configurations and initialization are automatically applied on boot or triggered when needed.
• The top-level Makefile, VERSION, and LICENSE are also included for build management, version control, and legal clarity.
README for Additional Insights
• The README succinctly explains that this is the “Main package to install redborder intrusion” on Rocky Linux 9 and highlights its relationship to snort3.
• The installation instructions mention adding the redborder repository and installing via yum, emphasizing its packaging and deployment nature.
Main Components
a. Packaging & Deployment:
• RPM Packaging module (packaging/rpm and .github/workflows support) which builds and automates package deployment.
• Integration of the RPM via the build scripts and Makefile.
b. Core Execution & Management:
• Main executable script (resources/redborder-intrusion.sh) that likely acts as the central entry point.
• A collection of control scripts (in resources/bin) to perform operational duties (bypass, clean logs, update configurations, handle performance stats, etc.).
c. Configuration & Initialization:
• Libraries and helper scripts (resources/lib) that provide utility functions for configuration and management.
• Initialization scripts (resources/scripts) that may execute configuration routines, sensor association, and wizard-driven setups.
• Default configuration files (resources/etc) including Chef configuration files – these ensure that system configuration is dynamically applied.
d. Service Integration:
• The systemd integration (resources/systemd/rb-init-conf.service) indicates that part of the package includes auto-start and initialization on system startup.
e. External Dependencies & Integrations:
• Snort3 as the core intrusion detection mechanism.
• Chef for configuration management.
• Underlying Rocky Linux 9 environment and its service management.
Relationships and Interactions
• How the RPM packaging is built and deployed, feeding the system installation which then provides:
• A systemd-managed service (rb-init-conf) that kicks off configuration routines.
• A main executable script that, through a series of shell and Ruby scripts (located in the resources/bin, resources/lib, and resources/scripts directories), facilitates installation, configuration, and ongoing monitoring.
• That configuration files in resources/etc, including Chef JSON files, are consumed by the configuration scripts to dynamically adjust the behavior of the system.
• That the build pipelines from .github are responsible for validating and packaging the code before it is released to the repository for installation on Rocky Linux systems.