为什么 GitHub 代码扫描没有检测到我的 PAT?

问题描述

我在一个公共项目中设置了一个 vanilla/OOTB 代码扫描工作流程。我已使用 CodeQL“本机”GitHub 操作来执行此操作。

我想看看我们是否可以用它来防止令牌泄露给公众。

所以我将这些行添加到代码中 - 期待代码扫描能够找到它:

    //TEST import
    public static readonly string _orgUrl = "https://dev.azure.com/<orgname>/Test%20import";
    private readonly string _pat = "gfqhnbej7nzura3nqjfp5log6tyb3lexuii5axwurpiwcogjbydq";

但是扫码没捡到。

我当然希望它会被抓住 - 我已经调查了工作流程以试图找出原因。据我所知,GitHub 操作利用了他们 Code-Ql 代码中的大量查询列表,但我不确定是否应该自己设置一些东西。

正如我所说,工作流程完全是普通的 - 它位于此处:

https://github.com/projectum/AzureImport/blob/main/.github/workflows/codeql-analysis.yml

文件的最后几行是这些,所以应该激活进程:

    # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
  uses: github/codeql-action/init@v1
  with:
    languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages  (C/C++,C#,or Java).
# If this step fails,then you should remove it and run the build manually (see below)
- name: Autobuild
  uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
  uses: github/codeql-action/analyze@v1

我期望 PAT 被捕获是否正确,或者我是否需要修改 YAML 操作以使其这样做?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...