Our friends from openSUSE have this packaged already. We can probably use that as inspiration. https://software.opensuse.org/package/trivy