GuardianErrorExitCodeException: checkov completed with an Error exit code: 1. An error has occurred running the Checkov tool.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- azure, json, typescript, yaml
Hướng nghiên cứu
Tái hiện task MicrosoftSecurityDevOps@1 có và không có tệp cấu hình, sử dụng đầu ra lệnh Checkov được cung cấp làm điểm bắt đầu. Kiểm tra các tệp checkov.sarif và msdo.sarif được tạo ra, đồng thời so sánh cách task xử lý đối số DownloadExternalModules. Công việc được xem là hoàn tất khi quá trình quét đã cấu hình tạo ra các kết quả SARIF có thể sử dụng và hành vi của module bên ngoài nhất quán với thiết lập được cung cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello All!
When i use almost vanilla MicrosoftSecurityDevOps@1 template:
parameters:
TemplatesRepoName: ''
stages:
- stage: Microsoft_Defender
displayName: Microsoft Defender for Cloud DevOps security
condition: always()
pool:
vmImage: windows-latest
jobs:
- job: Microsoft_Defender_Scan
displayName: Scan
steps:
- checkout: ${{ parameters.TemplatesRepoName }}
- checkout: self
- task: MicrosoftSecurityDevOps@1
displayName: Microsoft Security DevOps
inputs:
config: templates/configs/checkov.gdnconfig
categories: IaC
Inside pipeline:
resources:
repositories:
- repository: templates
type: git
name: PROJ/templates
ref: refs/heads/feature/microsoft-defender-config
trigger:
- main
pr:
- main
stages:
- template: templates/microsoft-security.yml@templates
parameters:
TemplatesRepoName: templates
in the end, i got an error:
Tool run time: 11.1929338 seconds
------------------------------------------------------------------------------
Checkov completed with exit code 1
##[error]Error running checkov job: 1 of 1
##[error]GuardianErrorExitCodeException: checkov completed with an Error exit code: 1. An error has occurred running the Checkov tool.
------------------------------------------------------------------------------
Process:
Convert:
Converting any raw tool logs to Sarif format ...
Completed converting raw tool logs to Sarif format.
Import:
No tool logs to process.
Break:
Guardian is searching for results that meet the given criteria to break the build.
Results Query Summary:
Baselines: default
Suppression Sets: default
Policy: azuredevops
Saved file /home/vsts/work/1/a/.gdn/msdo.sarif
Found no breaking results.
Active results: 0
Skipped results: 0
```ps
Tool run time: 11.1929338 seconds
------------------------------------------------------------------------------
Checkov completed with exit code 1
##[error]Error running checkov job: 1 of 1
##[error]GuardianErrorExitCodeException: checkov completed with an Error exit code: 1. An error has occurred running the Checkov tool.
------------------------------------------------------------------------------
Process:
Convert:
Converting any raw tool logs to Sarif format ...
Completed converting raw tool logs to Sarif format.
Import:
No tool logs to process.
Break:
Guardian is searching for results that meet the given criteria to break the build.
Results Query Summary:
Baselines: default
Suppression Sets: default
Policy: azuredevops
Saved file /home/vsts/work/1/a/.gdn/msdo.sarif
Found no breaking results.
Active results: 0
Skipped results: 0
Baselined results: 0
Suppressed results: 0
Results excluded by tool filters: 0
Results below minimum severity: 0
Results classified as Pass: 0
Results in flight: 0
##[error]Error running tool 1 of 1: checkov
##[error]Error running checkov job: 1 of 1
##[error]GuardianErrorExitCodeException: checkov completed with an Error exit code: 1. An error has occurred running the Checkov tool.
##[error]BreakException: Guardian detected one or more breaking results.
My config file is really basic:
{
"tools": [
{
"tool": {
"name": "Checkov",
"version": "Latest"
},
"arguments": {
"DownloadExternalModules": "false",
"TargetDirectory": "$(Checkov.DefaultTargetDirectory)"
}
}
]
}
Even when i set DownloadExternalModules to false, i got an error in cmd:
/home/vsts/work/_msdo/packages/nuget/Microsoft.Guardian.CheckovRedist_linux_amd64.3.2.144/tools/dist/checkov --download-external-modules false --directory ./ --output-file-path /home/vsts/work/1/s/.gdn/.r/checkov/001/checkov.sarif
##[error]2024-07-08 13:06:05,846 [MainThread ] [WARNI] Failed to download module git::https://ORD@dev.azure.com/ORD/PROK/_git/keyvault//src?ref=v0.3:None (for external modules, the --download-external-modules flag is required)
That error is hilarious since flag is set to false but leave that...
The problem that i have is that i have a lot of errors from that pipeline:
For better reference, output with env variable set to DEBUG:
https://gist.github.com/michasacuer/c0e7127bfe537f1a15e19db5fcd8fa81
And also, sarif file is empty. This is an output from my code:
{
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
"version": "2.1.0",
"runs": [],
"properties": {
"producer": "MicrosoftSecurityDevOps"
}
}
And scans tab in devops is empty.
When i don't use config file i got an output from msdo.safir file and scans tab has entries:
But task looks like this:
- task: MicrosoftSecurityDevOps@1
displayName: Microsoft Security DevOps
inputs:
categories: IaC
And still i got this error:
And output:
/home/vsts/work/_msdo/packages/nuget/Microsoft.Guardian.CheckovRedist_linux_amd64.3.2.144/tools/dist/checkov --directory ./ --output sarif --soft-fail --output-file-path /home/vsts/work/1/s/.gdn/.r/checkov/001/checkov.sarif
##[error]2024-07-08 13:00:23,785 [MainThread ] [WARNI] Failed to download module git::https://ORG@dev.azure.com/BarentzDevOps/PROJ/_git/keyvault//src?ref=v0.3:None (for external modules, the --download-external-modules flag is required)
So, to sum up:
- When i provide
configscans outputs are not saved to file - Even with variable set to
falsecheckov yells thatdownload modulesvar is required
Why it fails? What i do wrong?
- Ngôn ngữ chính
- TypeScript
- Star
- 86
- Fork
- 22
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/security-devops-azdevops
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
area:task area:tools status:waiting-on-author type:docs type:question
microsoft/security-devops-azdevops#169 · 1 bình luận · 1 người được giao ·
-
Which Defender CLI binary should be used in CI/CD pipelines — `aka.ms` or the DevOps CDN endpoint? Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/security-devops-azdevops#166 · 2 bình luận · 1 reaction ·
-
area:task area:tools status:team-review type:feature
microsoft/security-devops-azdevops#164 · 2 reaction · 2 người được giao ·
-
area:task area:tools status:team-review type:docs type:feature
microsoft/security-devops-azdevops#163 · 17 bình luận · 1 người được giao ·
Tất cả issue của microsoft/security-devops-azdevops
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100