-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Including CWE information #613
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e812ae3
Add CWE mappings to bandit issues and update formatters accordingly.
julianthome 961c6ec
Merge branch 'master' into master
julianthome 555b912
Integrated Cwe class and url information.
julianthome 463a5ae
typos
julianthome 68a1d14
cwemap
julianthome 0268604
linting issues
julianthome a373ef5
add cwe to denylist
julianthome e651e64
make linter happy
julianthome c34ae53
UNDEF -> NOTSET
julianthome 67481e5
Merge branch 'master' into master
julianthome 1b52960
Update issue.py
julianthome 981df3f
test
julianthome a917d1d
Apply suggestions from code review
ericwb bf48b1a
Apply suggestions from code review
ericwb 4af3fd0
Merge branch 'master' into master
ericwb 01b50d1
Apply suggestions from code review
ericwb 8284b59
Apply suggestions from code review
ericwb c3d29c0
Update tests/functional/test_functional.py
ericwb 56fc63b
Apply suggestions from code review
ericwb cbc3deb
Apply suggestions from code review
ericwb 282ad3d
Apply suggestions from code review
ericwb 270589c
Merge branch 'master' into master
ericwb File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from bandit.core import issue | ||
|
||
CWEMAP = { | ||
"B000": issue.Cwe.NOTSET, | ||
"LEGACY": issue.Cwe.NOTSET, | ||
# Plugins | ||
"B101": issue.Cwe.IMPROPER_CHECK_OF_EXCEPT_COND, | ||
"B102": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B103": issue.Cwe.INCORRECT_PERMISSION_ASSIGNMENT, | ||
"B104": issue.Cwe.MULTIPLE_BINDS, | ||
"B105": issue.Cwe.HARD_CODED_PASSWORD, | ||
"B108": issue.Cwe.INSECURE_TEMP_FILE, | ||
"B110": issue.Cwe.IMPROPER_CHECK_OF_EXCEPT_COND, | ||
"B112": issue.Cwe.IMPROPER_CHECK_OF_EXCEPT_COND, | ||
"B201": issue.Cwe.CODE_INJECTION, | ||
"B324": issue.Cwe.BROKEN_CRYPTO, | ||
"B501": issue.Cwe.IMPROPER_CERT_VALIDATION, | ||
"B502": issue.Cwe.BROKEN_CRYPTO, | ||
"B503": issue.Cwe.BROKEN_CRYPTO, | ||
"B504": issue.Cwe.BROKEN_CRYPTO, | ||
"B505": issue.Cwe.INADEQUATE_ENCRYPTION_STRENGTH, | ||
"B506": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B507": issue.Cwe.IMPROPER_CERT_VALIDATION, | ||
"B601": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B602": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B603": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B604": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B605": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B606": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B607": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B608": issue.Cwe.SQL_INJECTION, | ||
"B609": issue.Cwe.IMPROPER_WILDCARD_NEUTRALIZATION, | ||
"B611": issue.Cwe.SQL_INJECTION, | ||
"B701": issue.Cwe.CODE_INJECTION, | ||
"B702": issue.Cwe.BASIC_XSS, | ||
"B703": issue.Cwe.BASIC_XSS, | ||
# Calls | ||
"B301": issue.Cwe.DESERIALIZATION_OF_UNTRUSTED_DATA, | ||
"B302": issue.Cwe.DESERIALIZATION_OF_UNTRUSTED_DATA, | ||
"B303": issue.Cwe.BROKEN_CRYPTO, | ||
"B304": issue.Cwe.BROKEN_CRYPTO, | ||
"B305": issue.Cwe.BROKEN_CRYPTO, | ||
"B306": issue.Cwe.INSECURE_TEMP_FILE, | ||
"B307": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B308": issue.Cwe.XSS, | ||
"B309": issue.Cwe.CLEARTEXT_TRANSMISSION, | ||
"B310": issue.Cwe.PATH_TRAVERSAL, | ||
"B311": issue.Cwe.INSUFFICIENT_RANDOM_VALUES, | ||
"B312": issue.Cwe.CLEARTEXT_TRANSMISSION, | ||
"B313": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B314": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B315": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B316": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B317": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B318": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B319": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B320": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B321": issue.Cwe.CLEARTEXT_TRANSMISSION, | ||
"B322": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B323": issue.Cwe.IMPROPER_CERT_VALIDATION, | ||
"B325": issue.Cwe.INSECURE_TEMP_FILE, | ||
# Imports | ||
"B401": issue.Cwe.CLEARTEXT_TRANSMISSION, | ||
"B402": issue.Cwe.CLEARTEXT_TRANSMISSION, | ||
"B403": issue.Cwe.DESERIALIZATION_OF_UNTRUSTED_DATA, | ||
"B404": issue.Cwe.OS_COMMAND_INJECTION, | ||
"B405": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B406": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B407": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B408": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B409": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B410": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B411": issue.Cwe.IMPROPER_INPUT_VALIDATION, | ||
"B412": issue.Cwe.IMPROPER_ACCESS_CONTROL, | ||
"B413": issue.Cwe.BROKEN_CRYPTO, | ||
"B414": issue.Cwe.BROKEN_CRYPTO, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this why bandit 1.7.3 fails to load baseline data from JSON created by older bandit releases?