Skip to content

feat(docs, aws reporters): Lots of doc updates, also added BedrockSum… #155

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

Merged
merged 36 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2d1672e
feat(docs, aws reporters): Lots of doc updates, also added BedrockSum…
scrthq Jun 6, 2025
7c127ea
feat(tests): added test framework structure and true global suppressions
scrthq Jun 6, 2025
01c0516
feat(tests): added test framework structure and true global suppressions
scrthq Jun 7, 2025
5f1055c
feat(tests): tests passing again, working on coverage increasing
scrthq Jun 7, 2025
11d5cb5
saving point mid-fix
scrthq Jun 7, 2025
d7d69d1
saving point mid-fix
scrthq Jun 7, 2025
0fd0427
saving point mid-fix
scrthq Jun 7, 2025
aa1c2fb
saving point mid-fix
scrthq Jun 7, 2025
dcc2fd7
fixing tests
scrthq Jun 7, 2025
1573a97
test errors resolved, fixing remaining failures now
scrthq Jun 7, 2025
699ff6d
fixed more tests
scrthq Jun 8, 2025
266d2f1
fix(tests): finally all fixed
scrthq Jun 8, 2025
6d1da78
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
c5aa167
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
49020f3
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
3ba7c83
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
9f28db4
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
ee44aa4
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
008422b
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
9cfc582
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
3d54893
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
5065978
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
741ce69
fix(tests): fixing new test failures?
scrthq Jun 8, 2025
834a003
chore(docs, tests): cleaned up tests from unsafe temp path usage, mov…
scrthq Jun 8, 2025
2a819f6
chore(docs, tests): cleaned up tests from unsafe temp path usage, mov…
scrthq Jun 8, 2025
6ef65f4
chore(docs, tests): cleaned up tests from unsafe temp path usage, mov…
scrthq Jun 8, 2025
319db21
fix(tests): adjusted clean_dict test to be included, fixed failures
scrthq Jun 8, 2025
a556693
chore(ci): removed coverage workflow, not needed as it is built into …
scrthq Jun 8, 2025
dcade41
chore(ci): removed coverage workflow and adapters, not needed
scrthq Jun 9, 2025
aa53936
fix(docs): added timeout to requests call in testing documentation
scrthq Jun 9, 2025
425af7c
chore(dx): centralized ash built-in plugins
scrthq Jun 9, 2025
4c5be39
chore(docs): added documentation for built-in plugins and updated nav
scrthq Jun 9, 2025
9637eac
chore(docs, tests, ci): updates with tests all passing again, docs re…
scrthq Jun 11, 2025
290c4c5
fix(ci): troubleshooting windows scan validation step
scrthq Jun 11, 2025
7b04706
fix(ci): troubleshooting windows scan validation step
scrthq Jun 11, 2025
a5985d6
fix(ci): troubleshooting windows scan validation step
scrthq Jun 11, 2025
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
13 changes: 7 additions & 6 deletions .ash/.ash.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# yaml-language-server: $schema=../automated_security_helper/schemas/AshConfig.json
project_name: automated-security-helper
fail_on_findings: true
# ash_plugin_modules:
# - automated_security_helper.plugin_modules.ash_aws_plugins
ash_plugin_modules:
- automated_security_helper.plugin_modules.ash_aws_plugins
external_reports_to_include: []
global_settings:
severity_threshold: MEDIUM
suppressions:
- path: docs/content/docs/testing/examples/*
reason: Documentation with test code examples focused on brevity.
- path: 'tests/test_data'
reason: This is test data that is used during unit testing only and is not part of the core application.
ignore_paths:
- path: 'automated_security_helper/assets/ASH_COMMIT*'
reason: This file is generated by the build process and does not contain any secrets or sensitive information.
- path: 'tests/test_data'
reason: This is test data that is used during unit testing only and is not part of the core application.
- path: 'tests/pytest-temp'
reason: This is temporary data that is generated during unit testing only and is not part of the core application.
- path: '.venv'
Expand All @@ -21,8 +24,6 @@ global_settings:
reason: This file is generated by a corresponding Pydantic model and does not contain any secrets or sensitive information. Findings on this file are false positives and should be addressed on the related Pydantic models, not on this JSON file.
- path: '**/automated_security_helper/schemas/AshConfig.json'
reason: This file is generated by a corresponding Pydantic model and does not contain any secrets or sensitive information. Findings on this file are false positives and should be addressed on the related Pydantic models, not on this JSON file.
- path: '.ash/ash_output*/scanners'
reason: These are ash_output directories used for scans and are not committed to the repository or included in the package.
reporters:
asff:
enabled: false
Expand Down
2 changes: 2 additions & 0 deletions .ash/bandit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ assert_used:
skips:
- "*/test_*.py"
- "**/test_*.py"
- "*/utils/*.py"
- "**/utils/*.py"
22 changes: 22 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[run]
source = automated_security_helper

