Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve fluent-bit binary detection regex pattern #3701

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

popey
Copy link
Contributor

@popey popey commented Mar 2, 2025

Description

This PR fixes an issue with the binary classifier for fluent-bit, which currently fails to detect certain versions (1.7.0-dev-3 through 1.7.0-dev-9 and 1.7.0-rc4 through 1.7.0-rc8). The problem was in the regex pattern that didn't account for ANSI escape sequences, multiple null bytes, and optional "%s" format specifiers that appear in these versions.

The fix updates the regex pattern to be more inclusive of all these variants, allowing Syft to correctly identify these previously undetectable fluent-bit binaries.

Fixes #3133

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

This fixes issue #3133 by updating the regex pattern for fluent-bit binary detection
to better handle ANSI escape sequences and multiple null bytes between the version
string and "Fluent Bit" text. The change also makes the %s format specifier optional,
supporting all variations in fluent-bit binary signatures.

Signed-off-by: Alan Pope <[email protected]>
@popey popey force-pushed the fix-fluent-bit-detection branch from 832d6c1 to aa2dcf5 Compare March 2, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support fluent-bit 1.7.0 dev, rc
1 participant