Skip to content

Draft: Support ruleset git refs

Lucas Charles requested to merge support-ruleset-git-refs into main

What does this MR do?

Initial implementation of gitlab-org/gitlab#393452 (closed)

Update package to include ruleset.LoadRef function for loading remote rulesets using an SCP-style reference string.

Example usage:

NOTE: below is a real project token but it's limited to repository_read for a clone of the second project, a public test project. Unfortunately, this is currently necessary to test the behavior but I plan on cleaning it up to not rely on my personal forks at the very least.

import "gitlab.com/gitlab-org/security-products/analyzers/ruleset"

config1 := ruleset.LoadRef("gitlab.com/theoretick/sdlksdjklw3")
config2 := ruleset.LoadRef("gitlab.com/gitlab-org/security-products/tests/go@2488eaa671cc02ecc73cddffc5a2b4c528469933")
config3 := ruleset.LoadRef("myusername:glpat-R_Lue78GBxoMW2zgJn6d@gitlab.com/theoretick/tests-go-private@2488eaa671cc02ecc73cddffc5a2b4c528469933")

What are the relevant issue numbers?

gitlab-org/gitlab#393452 (closed)

Does this MR meet the acceptance criteria?

Edited by Lucas Charles

Merge request reports