Loading
List scan profiles in the manage profiles drawer
What does this MR do and why?
List scan profiles in the manage profiles drawer
Fill the manage profiles drawer on the group security configuration
scanners overview page with a profile list beside a read-only detail
pane. ScanProfileList renders the list, and ScanProfileDetail shows the
selected profile's details, reusing ScanTriggersDetail for its scan
triggers. Widen the drawer to fit both panes and give each its own
scroll.
Query the group's profiles from the drawer itself, not the scanners
overview page, so create and delete can refetch later. Filter to the
drawer's scan type in a computed property instead of adding a variable
to a GraphQL document four other components share. Select the first
profile the resolver returns, which orders its results. Scope load
failures to a container inside the drawer, since a page-level alert
renders behind it. Keep the scanners overview table header grey on
hover, since gitlab-ui forces it transparent otherwise.
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/624191References
- issue: [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)
- the drawer this fills in: Add scan profile drawer to scanners overview (!252494 - merged)
- alert-inside-drawer pattern from:
ee/app/assets/javascripts/security_configuration/security_attributes/components/project_attributes_update_drawer.vue
Screenshots
| before | after |
|---|---|
![]() |
How to set up and validate locally
-
git checkout 624191-list-scan-profiles-in-drawer echo "Feature.enable(:custom_secret_detection_profiles_ui)" | gdk rails c - have a GitLab Ultimate licence
- go to a group =>
Secure=>Security configuration=>Scanners - select
Manage profileson the secret detection row - check the drawer:
- the left pane lists the secret detection profiles, each with a name, a truncated description and a
GitLaborCustomlabel - the right pane shows the selected profile's
General detailsandScan triggers - no profiles of other types (SAST or dependency scanning) appear in the list
- the left pane lists the secret detection profiles, each with a name, a truncated description and a
with more than one profile
-
create a custom profile so the list has more than one row, substituting the root group's
gid://gitlab/Group/<group_id>expand for create mutations
mutation CreateSecretDetectionProfileWithOneConfiguredTrigger { securityScanProfileCreate( input: { namespaceId: "gid://gitlab/Group/24" scanType: SECRET_DETECTION name: "Historic scan on default branch" description: "Analyzer settings on the default branch pipeline only" triggers: [ { triggerType: DEFAULT_BRANCH_PIPELINE configuration: { secretDetection: { historicScan: true logOptions: "--all --full-history" excludedPaths: ["spec/fixtures/**", "qa/**"] imageSuffix: FIPS secureAnalyzersPrefix: "registry.example.com/security-products" rulesetGitReference: "refs/heads/main" } } } ] } ) { errors scanProfile { id name description scanType gitlabRecommended triggers triggerSettings { triggerType configuration { ... on SecretDetectionConfiguration { secureAnalyzersPrefix imageSuffix historicScan logOptions excludedPaths rulesetGitReference } } } } } }mutation { securityScanProfileCreate( input: { namespaceId: "gid://gitlab/Group/24" scanType: SECRET_DETECTION name: "XSS test <img src=x onerror=alert('profile-name')>" description: "\"><script>alert('description')</script> and a [markdown link](javascript:alert('md'))\nsecond line" stripDefaults: false triggers: [ { triggerType: MERGE_REQUEST_PIPELINE configuration: { secretDetection: { historicScan: true imageSuffix: FIPS secureAnalyzersPrefix: "<img src=x onerror=alert('secureAnalyzersPrefix')>" excludedPaths: [ "<script>alert('excludedPaths')</script>" "\"><img src=x onerror=alert('attr-breakout')>" "{{ constructor.constructor('alert(1)')() }}" "\\u003cimg src=x onerror=alert('double-decode')\\u003e" "<a href=\"javascript:alert('href')\">spec/**</a>" ] logOptions: "--all <svg onload=alert('logOptions-merge-request')>" rulesetGitReference: "javascript:alert('rulesetGitReference')" } } } { triggerType: DEFAULT_BRANCH_PIPELINE configuration: { secretDetection: { historicScan: true imageSuffix: FIPS secureAnalyzersPrefix: "<img src=x onerror=alert('secureAnalyzersPrefix')>" excludedPaths: [ "<script>alert('excludedPaths')</script>" "\"><img src=x onerror=alert('attr-breakout')>" "{{ constructor.constructor('alert(1)')() }}" "\\u003cimg src=x onerror=alert('double-decode')\\u003e" "<a href=\"javascript:alert('href')\">spec/**</a>" ] logOptions: "--since=2020-01-01 <iframe srcdoc=\"<script>alert(1)</script>\"></iframe>" rulesetGitReference: "<style>body{display:none}</style>refs/tags/v1" } } } { triggerType: GIT_PUSH_EVENT } ] } ) { scanProfile { id name } errors } } -
check that
Secret Detection (default)(should be first since !252952 (merged)) is selected when the drawer opens -
select another profile and check the right pane swaps to it
to run tests
yarn jest ee/spec/frontend/security_configuration/components/scan_profilesEdited by Miranda Fluharty
