Skip to content
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

Removal of blacklist call B309 httpsconnection #858

Merged
merged 1 commit into from
Mar 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 3 additions & 15 deletions bandit/blacklists/calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
B309: httpsconnection
---------------------

The check for this call has been removed.

Use of HTTPSConnection on older versions of Python prior to 2.7.9 and 3.4.3 do
not provide security, see https://wiki.openstack.org/wiki/OSSN/OSSN-0033

Expand Down Expand Up @@ -479,21 +481,7 @@ def gen_blacklist():
)
)

sets.append(
utils.build_conf_dict(
"httpsconnection",
"B309",
issue.Cwe.CLEARTEXT_TRANSMISSION,
[
"httplib.HTTPSConnection",
"http.client.HTTPSConnection",
"six.moves.http_client.HTTPSConnection",
],
"Use of HTTPSConnection on older versions of Python prior to 2.7.9"
" and 3.4.3 do not provide security, see "
"https://wiki.openstack.org/wiki/OSSN/OSSN-0033",
)
)
# skipped B309 as the check for a call to httpsconnection has been removed

sets.append(
utils.build_conf_dict(
Expand Down
8 changes: 0 additions & 8 deletions examples/httplib_https.py

This file was deleted.

8 changes: 0 additions & 8 deletions tests/functional/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,6 @@ def test_hardcoded_tmp(self):
}
self.check_example("hardcoded-tmp.py", expect)

def test_httplib_https(self):
"""Test for `httplib.HTTPSConnection`."""
expect = {
"SEVERITY": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 3, "HIGH": 0},
"CONFIDENCE": {"UNDEFINED": 0, "LOW": 0, "MEDIUM": 0, "HIGH": 3},
}
self.check_example("httplib_https.py", expect)

def test_imports_aliases(self):
"""Test the `import X as Y` syntax."""
if sys.version_info >= (3, 9):
Expand Down