bandit does not respect -level for exit code

Bug #1480014 reported by Austin English
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bandit
Fix Released
Medium
Travis McPeak

Bug Description

Running bandit on a project with -lll (high) or -ll (medium) shows no issues, but exits with status 1. There are low issues, however, which bandit detects (but doesn't print because of the level option).

Bandit's exit code should respect the level option, and not exit with an error if no issues were detected at the desired scan level.

Changed in bandit:
importance: Undecided → Medium
assignee: nobody → Travis McPeak (travis-mcpeak)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to bandit (master)

Fix proposed to branch: master
Review: https://review.openstack.org/208629

Changed in bandit:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to bandit (master)

Reviewed: https://review.openstack.org/208629
Committed: https://git.openstack.org/cgit/openstack/bandit/commit/?id=c6a7f7948b7b6a8d0368c82227191640427011ff
Submitter: Jenkins
Branch: master

commit c6a7f7948b7b6a8d0368c82227191640427011ff
Author: Travis McPeak <email address hidden>
Date: Mon Aug 3 13:57:00 2015 -0600

    Fixes exit code for filtered results

    This commit fixes the return code when using a severity filter.
    Prior to this commit the exit code would be '1' - indicating
    results even when there weren't results displayed. This was
    because the exit code is based on total results whereas the
    display is based on a filtered subset of the results.

    Rather than filtering the results earlier on, this commit leaves
    the full set of results available for formatters that may want it.
    It also adds filter functionality to the results counter that the
    main module uses to determine what the exit code should be.

    Change-Id: I0b29ccab31c0898ebe84121d37cb0478ac3e2da9
    Closes-Bug: #1480014
    Closes-Bug: #1479216

Changed in bandit:
status: In Progress → Fix Committed
Revision history for this message
Eric Brown (ericwb) wrote :

Fix released in 0.13.0

Changed in bandit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.