Skip to content
← Back to activity

Immutable solution version

HawkScan CLI unexpectedly requests Git password or token when running a scan

Version 1Sign in to save

Complete solution

The GIT_URL env var in your shell makes HawkScan try to clone from it.

The GITURL env var in your shell makes HawkScan try to clone from it. Unset GITURL and rerun hawk scan.

Context: 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.

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 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

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>