Skip to content

Commit

Permalink
feat: detect curl binaries (#3146)
Browse files Browse the repository at this point in the history
  • Loading branch information
krysgor authored Aug 23, 2024
1 parent 9ab3de1 commit cff9d49
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions syft/pkg/cataloger/binary/classifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,16 @@ func DefaultClassifiers() []Classifier {
PURL: mustPURL("pkg:generic/wp-cli@version"),
CPEs: singleCPE("cpe:2.3:a:wp-cli:wp-cli:*:*:*:*:*:*:*:*"),
},
{
Class: "curl-binary",
FileGlob: "**/curl",
EvidenceMatcher: FileContentsVersionMatcher(
`curl/(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`,
),
Package: "curl",
PURL: mustPURL("pkg:generic/curl@version"),
CPEs: singleCPE("cpe:2.3:a:curl:curl:*:*:*:*:*:*:*:*"),
},
}
}

Expand Down
9 changes: 9 additions & 0 deletions syft/pkg/cataloger/binary/test-fixtures/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,12 @@ from-images:
platform: linux/arm64
paths:
- /usr/local/openresty/openssl/bin/openssl

- name: curl
version: 8.9.1
images:
- ref: curlimages/curl:8.9.1@sha256:8addc281f0ea517409209f76832b6ddc2cabc3264feb1ebbec2a2521ffad24e4
platform: linux/amd64
paths:
- /usr/bin/curl

0 comments on commit cff9d49

Please # to comment.