[report]
# Show missing lines in reports
show_missing = True
# Fail if total coverage is below 64%
fail_under = 64

[html]
directory = test-results/coverage_html
title = ASH Coverage Report

[xml]
output = test-results/pytest.coverage.xml

[json]
output = test-results/pytest.coverage.json
pretty_print = True

[paths]
source = automated_security_helper/**/*.py
26 changes: 19 additions & 7 deletions .github/workflows/ash-repo-scan-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
# method: python-container
# platform: windows/amd64
### Temp disabled to not impact others as this currently hangs
# - os: windows-latest
# method: python-local
# platform: windows/amd64
- os: windows-latest
method: python-local
platform: windows/amd64

runs-on: ${{ matrix.os }}
timeout-minutes: 15
Expand Down Expand Up @@ -136,23 +136,30 @@ jobs:
# It should fail if there are findings in the scan, but that's a valid test for us still.
shell: bash
continue-on-error: true
timeout-minutes: 10
run: |
echo "Testing ASH using Python (Container) on ${{ matrix.os }} (${{ matrix.platform }})"
echo "ASH Version:"
ash --version
echo "ASH Help:"
ash --help
ash scan --mode=container --build-target ci --source-dir "$(pwd)" --output-dir "$(pwd)/.ash/ash_output" --verbose --no-progress --config ./.ash/.ash_no_ignore.yaml
echo "ASH Scan Output:"
ash scan --mode container --build-target ci --verbose --no-progress --config ./.ash/.ash_no_ignore.yaml

- name: Validate ASH using Python Local
if: matrix.method == 'python-local'
# We're not worried if the scan failed, we are validating that it produces the outputs expected.
# It should fail if there are findings in the scan, but that's a valid test for us still.
shell: bash
continue-on-error: true
timeout-minutes: 4
run: |
echo "Testing ASH using Python (Local) on ${{ matrix.os }} (${{ matrix.platform }})"
echo "ASH Version:"
ash --version
echo "ASH Help:"
ash --help
ash scan --mode=local --source-dir "$(pwd)" --output-dir "$(pwd)/.ash/ash_output" --verbose --no-progress --config ./.ash/.ash_no_ignore.yaml
echo "ASH Scan Output:"
ash scan --mode local --build-target ci --verbose --no-progress --config ./.ash/.ash_no_ignore.yaml

############ PowerShell #########

Expand All @@ -162,6 +169,7 @@ jobs:
# We're not worried if the scan failed, we are validating that it produces the outputs expected.
# It should fail if there are findings in the scan, but that's a valid test for us still.
continue-on-error: true
timeout-minutes: 10
run: |
Write-Host "Testing ASH using PowerShell on ${{ matrix.os }} (${{ matrix.platform }})"
. ./utils/ash_helpers.ps1
Expand All @@ -174,14 +182,18 @@ jobs:
# We're not worried if the scan failed, we are validating that it produces the outputs expected.
# It should fail if there are findings in the scan, but that's a valid test for us still.
continue-on-error: true
timeout-minutes: 10
if: matrix.method == 'bash'
shell: bash
run: |
echo "Testing ASH using Bash on ${{ matrix.os }} (${{ matrix.platform }})"
chmod +x ./ash
echo "ASH Version:"
./ash --version
echo "ASH Help:"
./ash --help
./ash --build-target ci --source-dir "$(pwd)" --output-dir "$(pwd)/.ash/ash_output" --verbose --debug --config ./.ash/.ash_no_ignore.yaml
echo "ASH Scan Output:"
./ash --build-target ci --verbose --config ./.ash/.ash_no_ignore.yaml


