Skip to content

Code Scanning

Code scanning lets you automatically analyze your source code repositories for security vulnerabilities, exposed secrets, dependency risks, and license compliance issues. By running multiple specialized scanners against your codebase, Fencer surfaces actionable findings before they reach production.

Code scanning is the foundation of your software supply chain security posture — it ties together vulnerability management, secrets detection, and dependency analysis in a single workflow.

  • At least one source code integration connected: GitHub, GitLab, Bitbucket, Azure DevOps, Cursor Origin, or a generic Git repository.
  • Repositories added to your organization as assets.
  • A subscription that includes code scanning. Secret detection and dependency checks run only when your plan also includes secret scanning and dependency scanning.

When a code scan is triggered, Fencer clones the target repository at a specific branch and commit, then runs its suite of scanners against the source code. Each scanner produces a Run within the parent Scan, and each Run records the vulnerabilities, findings, and counts it discovered.

Scans move from Queued to Running to Finished, or end as Failed, Cancelled, Crashed, Timed out, or Skipped. A scan of a GitHub pull request from a fork can show Waiting for approval until a maintainer approves it (see Scan triggers). After a scan finishes, results are compared with earlier scans to classify vulnerabilities as new, existing, or resolved. Configurable checks evaluate the results against your thresholds and report pass or fail back to your source code provider on the commit and pull request.

During a code scan, Fencer runs a suite of specialized checks covering:

  • Static analysis — code vulnerabilities and security anti-patterns
  • GitHub Actions supply chain — static analysis rules for workflow YAML (unpinned actions, OIDC, lockfile-exact installs, public registry installs, install-script policy, and related provenance controls). See OWASP SPVS Coverage.
  • Dependency vulnerabilities — known CVEs in your direct and transitive dependencies
  • Secret detection — API keys, passwords, tokens, and certificates committed to source code
  • Infrastructure-as-code — misconfiguration scanning for IaC templates
  • Software composition analysis — package cataloging and SBOM generation
  • AI agent configuration — MCP server definitions and agent skill files (SKILL.md) committed to the repository
  • Patterns from AI reviews — vulnerable code that an AI PR Review flagged on a pull request that was merged without fixing it
  1. Go to Admin > Integrations.
  2. Connect a source code provider: GitHub, GitLab, Bitbucket, Azure DevOps, Cursor Origin, or Git for any other Git repository.
  3. Choose the repositories to scan. On GitHub, Fencer imports every repository the app installation can access. For the other providers, pick repositories on the connection. To add one later, click Add repository at the top of the Posture > Code page. Generic Git repositories are added by URL on the Git integration’s page.

Repositories appear on the Code Analysis page (Posture > Code). Each repository tracks its provider (GitHub, GitLab, Bitbucket, Azure DevOps, Cursor Origin, or Generic Git Repository), visibility (public, private, or internal), default branch, and source URL.

On the Code Analysis page, switch between a table view and a tile view using the view toggle. The table lists every repository with its vulnerability count, provider, visibility, scope, and when it was last scanned. Use the In Scope column to mark a repository in or out of scope inline, or select multiple repositories and use the bulk action bar to change scope for all of them at once (see Asset Scope Management). Click the star on a repository to favorite it for quick access.

A repository’s detail page opens with a KPI summary, followed by tabs for Vulnerabilities, Dependencies (see Dependency Scanning), Scans, Reviews (see AI codebase reviews), Context (the languages and configuration Fencer found in the repository’s default branch), and Settings (shown to roles that can edit assets). Use the breadcrumb at the top of the page to jump directly to another repository without returning to the list first — it keeps you on the same tab.

