Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Fern Pattern Scanner — 扫描所选文件,查找规则中规定的模式。此功能用于发现你可能不小心写入文件中的机密信息。此扫描器用于演示如何通过自定义扫描器填充 GitLab [漏洞报告](https://docs.gitlab.com/ee/user/application_security/vulnerability_report/)。你可以按照 [Secret List](https://gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/secret-list) 项目中的文档查看其实际运行的演示。 | Kitploit
工具/GitLabGitLab/gitlab-da/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner
静态分析漏洞扫描器代码分析DevSecOps秘密检测学习与教育
GitLabgitlab-da/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner

Fern Pattern Scanner

查看仓库

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →

关于

扫描所选文件,查找规则中规定的模式。此功能用于发现你可能不小心写入文件中的机密信息。此扫描器用于演示如何通过自定义扫描器填充 GitLab [漏洞报告](https://docs.gitlab.com/ee/user/application_security/vulnerability_report/)。你可以按照 [Secret List](https://gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/secret-list) 项目中的文档查看其实际运行的演示。

分享
532年前尚未审核

Fern 模式扫描器

欢迎使用 Fern 的模式扫描器。该扫描器会扫描你建议的文件,并使用 正则表达式 查找 rules/rules.yaml 中规定的任何模式。然后生成一份包含所有发现的报告。本项目用于展示如何将自定义 安全扫描器集成到 GitLab,并用于填充 流水线安全选项卡、漏洞报告 和 合并请求小部件

注意:访问漏洞报告需要 GitLab Ultimate 订阅

将扫描器添加到你的 GitLab CI/CD 流水线

你可以通过将以下内容添加到你的 .gitlab-ci.yml 来激活此安全扫描器:

root@kitploit:~
include:
  - remote: "https://gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner/-/blob/main/jobs/.fern-pattern-scanner.gitlab-ci.yml" 

你可以在 Secret List 项目中查看扫描器的运行情况。扫描完成后,它会生成一份名为 gl-secret-detection-report.json 的报告。该报告会经过验证并加载到 漏洞报告 和 合并请求小部件 中。

如果你希望忽略扫描项目中的某些路径,可以设置以下变量,并使用逗号分隔的值:

root@kitploit:~
variables:
  FERN_ANALYZER_EXCLUDED_PATHS: "docs, tests"

加载你自己的规则集

如果你希望在 GitLab 中运行自己的正则表达式规则集,必须执行以下操作:

  1. 在项目内的某个位置创建一个 rules.yaml 文件。rules.yaml 文件应如下所示,你可以根据需要继续添加名称和模式。
root@kitploit:~
patterns:
  - name: 'PATTERN NAME 1'
    pattern: 'REGEX 1'
  - name: 'PATTERN NAME 2'
    pattern: 'REGEX 2'
  1. 使用以下内容覆盖你的 .gitlab-ci.yml 文件:
root@kitploit:~
fern_secret_detection:
  script:
    - /app/fern-pattern-scanner scan --rules "/path/to/rules.yaml" --report
  1. 提交你的代码,扫描器应开始使用新的规则集运行。此扫描器不扫描提交差异。它会在整个项目中搜索模式。

  2. 当流水线完成时,你可以点击 安全选项卡 查看所有检测到的问题。如果你拥有 GitLab Ultimate,这些问题也可以在 漏洞报告 中查看

在本地运行扫描器

你可以使用此扫描器在本地机器上检测所选文件类型的模式。要在本地机器上运行此扫描器,请按照以下步骤操作:

  1. 安装扫描器
root@kitploit:~
$ go install gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner

注意:这会将文件下载到你的 $GOBIN。如果你是 Go 新手,这个 playground 介绍了 Go 的安装过程

  1. 下载 rules.yaml 文件
root@kitploit:~
$ wget https://gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner/-/raw/main/rules/rules.yaml

...
Resolving gitlab.com (gitlab.com)... 2606:4700:90:0:f22e:fbec:5bed:a9b9, 172.65.251.78
Connecting to gitlab.com (gitlab.com)|2606:4700:90:0:f22e:fbec:5bed:a9b9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 283 [text/plain]
Saving to: ‘rules.yaml’

rules.yaml          100%[===================>]     283  --.-KB/s    in 0s

2023-05-20 16:02:46 (22.5 MB/s) - ‘rules.yaml’ saved [283/283]

注意:你也可以直接从 项目 下载该文件

  1. 使用规则文件运行扫描器
root@kitploit:~
$ fern-pattern-scanner scan --rules path/to/rules.yaml

INFO[0000] The scanner is starting                      
INFO[0000] Skipping the following directories: []       
INFO[0000] Possible Vulnerability Detected: {Id:139999 Name:password variation 1 Message:The pattern in rule: password variation 1 was found in a file Description:The pattern in rule: password variation 1 was found in a file. Examine the file, remove and rotate your secret. Location:/Users/fern/Desktop/secret-list/.git/index Line:3} 
...
INFO[0000] The scanner completed successfully

由 Fern🌿 创建和维护

  • LinkedIn
  • Twitter
下载工具