Add scan action filter to scanExecutionPolicies graphql query
What does this MR do and why?
Addresses #344687 (closed)
This MR adds action_scan_types
filter to scanExecutionPolicies
graphql resolver.
Screenshots or screen recordings
Policies containing given scan action
No policies with given scan action
How to set up and validate locally
-
Go to
Security Policy -> Policies
, click onNew Policy
, selectScan Execution
as Policy type. -
Paste policy:
type: scan_execution_policy name: Container Scanning Policy description: This policy executes container scanning on the project enabled: false rules: - type: pipeline branches: - main actions: - scan: container_scanning
-
Create new MR with updated policy and hit merge.
-
Go to graphql-explorer and run the query:
query {
project(fullPath:<project_path>) {
scanExecutionPolicies(actionScanTypes:[CONTAINER_SCANNING]) {
nodes {
name
description
yaml
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sashi Kumar Kumaresan