Draft: Show advanced configuration in the profile modal [ci skip]
What does this MR do and why?
Show advanced configuration in the profile modal
Add an Advanced configuration section to the bottom of
ScanProfileDetailsModal, listing the six secret detection analyzer
settings as read-only label and value rows. Extend the
SecurityScanProfile query with triggerSettings and the
SecretDetectionConfiguration union member that carries them.
Select those fields on the modal's own query rather than the shared
ScanProfileFields fragment, which three other queries also use and none
of them render configuration. Read the first trigger that carries a
configuration, because the modal previews a profile while configuration
is stored per trigger. Match on the union member so the section stays
hidden for scan types that resolve to no typed configuration.
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/624190
Changelog: added
EE: trueReferences
- issue: [Frontend] Support custom Secret Detection prof... (#624190 - closed)
- follow-up issue that reuses the component in the drawer: [Frontend] Scan profile drawer: view, create, e... (#624191 - closed)
- epic: Advanced Secret Detection Configuration Profile (gitlab-org#20198)
- designs: Design: Advanced Configuration Profiles management (gitlab-org#23403)
- backend implementation plan for per-trigger configuration: [Backend] Advanced profiles: Implementation plan (#604721 - closed)
- why secret push protection carries no configuration:
UNCONFIGURABLE_TRIGGER_TYPES_BY_SCAN_TYPEinee/app/models/security/scan_profile_trigger.rb
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
-
git checkout 624190-add-advanced-configuration-to-profile-modal -
have a GitLab Ultimate licence
-
be
Maintainer,OwnerorSecurity Manageron the root group -
create a custom secret detection profile with configuration on two triggers
- open
GraphiQLat/-/graphql-explorerand run the mutation below, substituting the root group'sgid://gitlab/Group/<group_id>
expand for the create mutation
mutation { securityScanProfileCreate( input: { namespaceId: "gid://gitlab/Group/<group_id>" scanType: SECRET_DETECTION name: "Advanced configuration demo" description: "Configuration on the two configurable triggers" stripDefaults: false triggers: [ { triggerType: GIT_PUSH_EVENT } { triggerType: MERGE_REQUEST_PIPELINE configuration: { secretDetection: { secureAnalyzersPrefix: "registry.gitlab.com/security-products" imageSuffix: FIPS historicScan: true logOptions: "--all" excludedPaths: ["spec/fixtures/**", "**/*.min.js"] rulesetGitReference: "refs/heads/main" } } } { triggerType: DEFAULT_BRANCH_PIPELINE configuration: { secretDetection: { imageSuffix: DEFAULT historicScan: false } } } ] } ) { scanProfile { id name } errors } } - open
-
go to that group =>
Secure=>Security configuration=>Scannerstab =>Enable scanners=>Advanced configuration=>Select scannersstep -
click the secret detection card to enable it, then select the new profile in the dropdown, then click
Preview profileto open the modal -
check that the modal shows an
Advanced configurationsection at the bottom, below the trigger cards, withTrigger,SettingandValuecolumns -
check the rows:
- one per set setting, per configured trigger
- the
Triggercolumn names which trigger each row belongs to - settings left unset do not appear at all
-
check that
SECRET_DETECTION_HISTORIC_SCANshowsNoon the default branch trigger rather than being hidden, sincefalseis a set value
changes to the copy in the trigger cards that would conflict with new configuration options
- check that the merge request and default branch trigger cards:
- no longer show a
Scope:row - no longer promise a full repository scan or every vulnerability in their descriptions
- still show their
Target branch:andResults:rows, which the settings cannot contradict
- no longer show a
to run tests
yarn jest ee/spec/frontend/security_configuration/components/scan_profilesMR 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 #624190 (closed)