-
Notifications
You must be signed in to change notification settings - Fork 0
Sync with upstream and update README and dependencies #18
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
base: main
Are you sure you want to change the base?
Changes from all commits
c5150a2
e2e29b9
ad6fae3
11a72c7
919c5b3
945f6f6
9f79db2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,12 +107,20 @@ runs: | |
| INI_PATH="--ini $INPUT_INI_PATH" | ||
| fi | ||
|
|
||
| CONFIG_PATH_ARG="" | ||
| if [ "$INPUT_CONFIG_PATH" == "DEFAULT" ]; then | ||
| # Clear both | ||
| CONFIG_PATH="" | ||
| CONFIG_PATH_ARG="" | ||
| unset CONFIG_PATH 2>dev/null || true # also try to unset | ||
| else | ||
| CONFIG_PATH="-c $INPUT_CONFIG_PATH" | ||
| if [ -n "$INPUT_CONFIG_PATH" ] ; then | ||
| # Set both (but let bandit validate its own arguments) | ||
| CONFIG_PATH="$INPUT_CONFIG_PATH" # quote paths on assignment | ||
| CONFIG_PATH_ARG="-c" | ||
| fi | ||
| fi | ||
| bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH $CONFIG_PATH | ||
| bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH $CONFIG_PATH_ARG ${CONFIG_PATH:-} | ||
|
Comment on lines
+119
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
CONFIG_PATH='configs/security policy.yaml'
CONFIG_PATH_ARG='-c'
printf '<%s>\n' $CONFIG_PATH_ARG ${CONFIG_PATH:-}Repository: reactive-firewall/python-bandit-scan Length of output: 212 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf 'Files:\n'
git ls-files | rg '(^|/)action\.y(a)?ml$|(^|/)README\.md$' || true
printf '\nRelated action.yml section:\n'
sed -n '90,145p' action.yml
printf '\nSearch config options:\n'
rg -n "CONFIG_PATH|input_config_path|config:" README.md action.yml || trueRepository: reactive-firewall/python-bandit-scan Length of output: 2743 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf 'Demonstrating Bash expansion behavior:\n'
for VALUE in 'configs/security policy.yaml' 'configs/*.yaml' ''; do
CONFIG_PATH_ARG='-c'
CONFIG_PATH="$VALUE"
printf 'Input: <%s>\n' "$VALUE"
printf 'printf outputs:\n'
printf '<%s>\n' $CONFIG_PATH_ARG ${CONFIG_PATH:-} || true
printf '\n'
done
printf 'Demonstrating Bash array behavior:\n'
CONFIG_PATH_ARGS=(-c 'configs/security policy.yaml')
printf 'printf outputs:\n'
printf '<%s>\n' "${CONFIG_PATH_ARGS[@]}"
printf '\n'Repository: reactive-firewall/python-bandit-scan Length of output: 489 Preserve Line 119 quotes the assignment, but line 123 expands 🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙅🏻 While I appreciate the idea, your suggestion seems to introduce abstractions that may violate the Avoid Hasty Abstraction principle. Namely you assume it is desirable to use a bash array, and that bandit will handle This causes a regression. The current logic ensures There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If "${CONFIG_PATH_ARGS[@]}"expands to zero arguments. It does not pass The current For example, if the input is ${CONFIG_PATH:-}becomes two arguments. It does not become one escaped argument. The array is not an additional abstraction for its own sake. It models the required command arguments: either no config arguments, or exactly The original finding remains applicable. You are interacting with an AI system.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I see where you're going with this, but let's prove it with test code before making any changes. Test Requirements:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' 'Repository files relevant to tests and tooling:'
fd -HI -t f \
-e yml -e yaml -e py -e sh -e toml -e ini -e cfg \
-g '!*node_modules*' -g '!*dist*' -g '!*build*' \
| sort
printf '%s\n' 'Root-level metadata:'
fd -HI -t f -d 1 | sort
printf '%s\n' 'Test and Bandit references:'
rg -n -C 3 \
-e 'pytest|unittest|bats|shellcheck|bandit|action\.yml|composite' \
-g '!*node_modules*' -g '!*dist*' -g '!*build*' \
. || trueLength of output: 990 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' 'Repository files relevant to tests and tooling:'
fd -HI -t f . \
--exclude node_modules --exclude dist --exclude build \
-e yml -e yaml -e py -e sh -e toml -e ini -e cfg \
| sort
printf '%s\n' 'Root-level metadata:'
fd -HI -t f -d 1 . | sort
printf '%s\n' 'Test and Bandit references:'
rg -n -C 3 \
-e 'pytest|unittest|bats|shellcheck|bandit|action\.yml|composite' \
-g '!node_modules/**' -g '!dist/**' -g '!build/**' \
. || trueLength of output: 4264
The test will execute the actual The test will place a local
This proves the Bash boundary and the Python CLI boundary without installing Bandit or accessing the network.
You are interacting with an AI system. |
||
| env: | ||
| INPUT_PATH: ${{ inputs.path }} | ||
| INPUT_LEVEL: ${{ inputs.level }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: reactive-firewall/python-bandit-scan
Length of output: 1768
Add
config_pathto the README.action.ymldefines and passesconfig_pathto Bandit with-c, including the YAML/TOML support. The README currently documents onlyini_pathfor.banditinput. Add aconfig_pathentry so users know both configuration mechanisms are available.🤖 Prompt for AI Agents