SAST mutation now supports analyzers section
What does this MR do?
Builds on !42173 (merged) to create commit to manage the information about analyzers in .gitlab-ci.yml file.
The GraphQL mutation continues to work as-is when the analyzers
section is not passed along. The frontend's usage of the analyzers
section is behind the sast_configuration_ui_analyzers
feature flag.
Issue: #235799 (closed)
Screenshots
Expand for text of request from screenshot:
Sample request that sends along the analyzers
section.
mutation{
configureSast(
input: { projectPath: "nu-group/yarnit",
configuration: {
global: [
{ field: "SECURE_ANALYZERS_PREFIX",
defaultValue: "registry.gitlab.com/gitlab-org/security-products/analyzers",
value: "4"
},
{ field: "SAST_EXCLUDED_PATHS",
defaultValue: "spec, test, tests, tmp",
value: "44"
},
{ field: "SAST_ANALYZER_IMAGE_TAG",
defaultValue: "2",
value: "2"
}
],
pipeline: [
{ field: "SEARCH_MAX_DEPTH",
defaultValue: "4",
value: "4"
},
{ field: "stage",
defaultValue: "test",
value: ""
}
],
analyzers: [
{ name: "brakeman",
enabled: true,
variables: [
{ field: "SAST_BRAKEMAN_LEVEL",
defaultValue: "1",
value: "2"
}
]
},
{
name: "eslint",
enabled: false
}
]
}
}
){
status
successPath
errors
}
}
Part of resulting commit diff (arrows pointing to analyzer specific additions):
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Saikat Sarkar