Skip to content

Error running bandit - bandit_runner.exe not found #58

Closed as not planned

Description

Hello. I'm setting up the action in multiple repositories and all of them fails in the same step, while trying to execute bandit.

Logs:

Error:      Error running tool 2 of 5: bandit
Error:      Error running bandit job: 1 of 1
Error:      ToolLauncherNotFoundException: Could not successfully find the D:\a\_msdo\packages\nuget\Microsoft.Guardian.BanditRedist_windows_amd64.1.6.3.1\tools\bandit_runner.exe tool launcher. Please ensure any dependent frameworks are installed.
Error:      Win32Exception: An error occurred trying to start process 'D:\a\_msdo\packages\nuget\Microsoft.Guardian.BanditRedist_windows_amd64.1.6.3.1\tools\bandit_runner.exe' with working directory 'D:\a\AzureGoat\AzureGoat'. The filename or extension is too long.
Error:      BreakException: Guardian detected one or more breaking results.
Error: Error: The process 'D:\a\_msdo\versions\microsoft.security.devops.cli\0.163.0\tools\guardian.cmd' failed with exit code 1

The action run resides in: https://github.com/rpiraces-plain/AzureGoat/actions/runs/5164467559/jobs/9303379837

How can I fix this? I have set up anything wrong?

Edit:
Works perfectly fine with ubuntu-latest runner... seems it only fails with windows-latest runner.

Activity

  1. JiandongJiang commented on Jun 6, 2023

    @JiandongJiang
    Contributor

    From the logs, it looks like that the Bandit issue was caused by the length of the Bandit command line too long ("The filename or extension is too long." in the log) due to the command length restriction on Windows. As a workaround, to shorten the length of the Bandit command line on Windows, you can follow the wiki at "https://github.com/microsoft/security-devops-action/wiki#bandit-options" to configure the Target argument so as for Bandit to scan fewer files and see if it will resolve the issue. If you need Bandit to scan more files, you can follow the same wiki to create a *.gdnconfig file to run Bandit multiple times on different targets. Meanwhile, we will seek if there could be a way to better handle it.

  2. piraces commented on Jun 6, 2023

    @piraces
    Author

    Thank you for your response Jiandong Jiang (@JiandongJiang) ! I will try to do that 👍

  3. DimaBir commented on Jul 28, 2026

    @DimaBir
    Collaborator

    We're cleaning up the issue backlog in this repo, and this one has been inactive for a long time, so we're closing it.

    If it's still affecting you, just reopen it or drop a comment — that's enough, and we'll pick it up from there. Nothing else needed from you.

    Sorry we left this sitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions