TIL View Security Scanners enabled in a given project via the GitLab GraphAL API
query {
project(fullPath: "bcarranza/detecting-secrets") {
id
securityScanners{
enabled
pipelineRun
}
}
}
In response, I get:
{
"data": {
"project": {
"id": "gid://gitlab/Project/28746821",
"securityScanners": {
"enabled": [
"SECRET_DETECTION"
],
"pipelineRun": []
}
}
}
}
That shows that while Secret Detection is enabled, no scanner ran successfully in the latest pipeline. In a project where Dependency Scanning ran successfully, we see:
{
"data": {
"project": {
"id": "gid://gitlab/Project/40375764",
"securityScanners": {
"enabled": [
"DEPENDENCY_SCANNING"
],
"pipelineRun": [
"DEPENDENCY_SCANNING"
]
}
}
}
}
ℹ️ About this TIL snippet: Created 2022-12-26T21:56:49-05:00 · View the source