aquasecurity / trivy

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
https://aquasecurity.github.io/trivy
Apache License 2.0
22.1k stars 2.18k forks source link

fix: Allow commas in passwords so long as only one username is passed #7044

Open btoews opened 1 week ago

btoews commented 1 week ago

Description

It's a bit tricky to use Trivy with the Fly.io registry because Fly.io tokens often contain commas. Trivy allows multiple, comma separated passwords to be sent and complains if the number of usernames doesn't match the number of passwords.

In the case where one username and multiple passwords is set, this PR rejoins the passwords with commas. This seems like a good balance between allowing for multiple credentials to be specified and allowing for commas in passwords.

Related issues

https://github.com/aquasecurity/trivy/discussions/7043

Checklist

CLAassistant commented 1 week ago

CLA assistant check
All committers have signed the CLA.