Skip to content

Commit

Permalink
Fix scurity scan - move bandit conf to a deparate file (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws authored Mar 13, 2023
1 parent f200af7 commit 70df581
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# FILE: .bandit
[bandit]
exclude = ./bump-release.py,./build/*,./.venv/*
skips = B101,B608
9 changes: 6 additions & 3 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python
- name: Install Python Modules
run: |
python -m pip install --upgrade pip
pip install -U bandit toml pip-audit setuptools .
pip install -U bandit pip-audit setuptools .
- name: Install cid-cmd
run: |
pip install -U .
- name: Bandit Scan
run: |
bandit -c pyproject.toml -r .
bandit -r .
- name: Pip Audit
run: |
pip-audit
Expand Down
2 changes: 1 addition & 1 deletion cid/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def load_resources(self):
resources = {}
try:
if source.startswith('https://'):
resp = requests.get(source)
resp = requests.get(source, timeout=10)
assert resp.status_code in [200, 201], f'Error {resp.status_code} while loading url. {resp.text}'
resources = yaml.safe_load(resp.text)
else:
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"

[tool.bandit]
exclude_dirs = ["./bump-release.py"]
skips = ["B101","B608"]

0 comments on commit 70df581

Please sign in to comment.