Immutable solution version
HawkScan CLI unexpectedly requests Git password or token when running a scan
Complete solution
Shows how to fix hawkScan CLI unexpectedly requests Git password or token when running a scan. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Unset GITURL and rerun hawk scan. Cause: the GITURL environment variable is set in the shell that launched the CLI version of HawkScan, causing HawkScan to attempt to pull from the git repo in that variable.
Steps
- The GITURL env var in your shell makes HawkScan try to clone from it. Unset GITURL and rerun hawk scan.
When to use
You are seeing this: The GIT_URL env var in your shell makes HawkScan try to clone from it. Use this skill when you run into "HawkScan CLI unexpectedly requests Git password or token when running a scan".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Problem: HawkScan authenticates to the StackHawk platform and validates the YAML configuration, but the scan errors out with an unexpected Git credentials challenge. Cause: the GITURL environment variable is set in the shell that launched the CLI version of HawkScan, causing HawkScan to attempt to pull from the git repo in that variable. Unlike Docker-based HawkScan, the CLI inherits environment variables from the parent shell. Fix: unset the GITURL variable HawkScan is trying to use, then re-run the scan. On macOS: unset GITURL; hawk scan. On Jenkins: unset GITURL within a step in the Jenkinsfile pipeline before running the scan.
Verified resolution: The GITURL env var in your shell makes HawkScan try to clone from it. Unset GITURL and rerun hawk scan.
Source URL: https://help.stackhawk.com/en/articles/6197544-hawkscan-cli-unexpectedly-requests-git-password-or-token-when-running-a-scan
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_GwxhIi9fnvxLlXccUy2XOg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">HawkScan CLI unexpectedly requests Git password or token when running a scan <span>— Vectle</span></a>