Skip to content

[VS Code] Show Scan Errors

User problem to solve

As a VS Code user, I want to see the status of SAST scans for my current file and understand any issues that prevent scanning, so that I can ensure my code is being properly checked for vulnerabilities.

Proposal

The following errors can be returned, we need to show a corresponding notification for each failure case.

  1. Network/fetch failure (failed to reach the GitLab instance)
    1. Pop up message: Unable to connect to GitLab. Please check your instance configuration and try again.
  2. 404 error (endpoint not found)
    1. Pop up message SAST scanning not available. SAST scanning is not available on your GitLab instance version.
  3. 401 error (invalid authentication token)
    1. Pop up message: Authentication failed. Your GitLab authentication token is invalid or has expired.
  4. 403 Error (feature unavailable for project or namespace)
    1. Pop up message: SAST scanning is not available. SAST scanning is not available for this project or namespace.
  5. All other errors (fallback / generic message)
    1. Pop up message: SAST scan error. An unexpected error occurred while performing the security scan.
Edited by Dasha Adushkina