Skip to content

feat: add bash classifier#2055

Merged
kzantow merged 1 commit into
anchore:mainfrom
witchcraze:1963_add-bash-binary-classifier
Aug 24, 2023
Merged

feat: add bash classifier#2055
kzantow merged 1 commit into
anchore:mainfrom
witchcraze:1963_add-bash-binary-classifier

Conversation

@witchcraze
Copy link
Copy Markdown
Contributor

This PR adds a binary cataloger for bash

  • As I can not judge version of alpha/beta (alpha1 or alpha2) in version information, alpha/beta/rc is not desplayed

Fixes #1963

Signed-off-by: witchcraze <witchcraze@gmail.com>
// @(#)Bash version 5.2.0(1) alpha GNU
// @(#)Bash version 5.2.0(1) beta GNU
// @(#)Bash version 5.2.0(1) rc4 GNU
`(?m)@\(#\)Bash version (?P<version>[0-9]+\.[0-9]+\.[0-9]+)\([0-9]\) [a-z0-9]+ GNU`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this regex need the end bits [a-z0-9]+ GNU?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nice thing about having the suffix you highlighted is that it's more specific, which means we have less chance of matching something that is not bash. The possible downside is if there are other builds of bash that might not have this suffix. My vote is to leave it as specific as possible until we find evidence that we're missing other builds that don't have this suffix.

Copy link
Copy Markdown
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution @witchcraze 👍

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.

Add support to detect bash binaries

3 participants