Skip to content

Commit

Permalink
fix: improve bandit config intel#3830
Browse files Browse the repository at this point in the history
  • Loading branch information
––harshittiwariii committed Feb 29, 2024
1 parent 171c480 commit c728415
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions bandit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
tests:

# (optional) list skipped test IDs here, eg '[B101, B406]':
skips: ['B603', 'B607', 'B404', "B608"]
skips: ['B603', 'B607', 'B404']
# B603, B607 and B404 are all subprocess-related.
# B608 should be re-enabled when multi-line issues can be marked with nosec

# Explantion: cve-bin-tool is at heart a shell script that calls other processes.
# Explanation: cve-bin-tool is at heart a shell script that calls other processes.
# Switching to pure python has significant performance impacts.

# skips assert rule on tests
Expand All @@ -100,5 +100,4 @@ assert_used:
### that may be given here, per-plugin. All bandit test plugins have a built in
### set of sensible defaults and these will be used if no configuration is
### provided. It is not necessary to provide settings for every (or any) plugin
### if the defaults are acceptable.

### if the defaults are acceptable.
4 changes: 2 additions & 2 deletions cve_bin_tool/cvedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def latest_schema(

self.LOGGER.debug("Check database is using latest schema")
cursor = self.db_open_and_get_cursor()
schema_check = f"SELECT * FROM {table_name} WHERE 1=0"
schema_check = f"SELECT * FROM {table_name} WHERE 1=0" #nosec
result = cursor.execute(schema_check)
schema_latest = False

Expand Down Expand Up @@ -865,7 +865,7 @@ def get_all_records_in_table(self, table_name):
"""Return JSON of all records in a database table."""
cursor = self.db_open_and_get_cursor()
cursor.row_factory = self.dict_factory
cursor.execute(f"SELECT * FROM '{table_name}' ")
cursor.execute(f"SELECT * FROM '{table_name}' ") #nosec
# fetchall as result
results = cursor.fetchall()
self.db_close()
Expand Down

0 comments on commit c728415

Please sign in to comment.