Skip to content

Commit

Permalink
ACS-9044 POC - Remove excluded files from alfresco.war before Veracod…
Browse files Browse the repository at this point in the history
…e SAST
  • Loading branch information
SaraAspery committed Dec 18, 2024
1 parent 4a45858 commit 958e51a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ jobs:
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Remove excluded files"
run: bash ./scripts/ci/remove-sast-exclusions.sh
- name: "Run SAST Scan"
uses: veracode/[email protected]
with:
vid: '${{ secrets.VERACODE_API_ID }}'
vkey: '${{ secrets.VERACODE_API_KEY }}'
file: "distribution/target/alfresco.war"
file: "distribution/target/alfresco-reduced.war"
fail_build: true
project_name: acs-packaging-acs
issue_details: true
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/SAST-exclusion-list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring-security*
24 changes: 24 additions & 0 deletions scripts/ci/remove-sast-exclusions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
echo "=========================== Excluding Files from Veracode SAST ==========================="
set -ex
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"

# Copy alfresco.war file
/bin/cp -f ./distribution/target/alfresco.war ./distribution/target/alfresco-reduced.war

# Remove files to be excluded from Veracode SAST
exclusions="./scripts/ci/SAST-exclusion-list.txt"
if [ -e $exclusions ]
then
while read -r line
do
echo "Removing WEB-INF/lib/$line"
zip -d ./packaging/war/target/alfresco-reduced.war "WEB-INF/lib/$line" || true
done < "$exclusions"
else
echo "No files to be excluded from SAST"
fi

popd
set +ex
echo "=========================== Finishing Excluding Files from Veracode SAST =========================="

0 comments on commit 958e51a

Please sign in to comment.