Code scans can be triggered in several ways:

  1. Manual — Click Run scan on a repository’s detail page, or use the API. The scan runs on the branch chosen in the Branch selector on the detail page (the default branch unless you pick another). To scan several repositories at once, select their rows on Code Analysis and click Scan in the bulk action bar. Those scans run on each repository’s default branch. Repositories that are suspended or were scanned too recently are skipped, and the bar reports how many scans were scheduled. One Scan schedules at most 100 assets. Scanning every row that matches the current filters can be started once a minute. Running a scan needs a role that can execute scans, such as Administrator or Team Member. The Scan action is hidden without it.
  2. Push — Pushes trigger a scan of the pushed branch. For the default branch, this follows the Scan on push setting.
  3. Pull request — Opening or updating a pull request triggers a scan of its source branch.
  4. Scheduled — The default branch is scanned on the schedule set in Automatic scan frequency: Hourly, Daily (the default), Weekly, or Off. Daily scans start at midnight UTC and weekly scans on Mondays. If your plan doesn’t include daily scheduled scans, scheduled scans run weekly.

Generic Git repositories have no webhooks, so they are scanned only manually and on schedule.

On GitHub, a pull request opened from a fork is not scanned automatically by default. Each new commit waits for a maintainer to click Approve this commit on the scan’s page, unless you turn on Automatically scan fork pull requests in the repository’s settings.

