Checkov tool omits Azure Pipelines results

未关闭
#163 17 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@DimaBir 已经在做这个了。

开始于 2026年5月13日。

评估

这个 Issue 还没有评估数据。

描述

area:task area:tools status:team-review type:docs type:feature

When I use the Checkov tool to scan a cloned Azure DevOps Git repo with an azure-pipelines.yml, I can see CKV_AZUREPIPELINES_ results, but when I use MicrosoftSecurityDevOps@1 in a pipeline for that very same repo, scanning the whole repo, I don't get these CKV_AZUREPIPELINES_ errors.

Don't get me wrong but, this seems like a missed easy win?
Thus, I'm not sure if this is a bug with my implementation or a missing feature. As such here are some details on my implementation, please let me know if I'm missing something obvious.

Here's my .gdcnconfig, derived from https://github.com/microsoft/security-devops-azdevops/wiki#checkov-gdnconfig-sample:

{
  "tools": [
    {
      "tool": {
        "name": "checkov",
        "version": "Latest"
      },
      "arguments": {
        "Directory": "$(Checkov.DefaultTargetDirectory)",
        "Help": false,
        "Version": false,
        "OutputType": "sarif",
        "List": false,
        "Quiet": false,
        "Compact": true,
        "RunAllExternalChecks": false,
        "Soft": false,
        "ShowConfig": false,
        "CreateBaseline": false,
        "OutputBaselineAsSkipped": false,
        "NoFailOnCrash": false,
        "EnableSecretScanAllFiles": true
      },
      "outputExtension": "sarif",
      "successfulExitCodes": [
        0
      ],
      "errorExitCodes": {
        "1": "Checkov tool found issues.",
        "2": "An error has occurred running the Checkov tool."
      },
      "outputPaths": []
    }
  ]
}

And the pipeline task:

  - task: MicrosoftSecurityDevOps@1
    env:
      GDN_RUN_WORKINGDIRECTORY: $(Build.SourcesDirectory)
    inputs:
      break: true
      publish: false

I do get the other results from Checkov, although not always on par with calling standalone Checkov itself.

There seems to be some behind-the-scenes magic at work. For instance, when using MicrosoftSecurityDevOps@1 I found CKV_AZURE_177 downgraded to a warning, where it's an error when I call checkov standalone to perform what I think is the same scan.

Here's how I've been performing a manual scan with Checkov, that seems to look deeper and be more strict than the task's call does:

checkov -d "$(Build.SourcesDirectory)" --repo-root-for-plan-enrichment "$(Build.SourcesDirectory)" --deep-analysis  -o cli -o sarif --output-file-path console,$results
主要语言
TypeScript
星标
86
派生
22
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/security-devops-azdevops 的其他 Issue

查看 microsoft/security-devops-azdevops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。