CrowdStrike / falcon-scripts

Scripts to streamline the deployment and use of the CrowdStrike Falcon sensor
The Unlicense
149 stars 89 forks source link

Refactor Falcon Linux Installer Script for better support #180

Closed carlosmmatos closed 1 year ago

carlosmmatos commented 1 year ago

Fixes #179

This pull request includes a set of optimizations and refactorings to the Falcon Linux installer script, improving both its efficiency and maintainability.

Changes introduced:

  1. API Request URL Update: The API request URL was updated to include a version sorting parameter. This allows us to handle the versioning in a simpler way, reducing the complexity of the code.

  2. Installer Detection Logic Refactoring: The installer detection logic was refactored to reduce its complexity. This change simplifies the code and makes it more readable and maintainable.

  3. Descriptive Error Messages: The error messages were adjusted to be more descriptive and specific. This helps in better identifying the issues when errors occur.

  4. Amazon Linux Version Handling: The handling of Amazon Linux versions was revamped. The new code correctly identifies Amazon Linux 1 versions (i.e., 2018.03, 2017.09, etc.) and differentiates them from Amazon Linux 2 and newer versions.

This refactoring not only simplifies the code, but also makes it more resilient to potential issues in the future. Please review and provide your feedback.