The language matrix in the .github/workflows/codeql.yml file has been updated to only include 'go'. This change removes the 'javascript-typescript' option to focus solely on Go code analysis and enhance the efficiency of the workflow process.
The Autobuild command in the .github/workflows/codeql.yml file has been commented out due to possible build failure. Instead, a new run command is added to manually build the application using Go. This change allows for more control and reliability on the build process.
A new file, LICENSES/CC0-1.0.txt, has been created to provide the Creative Commons Zero v1.0 Universal license for the project. Additionally, SPDX headers specifying the MIT license and copyright details have been added to each of the GitHub workflow files, enhancing the clarity and compliance of the project's license utilization.
Added SECURITY.md with details for vulnerability reporting and encryption. Introduced new workflows for dependency review, Scorecard supply-chain security, and CodeQL analysis. Made amendments to docker-publish.yml for better Docker build and publishing process. These enhancements are aimed towards improving the security stance and the efficiency of CI/CD workflows.
All project references have been updated to point to the appropriate routes for the GitHub repository, replacing the previously used paths to src.neessen.cloud. This includes changes in README.md, Dockerfile, go mod packaging as well as in the source code where required.
The Go version in the .golangci.toml has been updated from 1.20 to 1.22. This update ensures that our project stays up-to-date with the latest stable version of Go, providing new features and improvements.
Module references within 'go.mod', 'main.go', and various plugin files have been changed from 'github.com/wneessen/logranger' to 'src.neessen.cloud/wneessen/logranger'. This update is essential to align with the new source location and ensure code and plugins function as expected. The Dockerfile’s commands have also been updated accordingly.
The Hyperlinks for the GoDoc, Go Report Card, and REUSE status badges in README.md were updated to align with the new source location. This change ensures the badges direct to the correct and current repository, providing accurate and updated information.
The copyright year was updated to reflect changes in ownership duration and hyperlink references for badges were updated to match the new source location. This enhances accuracy and ensures that the links reflect the most current repository location.
The source information in the README.md has been revised for enhanced readability. The URL currently served as a mirror for our Github repository has been shifted to a new line for better visibility and comprehension.
A new ReloadConfig function has been added to the Server in server.go which reloads server configurations and updates the Server's conf field as well as the configured Ruleset. Changes have also been made to the handling of the SIGHUP signal in main.go, using this new function to reload configurations and updating the logs accordingly.
New SPDX license headers have been added to `group.license` and `passwd.license` found within the `support-files` directory. These headers show that the files are licensed under the MIT license and copyrighted by Winni Neessen.
Introduced Dockerfile to manage the build process for the project, including its dependencies. This development will standardize the environment, thus making it easier for others to build and run the app. Also added necessary 'passwd' and 'group' files in 'support-files' directory for managing user details in Docker.
Appended project badges in the README file to provide quick project status checks and important links. These include badges for GoDoc, Go Report Card, Discord, REUSE status, and a Ko-fi donation button, fostering easy navigation and interaction for the project users and contributors.
Expanded the README file to include a detailed description of Logranger project's purpose, features, available plugins and support. This provides a comprehensive overview of the project for new or prospective users and contributors, offering insights on its functionality, customization features, efficient log processing, and rule-based filtering capabilities.
Changed the processing of log messages to run in a separate go routine, improving the performance of the server. This update ensures efficient log processing by allowing multiple log messages to be processed concurrently. The function has also been refactored to not return an error as any issues should be contained within the routine call itself.
Added a new function to process log messages and match them against the ruleset. This function will also handle action execution when a match is found. Additionally, added error handling and a layer of fault tolerance within the action configuration process. As a result, if an error arises while configuring an action, the error is logged and skipped, allowing for the rest of the actions to execute.
Updated the action configuration process in server.go to skip an action if its configuration results in an error. This ensures that the remaining actions can still execute, even if one fails during the configuration stage. File action plugin specifically has been updated to support this skip on error logic.
Refactored the Action interface in the plugins package to separate the configuration step from the process method. The new Config method accepts a configuration map and returns an error. The modified server.go uses this Config method to apply configurations before calling Process. File action plugin specifically has been updated to support this new interface where configurations are now updated via Config method before invoking Process.
Implemented new template functions to allow conversion of strings to SHA-1, SHA-256, and SHA-512 hash formats, as well as base64 encoding. These changes include the creation of the SHAAlgo type and associated constants representing different SHA algorithms. The additional functionality will enhance template handling by adding more options for string encryption and encoding.
Introduced an Actions interface for plugins in 'action.go' and implemented a corresponding registry in 'registry.go'. Additionally, adjusted rule related behavior in 'Server' to account for actions, with relevant new fields in Ruleset and Rule. This enables multiple actions on a log message based on defined rules and further modularises the codebase, paving the path for addition of more plugin actions.
The Ruleset struct has been updated to include a 'HostMatch' field. A corresponding conditional block to handle 'HostMatch' was added in the 'Server' object's ruleset cycle. This allows the rules to include host-specific matches and debug information about matches found. Further expansion of this functionality can enable detailed rule application based on the target host.
An unnecessary line break in the server.go file was removed, which was situated between connection error handling and the read loop. Such spacing did not contribute to readability or function, hence impacting the overall code cleanliness.
Added a Ruleset configuration to the logranger application, along with associated error handling. The code now loads a ruleset file from configuration, checks for duplicate rules, and logs each rule as it is found. The ruleset is also integrated within the server setup. The PIDFile now includes a default RuleFile reference in config.go.
The provided diff includes an extra pattern to the .gitignore list - 'etc/*.local.*.toml'. This was done to ensure that all variations of local configuration files are ignored by Git, preventing them from being unnecessarily tracked.
The 'parser' struct in config.go has been updated with Fig configuration annotation. This allows ease of configuration as it sources the configuration options from the environment, making the code cleaner and more flexible.
The processing deadline handling was moved from the connection-level anonymous go-routine to the HandleConnection method. This refactor allows the reading from the connection to be looped, improving the handling of timeouts and parsing failure cases.
The comments for the 'ErrCertConfigEmpty' variable in error.go contained a typo. This has been corrected to more accurately reflect the error that is returned when a TLS listener is configured without setting certificate or key paths.
This update upgrades the go-parsesyslog dependency version to v0.2.2. It also enhances the server's connection handling. This is done by expanding the `HandleConnection` method to handle network errors and EOF scenarios more thoroughly, adjusting processing time measurements, and handling deadlines for connection processing. Furthermore, the initialization of the syslog parser has now been moved to the `NewServer` function for efficiency.
Introduced a new Connection struct and related functions in `connection.go` to facilitate network connections. Incorporated the `go-parsesyslog` package to parse incoming network data. Implemented functions in `server.go` to accept and handle incoming network connections, bolstering the application's network interaction functionality.
The .env file has been added to the .gitignore file to ensure it's not tracked in the git repository. This change helps to protect sensitive environment variable settings by preventing them from being inadvertently published within the project repository.
The logranger.toml file is moved to the 'etc' directory, and its pid_file location is updated. The .gitignore file is also edited to ignore local configuration files in the 'etc' directory to prevent them from being tracked. This creates a cleaner project structure and ensures local configurations are kept private.
The documentation for some methods in the server-related files (config.go, server.go, and listener.go) has been updated to provide more accurate and descriptive explanations of their functionality. Additionally, the New methods for Config and Server objects have been changed to reflect that they create instances of these objects. Some method functionalities like 'setLogLevel' in server.go have been extended for more accurate operation based on the config log level.