Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Fern Pattern Scanner — Scans selected files for patterns stated in rules. This is used in order to find secrets you may have accidentally written to a file. This scanner is used to show how the GitLab [vulnerability report](https://docs.gitlab.com/ee/user/application_security/vulnerability_report/) can be populated by a custom scanner. You can see a demo of it in action be following the documentation in the [Secret List](https://gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/secret-list) project. | Kitploit
Tools/GitLabGitLab/gitlab-da/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner
Static AnalysisVulnerability ScannersCode AnalysisDevSecOpsSecret DetectionLearning & Education
GitLabgitlab-da/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner

Fern Pattern Scanner

View Repository
5352 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →

About

Scans selected files for patterns stated in rules. This is used in order to find secrets you may have accidentally written to a file. This scanner is used to show how the GitLab [vulnerability report](https://docs.gitlab.com/ee/user/application_security/vulnerability_report/) can be populated by a custom scanner. You can see a demo of it in action be following the documentation in the [Secret List](https://gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/secret-list) project.

Share

Fern Pattern Scanner

Welcome to Fern's Pattern Scanner. This scanner scans through your suggested files and finds any patterns stated within the rules/rules.yaml using regex. Then a report is generated with all the findings. This project is used to showcase how a custom security scanner can be integrated in GitLab can be used to populate the Pipeline Security Tab, the vulnerability reports and the merge request widget

Note: Accessing vulnerability reports requires a GitLab Ultimate subscription

Adding the scanner to your GitLab CI/CD pipeline

You can activate this security scanner by adding the following to your .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" 

You can see the scanner run on the Secret List project. Once the scanner completes, it generates a report named gl-secret-detection-report.json. That report is validated and loaded into the vulnerability report and merge request widget.

If you wish to ignore scanning certain paths in the project the scanner is running on, you can set the following variable with comma separated values:

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

Loading your own rule set

If you wish to run your own rule set of regex patterns in GitLab, you must do the following:

  1. Create a rules.yaml file somewhere inside your project. The rules.yaml file should look as follows, where you can continue adding names and pattens as needed.
root@kitploit:~
patterns:
  - name: 'PATTERN NAME 1'
    pattern: 'REGEX 1'
  - name: 'PATTERN NAME 2'
    pattern: 'REGEX 2'
  1. Override your .gitlab-ci.yml file with the following:
root@kitploit:~
fern_secret_detection:
  script:
    - /app/fern-pattern-scanner scan --rules "/path/to/rules.yaml" --report
  1. Check in your code and the scanner should begin running with the new rule set. This scanner does not scan commit diffs. It searches for patterns across the entire project

  2. When the pipeline completes, you can click on the Security tab to view all the detected issues. If you have GitLab Ultimate, these issues can also be seen in the Vulnerability Report

Running the scanner locally

You can use this scanner to detect patterns for selected file types on your local machine. In order to run this scanner on your local machine follow the steps below:

  1. Install the scanner
root@kitploit:~
$ go install gitlab.com/gitlab-de/tutorials/security-and-governance/custom-scanner-integration/fern-pattern-scanner

Note: This will download the file to your $GOBIN. If you are new to Go, this playground goes over the GO installation

  1. Download the rules.yaml file
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]

Note: You can also download the file directly from the project

  1. Run the scanner with the rules file
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

Created and maintained by Fern🌿

  • LinkedIn
  • Twitter
Download Tool