Skip to content

Commit 5cd7432

Browse files
authored
Merge pull request #113 from awsntheule/bugfix/issue-101
Bugfix/issue 101
2 parents 73fd5d0 + a6e6a76 commit 5cd7432

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

CHANGELOG.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
# Automated Security Helper - CHANGELOG
2+
- [v2.0.1](#v201)
3+
- [What's Changed](#whats-changed)
24
- [v2.0.0](#v200)
35
- [Breaking Changes](#breaking-changes)
46
- [Features](#features)
57
- [Fixes](#fixes)
68
- [v1.5.1](#v151)
7-
- [What's Changed](#whats-changed)
8-
- [v1.5.0](#v150)
99
- [What's Changed](#whats-changed-1)
10+
- [v1.5.0](#v150)
11+
- [What's Changed](#whats-changed-2)
1012
- [New Contributors](#new-contributors)
1113
- [v1.4.1](#v141)
12-
- [What's Changed](#whats-changed-2)
13-
- [v1.4.0](#v140)
1414
- [What's Changed](#whats-changed-3)
15-
- [v1.3.3](#v133)
15+
- [v1.4.0](#v140)
1616
- [What's Changed](#whats-changed-4)
17-
- [v1.3.2](#v132)
17+
- [v1.3.3](#v133)
1818
- [What's Changed](#whats-changed-5)
19+
- [v1.3.2](#v132)
20+
- [What's Changed](#whats-changed-6)
1921
- [New Contributors](#new-contributors-1)
2022
- [1.3.0 - 2024-04-17](#130---2024-04-17)
2123
- [Features](#features-1)
@@ -28,6 +30,12 @@
2830
- [1.0.5-e-06Mar2023](#105-e-06mar2023)
2931
- [1.0.1-e-10Jan2023](#101-e-10jan2023)
3032

33+
## v2.0.1
34+
35+
### What's Changed
36+
37+
- Fix handling of Bandit config files in util script
38+
3139
## v2.0.0
3240

3341
### Breaking Changes

docs/content/faq.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ For additional CI pipeline support, please refer to the [Running ASH in CI](./tu
2222
## How can I run `ash` with [finch](https://aws.amazon.com/blogs/opensource/introducing-finch-an-open-source-client-for-container-development/) or another OCI compatible tool?
2323

2424
You can configure the OCI compatible tool to use with by using the environment variable `OCI_RUNNER`
25+
26+
## Can I use a Bandit configuration file when `ash` runs?
27+
28+
Yes, `ash` will use a bandit configuration file if it is placed at the root of your project directory. It must be named `.bandit`, `bandit.yaml`, or `bandit.toml`. Configuration files must be formatted properly according to the [Bandit documentation](https://bandit.readthedocs.io/en/latest/config.html).
29+
30+
> Note: paths excluded in a Bandit configuration file must begin with a `/` because `ash` uses an absolute path when calling `bandit`.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
[tool.poetry]
44
name = "automated-security-helper"
5-
version = "2.0.0"
5+
version = "2.0.1"
66
description = ""
77
authors = ["Nate Ferrell <[email protected]>", "Nathan Bates <[email protected]>"]
88
license = "Apache-2.0"

utils/py-docker-execute.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,17 @@ echo "<<<<<< end identifyipynb output for Jupyter notebook conversion <<<<<<" >>
5757
# Run bandit on both the source and output directories
5858
scan_paths=("${_ASH_SOURCE_DIR}" "${_ASH_OUTPUT_DIR}/work")
5959

60-
BANDIT_ARGS="--exclude=\"*venv/*\" --severity-level=all"
60+
if [ -f "${_ASH_SOURCE_DIR}/.bandit" ]; then
61+
BANDIT_ARGS="--ini ${_ASH_SOURCE_DIR}/.bandit"
62+
elif [ -f "${_ASH_SOURCE_DIR}/bandit.yaml" ]; then
63+
BANDIT_ARGS="-c ${_ASH_SOURCE_DIR}/bandit.yaml"
64+
elif [ -f "${_ASH_SOURCE_DIR}/bandit.toml" ]; then
65+
BANDIT_ARGS="-c ${_ASH_SOURCE_DIR}/bandit.toml"
66+
else
67+
BANDIT_ARGS="--exclude=\"*venv/*\" --severity-level=all"
68+
fi
69+
70+
debug_echo "[py] BANDIT_ARGS: '${BANDIT_ARGS}'"
6171
debug_echo "[py] ASH_OUTPUT_FORMAT: '${ASH_OUTPUT_FORMAT:-text}'"
6272
if [[ "${ASH_OUTPUT_FORMAT:-text}" != "text" ]]; then
6373
debug_echo "[py] Output format is not 'text', setting output format options to JSON to enable easy translation into desired output format"

0 commit comments

Comments
 (0)