- name: Verify scan completed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-ash-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
shell: bash
run: |-
uvx --from $ASH_UVX_SOURCE ash \
--source-dir . --output-dir ${{ inputs.output-dir }} ${{ inputs.ash-args }} --build-target ci ${{ inputs.fail-on-findings == 'true' && '--fail-on-findings' || '--no-fail-on-findings'}} --mode ${{ inputs.ash-mode }} ${{ inputs.verbose && '--verbose' }}
--source-dir . --output-dir ${{ inputs.output-dir }} ${{ inputs.ash-args }} --no-progress --build-target ci ${{ inputs.fail-on-findings == 'true' && '--fail-on-findings' || '--no-fail-on-findings'}} --mode ${{ inputs.ash-mode }} ${{ inputs.verbose && '--verbose' }}

- name: Show ASH Summary Report
if: success() || failure()
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# TEMP
/automated_security_helper/identifiers/
/fix_*.py

# ASH Ignores
utils/cfn-to-cdk/cfn_to_cdk/
utils/cfn-to-cdk/cdk.out/
/**/aggregated_results.txt
Expand All @@ -14,6 +19,7 @@ test_output.json
tests/pytest-temp/
output/
.*q/
.kir*/
/Amazon*.md
.envrc
utils/try*.sh
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ repos:
## REQUIRED ARGS
# N/A - ASH pre-commit hooks include `--mode=precommit` by default.
# The only ARGS needed are custom args past what is available by default.

#
## EXTRA ARGS (these are specific to this repo's usage of the hook and are not required)
# Default behavior is to fail if any actionable findings are found.
# We are working through resolution right now while still needing
Expand Down
12 changes: 7 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
},
{
"args": [
"--verbose"
"--verbose",
"--scanners",
"detect-secrets"
],
"console": "integratedTerminal",
"console": "internalConsole",
"env": {
"PATH": "${workspaceFolder}/.venv/bin:/opt/homebrew/bin:~/.local/share/mise/installs/node/20.19.0/bin:${env.PATH}"
},
Expand All @@ -28,7 +30,7 @@
"--config",
"${workspaceFolder}/.ash/.ash.yaml"
],
"console": "integratedTerminal",
"console": "internalConsole",
"env": {
"PATH": "${workspaceFolder}/.venv/bin:/opt/homebrew/bin:~/.local/share/mise/installs/node/20.19.0/bin:${env.PATH}"
},
Expand All @@ -39,14 +41,14 @@
},
{
"args": [],
"console": "integratedTerminal",
"console": "internalConsole",
"name": "ASH: Test CDK Nag Headless Wrapper",
"program": "./automated_security_helper/utils/cdk_nag_wrapper.py",
"request": "launch",
"type": "debugpy"
},
{
"console": "integratedTerminal",
"console": "internalConsole",
"env": {
"_PYTEST_RAISE": "1"
},
Expand Down
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#checkov:skip=CKV_DOCKER_7:Base image is using a non-latest version tag by default, Checkov is unable to parse due to the use of ARG
ARG BASE_IMAGE=public.ecr.aws/docker/library/python:3.10-bullseye
ARG BASE_IMAGE=public.ecr.aws/docker/library/python:3.12-bullseye

# First stage: Build poetry requirements
FROM ${BASE_IMAGE} AS poetry-reqs
Expand Down Expand Up @@ -193,12 +193,6 @@ ENV _ASH_EXEC_MODE="local"
RUN ash dependencies install --bin-path "${ASH_BIN_PATH}"
ENV PATH="${ASH_BIN_PATH}:$PATH"

#
# Explicit Semgrep install to resolve underlying dependency
# resolution issues when running inside the container
#
RUN python3 -m pip install semgrep --force

#
# Flag ASH as running in container to prevent ProgressBar panel from showing (causes output blocking)
#
Expand Down
Loading
Loading