anchore / syft

CLI tool and library for generating a Software Bill of Materials from container images and filesystems
Apache License 2.0
5.98k stars 551 forks source link

Support old bitnami/mariadb #3052

Open witchcraze opened 1 month ago

witchcraze commented 1 month ago

What would you like to be added:

Support mariadb in binary detection

Additional context:

$ syft bitnami/mariadb:10.4 | grep maria
 ✔ Pulled image
 ✔ Loaded image                                                                        bitnami/mariadb:10.4
 ✔ Parsed image                     sha256:18a0f5db9516679b4e1e9db0ab589b0fc6ad2d6e22f4201777ff7338814d2e53
 ✔ Cataloged contents                      e59632cb4797c83baaa353db6a75bc7b31dff776d0769072147901106a426369
   ├── ✔ Packages                        [112 packages]
   ├── ✔ File digests                    [5,057 files]
   ├── ✔ File metadata                   [5,057 locations]                                                   
   └── ✔ Executables                     [855 executables]                                                   
mariadb                       10.4.34                  binary
$
$ syft bitnami/mariadb:10.3 | grep maria
 ✔ Pulled image
 ✔ Loaded image                                                                        bitnami/mariadb:10.3
 ✔ Parsed image                     sha256:f64ab9dd66fedc1c14788558aae760b235e4e030c9416d62d739d719b953a8e9
 ✔ Cataloged contents                      ed3050cd7e88e377ef33e80c7cf27a06dc3118aa14e3a1bbbaecf557cd4b1584
   ├── ✔ Packages                        [109 packages]
   ├── ✔ File digests                    [3,499 files]                                                       
   ├── ✔ File metadata                   [3,499 locations]
   └── ✔ Executables                     [800 executables]
$
$ docker run -it --rm bitnami/mariadb:10.4 ls -la /opt/bitnami/mariadb/bin/mariadb
mariadb 06:24:42.27 INFO  ==>
mariadb 06:24:42.27 INFO  ==> Welcome to the Bitnami mariadb container
mariadb 06:24:42.27 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
mariadb 06:24:42.28 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
mariadb 06:24:42.28 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
mariadb 06:24:42.28 INFO  ==>

lrwxrwxrwx 1 root root 5 May 17 08:00 /opt/bitnami/mariadb/bin/mariadb -> mysql
$ docker run -it --rm bitnami/mariadb:10.3 ls -la /opt/bitnami/mariadb/bin/mariadb
mariadb 06:25:08.05
mariadb 06:25:08.06 Welcome to the Bitnami mariadb container
mariadb 06:25:08.06 Subscribe to project updates by watching https://github.com/bitnami/containers
mariadb 06:25:08.06 Submit issues and feature requests at https://github.com/bitnami/containers/issues
mariadb 06:25:08.06

ls: cannot access '/opt/bitnami/mariadb/bin/mariadb': No such file or directory
$ docker run -it --rm bitnami/mariadb:10.3 /opt/bitnami/mariadb/bin/mysql --version
mariadb 06:35:53.36
mariadb 06:35:53.36 Welcome to the Bitnami mariadb container
mariadb 06:35:53.37 Subscribe to project updates by watching https://github.com/bitnami/containers
mariadb 06:35:53.37 Submit issues and feature requests at https://github.com/bitnami/containers/issues
mariadb 06:35:53.37

/opt/bitnami/mariadb/bin/mysql  Ver 15.1 Distrib 10.3.39-MariaDB, for Linux (x86_64) using readline 5.1
$
$ strings mysql | grep -e '10\.3\.39'
10.3.39-MariaDB
10.3.39
/bitnami/blacksmith-sandox/mariadb-10.3.39/mysys/charset.c
/bitnami/blacksmith-sandox/mariadb-10.3.39/mysys/my_default.c
/bitnami/blacksmith-sandox/mariadb-10.3.39/mysys/mf_iocache.c
/bitnami/blacksmith-sandox/mariadb-10.3.39/mysys/my_thr_init.c