Configure scan behavior per repository on the Settings tab of the repository’s detail page. The tab has four groups: General, Scanning, Checks, and Automation. Click Save Changes to apply edits; the AI review, triage, and deferral settings under Automation save as soon as you change them.

  • Status badge — Serves a public “Fencer-protected” badge image that you can add to the repository’s README. On by default for public repositories, off for private and internal ones. To copy the snippet, click the badge next to the repository name on its detail page; the Add the Fencer badge to your README dialog offers Markdown and HTML and a Show this badge publicly toggle.
  • Criticality — How sensitive the repository is, and the impact of a security incident.
  • Compliance Scope — Whether the repository’s vulnerabilities are included in GRC compliance reports.
  • Default branch — The branch used for scheduled scans and scan-on-push.
  • Scan on push — Whether pushes to the default branch trigger a scan. On by default.
  • Automatic scan frequency — How often scheduled scans run on the default branch.
  • Fork pull requests (GitHub only) — Automatically scan fork pull requests. Off by default.
  • Branches — Branch scope controls which branches are scanned automatically: Scan every branch, Scan only these branches, or Scan every branch except these. Pull request scans use the source branch. Branches to skip accept glob patterns (for example release/* or dependabot/**): * matches a single path segment and ** matches nested segments. The default branch can never be excluded. Push, pull request, and scheduled scans of out-of-scope branches are skipped, and you can still start a scan manually.
  • Exclusions — Exclude files or directories lists paths to skip during scans, up to 100. A directory name (for example dev or some_folder/) skips that directory and everything inside it, and globs such as *.lock or **/*.yml still work. The field previews how many open findings your patterns would skip.
  • Suspend Scanning (not shown for GitHub repositories) — Pauses automated scans until you turn it off.

These settings decide when a scan reports a failure on pull requests and commit statuses.

  • Post findings on pull requests — On by default. Each scan posts the vulnerabilities it finds on the pull request. Post findings as chooses inline annotations or comments. A repository inherits the organization default — annotations, until you change Post findings as under Settings > Organization — unless it sets its own. Administrators see Edit organization default under Post findings as, which opens that setting on Settings > Organization. Annotations appear on the changed files in GitHub and Bitbucket. Comments are a pull request review on GitHub and one conversation comment on Bitbucket, GitLab, Azure DevOps, and Cursor Origin. A later scan of the same pull request updates that comment instead of posting another. On Cursor Origin, annotations are listed in the check run because that provider has no line annotations. Turning this off posts neither.
  • Fail on new secrets exposed — Fail the scan if new secrets are found. On by default.
  • Fail on EOL — Fail the scan if a package will soon be end-of-life. Off by default.
  • Fail on new vulnerabilities if — Fail when new vulnerabilities of a severity or higher are found: Critical, High or critical (the default), Medium or higher, Low or higher, Any new vulnerability is found, or Don’t fail on new vulnerabilities.
  • Fail on license risk — Fail when an added package has a risky license: Strong Copyleft, Any Copyleft license, Any Commercial or Copyleft license, Any non-proprietary license, or Don’t fail on license risk (the default).
  • Total threshold — Fail when the total number of vulnerabilities, regardless of severity, exceeds this number.
  • Critical / High / Medium / Low / Info threshold — Fail when the number of vulnerabilities of that severity exceeds this number. The medium and low thresholds go up to 2,000.

Thresholds are empty by default, which means no limit. Unlike the “fail on new” settings, they count every open vulnerability in the scan, not only new ones.

Each of these follows the organization default unless you override it for the repository. Administrators see Edit organization default in the section header, which opens the matching card on Settings > Organization. The repository page only chooses whether this repository follows that default or overrides it:

  • AI Fixes — Automatically open a PR on AI fix when an AI fix attempt succeeds (see Automated Remediation).
  • AI PR Reviews — Whether pull requests get an AI PR review, and whether it runs automatically (see AI PR Reviews).
  • Fencer triage — Auto-ignore false positives for this repository when Fencer triage confirms them.
  • Unpatched vulnerabilities — Defer vulnerabilities without an upstream patch.

When a specific finding is a known false positive or an accepted risk, you can suppress it by adding a comment on the same line as the finding, or on the line immediately above it. Subsequent scans will skip the suppressed line.

The scanner recognizes three suppression markers (case-insensitive):

  • nofencer — Fencer-specific marker. Use this when you want intent to be unambiguous.
  • nosec — also recognized for compatibility with Bandit and other tools.
  • nosemgrep — also recognized for compatibility with existing suppression comments.

The marker must follow a comment delimiter, and it is read as a whole word. A longer word that only contains those letters, such as nosecret or nosecurity, does not suppress the line. A hyphen does not attach to the marker, so nosec: and nosec-B101 are still the marker. Text after the marker suppresses every finding on the line, unless it names a check slug — see Suppressing one rule.

These comments are recognized:

  • # — Python, shell, Ruby, YAML, and other hash comments, including an end-of-line #.
  • // and /* */ — C-style comments. A /* */ comment can span lines.
  • -- — SQL (.sql) and Lua (.lua), through the end of the line.
  • <!-- --> — HTML (.html, .htm), Vue (.vue), and XML (.xml). The <!-- and the marker must be on the same line.

A marker elsewhere on the line, such as inside a plain string, is ignored. -- is only read in .sql and .lua files, and <!-- --> only in .html, .htm, .vue, and .xml files.

Python, shell, Ruby, and YAML:

# nofencer — required for dynamic expression handling
eval(user_input)
eval(user_input) # nosec

JavaScript, TypeScript, Go, Java, C/C++:

// nofencer — vetted internal input only
const fn = new Function(expr);
cmd := exec.Command("/bin/sh", "-c", input) // nosec

SQL and Lua:

-- nofencer
SELECT * FROM users WHERE id = '${user_input}';
loadstring(code) -- nofencer

HTML, Vue, and XML:

<!-- nofencer -->
<script src={dynamicSrc}></script>

Block comments, including ones that span several lines, are also supported:

/* nofencer: legacy interop, see RFC-1234 */
strcpy(dest, src);

A marker suppresses every finding on the line unless it names a check slug. To suppress one check and leave the others reported, list its check slug after the marker:

  • nofencer:<check-slug>[,<check-slug>]
  • nosemgrep:<check-slug>[,<check-slug>] (a = in place of : works too)
  • nosec <check-slug>[,<check-slug>] or nosec:<check-slug>

The id is the check slug in every case: the identifier on the check page, such as CODE-7K3M. Matching ignores case. Separate several slugs with commas. Words after the last slug are a reason.

A reason, a Bandit or gosec id (nosec B602, nosec G104), or an existing rule id (nosemgrep: python.lang.security.audit.foo) does not name a check slug, so the marker still suppresses every finding on the line. The same is true of a prose note after a colon, such as nofencer: legacy interop, see RFC-1234.

The marker has to be a whole word. nosecurity is not a suppression.

# nofencer:CODE-7K3M
eval(user_input)
subprocess.Popen(cmd, shell=True) # nosec CODE-7K3M, CODE-8N4P
# nofencer:CODE-7K3M,CODE-8N4P
resource "aws_s3_bucket" "logs" {
token = "example" # nofencer:CODE-7K3M
// nosemgrep:CODE-7K3M
db.findOne(req.body)
  • A marker that does not name a check slug suppresses all findings on the line it applies to. That includes a bare nofencer, nosec, or nosemgrep, a prose reason, and an id that is not a check slug.
  • A marker that lists check slugs suppresses only those checks. Other checks on the same line are still reported.
  • Suppression markers are honored by the static analysis, secret detection, infrastructure-as-code, and agent skill checks. They do not apply to dependency vulnerabilities.
  • For repository-wide exclusions, use the Exclude files or directories setting above rather than per-line comments.

After a scan completes, results are available on the repository detail page. The Quality gate card in the KPI summary shows whether the latest scan passed the checks configured for the repository, and the Scans tab lists the scan history for the selected branch. For each scan you can see:

  • Status — The scan’s status, such as Finished, Failed, or Skipped.
  • Trigger — What started the scan (manual, push, pull request, or scheduled).
  • Vulnerability counts — The total, with the number of new (+) and resolved (−) vulnerabilities.
  • When — How long ago the scan ran.

Click a scan to open its detail page. Use the Branch selector on the detail page to compare results across branches.

Each configured failure condition produces a Check with a pass or fail conclusion. Failed checks indicate that results exceeded your configured thresholds. These checks are reported back to your source code provider: as check runs on GitHub and Cursor Origin, and as commit statuses on GitLab, Bitbucket, and Azure DevOps. A commit on a branch outside the configured branch scope gets a Scan skipped status instead.

Terminal window
curl -X POST \
"https://app.fencer.dev/api/v1/org/<organization_slug>/repositories/<repository_id>/trigger-scan/" \
-H "Authorization: Bearer <api_token>" \
-H "Content-Type: application/json" \
-d '{"branch": "main"}'

New repositories already fail on new high or critical vulnerabilities and on new secrets, and post findings on pull requests. To block pull requests that introduce any new medium-or-higher vulnerability and any repository that has an open critical vulnerability:

  1. Open the repository’s Settings tab and go to Checks.
  2. Set Fail on new vulnerabilities if to Medium or higher.
  3. Set Critical threshold to 0.
  4. Make sure Fail on new secrets exposed and Post findings on pull requests are on.
  5. Click Save Changes.

With this configuration, any PR that introduces a medium-or-higher vulnerability or an exposed secret, or any scan that finds a critical vulnerability, gets a failing check.

  • Scan stuck in “Queued” — Verify that your integration credentials are still valid and that the repository is accessible. Check the connection on Admin > Integrations.
  • Scan failed — The repository’s detail page shows why the latest scan failed. When the cause is the repository’s configuration, click Fix configuration to open its Scanning settings. Common causes include private submodules that cannot be cloned or repository size exceeding limits.
  • Run scan is disabled — Hover over the button to see why: a scan is already in progress, a manual scan ran less than a minute ago, or scanning is suspended for the repository.
  • Findings not appearing on a pull request — Ensure Post findings on pull requests is on. Annotations need permission to write check runs or commit statuses. Comments are posted only for the latest commit on the pull request, and a later scan updates the existing comment. If that comment cannot be posted, GitHub keeps the findings as check annotations, Cursor Origin keeps them in the check run, and Bitbucket posts the Code Insights report. GitLab and Azure DevOps have no inline annotations; choose Comments under Post findings as to post findings there.