Skip to content

PRP Veles for MongoDB Connection URL#1810

Open
VickyTheViking wants to merge 3 commits intogoogle:mainfrom
VickyTheViking:mongodb-conn-url-veles
Open

PRP Veles for MongoDB Connection URL#1810
VickyTheViking wants to merge 3 commits intogoogle:mainfrom
VickyTheViking:mongodb-conn-url-veles

Conversation

@VickyTheViking
Copy link
Copy Markdown
Contributor

@alessandro-Doyensec
Copy link
Copy Markdown
Collaborator

alessandro-Doyensec commented Mar 11, 2026

Hi @VickyTheViking

Thanks for the contribution, the PR looks good overall.

I just have a doubt: Would it make sense to incorporate this into urlcreds.NewDetector instead? Since that detector already identifies URLs with embedded credentials, it should presumably catch connection strings (for MongoDB and potentially other databases) as well.

In that case only the validation part should be added to the following function:

func (v *Validator) Validate(ctx context.Context, secret Credentials) (veles.ValidationStatus, error) {

cc @erikvarga for any additional context on this approach.


Note: I'm not opposed to keeping this as a separate detector, just wanted to point out that urlcreds.NewDetector exists.

@alessandro-Doyensec alessandro-Doyensec self-requested a review March 11, 2026 15:39
@erikvarga
Copy link
Copy Markdown
Collaborator

Adding to Alessandro's comment, the main concern is that enabling both detectors (mongodburl and urlcreds) would find duplicate results. What I'd suggest is that we rewrite the FromMatch part of the urlcreds detector so that it returns a MongoDBConnectionURL secret struct instead of a generic urlcreds.Credentials if the scheme matches mongodb connection strings. Then we can remove the mongodb-specific detector but will still be able to use the validator to check mongodb URLs.

@alessandro-Doyensec
Copy link
Copy Markdown
Collaborator

Hi @VickyTheViking

Thanks for the changes, could you please also create a PR to https://github.com/google/security-testbeds containing a simple README on how to setup mongo and how to launch scalibr against it.

Use google/security-testbeds#194 as a reference.

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.

3 participants