From de04a1ed6791dbcb22105bda1d07dc7478dbe05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 19 Dec 2020 13:35:13 +0200 Subject: [PATCH] Enable more Bandit tests (#44307) https://bandit.readthedocs.io/en/latest/plugins/index.html#complete-test-plugin-listing --- homeassistant/components/recorder/util.py | 2 +- tests/bandit.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/recorder/util.py b/homeassistant/components/recorder/util.py index ed7f5affc56..abf14268687 100644 --- a/homeassistant/components/recorder/util.py +++ b/homeassistant/components/recorder/util.py @@ -149,7 +149,7 @@ def basic_sanity_check(cursor): """Check tables to make sure select does not fail.""" for table in ALL_TABLES: - cursor.execute(f"SELECT * FROM {table} LIMIT 1;") # sec: not injection + cursor.execute(f"SELECT * FROM {table} LIMIT 1;") # nosec # not injection return True diff --git a/tests/bandit.yaml b/tests/bandit.yaml index ebd284eaa01..568f77d622a 100644 --- a/tests/bandit.yaml +++ b/tests/bandit.yaml @@ -1,6 +1,7 @@ # https://bandit.readthedocs.io/en/latest/config.html tests: + - B103 - B108 - B306 - B307 @@ -13,5 +14,8 @@ tests: - B319 - B320 - B325 + - B601 - B602 - B604 + - B608 + - B609