Loading
Show SAST settings in scan profile details
What does this MR do and why?
Show SAST settings in scan profile details
Keep SastConfiguration trigger settings as well as
SecretDetectionConfiguration ones in classifyConfigurationVariables, so
the scan profile details modal lists a SAST profile's advanced
configuration. The modal opens from the enable scanners wizard, the
bulk scanners update drawer and the scan profile configuration page.
Filter on a list of analyzer configuration types rather than dropping
the check, so other ScanProfileConfiguration union members such as
auto-remediation still stay out of the table.
Gate behind the custom_scan_profiles_ui feature flag
Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/624191The custom_scan_profiles_ui feature flag only controls the Manage profiles buttons. Those buttons are the only interface that can create or edit profile settings, and the built-in SAST (default) profile has no settings. The securityScanProfileCreate mutation is not behind the flag, so a SAST profile created with settings through the API shows them in the modal even with the flag off. The section is read-only.
References
- issue: #624191 (closed)
- follows !255625 (merged), which added SAST fields to the scan profile mapping util and mutations
Screenshots or screen recordings
How to set up and validate locally
-
git checkout 624191-show-sast-settings-in-scan-profile-details-modal - have a GitLab Ultimate licence
- create a SAST profile with a setting in a top-level group, using the mutation below in
/-/graphql-explorer(no UI can add SAST settings yet)
expand for seed mutation
mutation {
securityScanProfileCreate(input: {
namespaceId: "gid://gitlab/Namespace/<GROUP_ID>"
scanType: SAST
name: "SAST with excluded analyzers"
description: "Skips the bandit analyzer"
triggers: [
{ triggerType: MERGE_REQUEST_PIPELINE, configuration: { sast: { excludedAnalyzers: ["bandit"] } } }
{ triggerType: DEFAULT_BRANCH_PIPELINE, configuration: { sast: { excludedAnalyzers: ["bandit"] } } }
]
}) {
errors
scanProfile { id name }
}
}- go to that group =>
Secure=>Security configurationand selectEnable scanners - select
Advanced setup, thenStart advanced setup - tick at least one project, then select
Select scanners - on the
SASTcard, tick its checkbox, pickSAST with excluded analyzersunderConfiguration profile, then selectPreview profile - check that the
SAST profilemodal shows anAdvanced configurationsection:excludedAnalyzersshould show[ "bandit" ]
- close the modal. On the
Secret detectioncard, tick its checkbox, pick a custom secret detection profile that has settings, then selectPreview profile. The built-inSecret Detection (default)has none - check that its
Advanced configurationsection still lists that profile's settings
to run tests
yarn jest ee/spec/frontend/security_configuration/components/scan_profiles/utils_spec.jsMR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #624191 (closed)
Edited by Miranda Fluharty


