Skip to content

Gosec Custom Ruleset

Zach Rice requested to merge ruleset-passthrough into master

What does this MR do?

Adds custom rulesets for gosec

This MR enables gosec to use the new common/ruleset module to load rules for the relevant scanner from a local .gitlab/sast-rulesets.toml configuration file.

The logic in question involves basic passthrough capability as described in the linked issue. In the case of gosec, this is achieving feature parity with the pre-existing SAST_GOSEC_CONFIG ENV to specify a custom gosec configuration file.

The logic can be seen working on the downstream jobs. Note that the expectation added with this MR does not include one of the default findings (G104) due to the gosec-config.json excluding that finding specifically.

What are the relevant issue numbers?

gitlab-org/gitlab#235382 (closed)

Does this MR meet the acceptance criteria?

Edited by Lucas Charles

Merge request reports