Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion mise/tasks/check/gosec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,20 @@
#MISE description="Run gosec"
set -euo pipefail

go tool github.com/securego/gosec/v2/cmd/gosec --exclude-generated -terse ./...
# Most of these exclusions are due to the fact that this is a tool used locally, and not served on the internet. If users of this tool want to hack themselves they are free to do so.
excluded_checks=(
"G204" # allow passing flags directly to subprocesses
"G204" # allow subprocesses that use variables
"G107" # allow user input in http requests
"G304" # allow path traversal
"G112" # allow http serve without timeouts - slowloris is not a concern for apps running locally
"G114" ## allow http serve without timeouts - slowloris is not a concern for apps running locally
)
(
IFS=','
go tool github.com/securego/gosec/v2/cmd/gosec \
-exclude-generated \
-terse \
"-exclude=${excluded_checks[*]}" \
./...
)