Skip to content

Commit

Permalink
fix: Renaming test project manifest files to avoid security scanning
Browse files Browse the repository at this point in the history
Why: To prevent deprecated/vulnerable library dependencies in sample projects from being flagged during security scanning, as these sample projects are not intended for production use but needed to run integration tests.

How: Renaming all manifest files (e.g., pom.xml, package.json, requirements.txt, Gemfile) to a placeholder name (PLACEHOLDER_MANIFEST) and moving them back with the correct name during the integration test setup.
  • Loading branch information
Anushka Srinivasa committed May 6, 2024
1 parent 710b081 commit d8f99a1
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ source ./test-helpers.sh
FILE_NAME=`./getBinaryName.sh`
chmod +x ./dist/$FILE_NAME

# Rename all project manifests to correct format.
# This is done to avoid security scanning them for deprecated/vulnerable library dependancies
# These sample projects are not intended to be used in production, but are used for testing
mv ./sample-projects/dotnet-samples/PLACEHOLDER_MANIFEST ./sample-projects/dotnet-samples/sample.csproj
mv ./sample-projects/go-samples/compatible/PLACEHOLDER_MANIFEST ./sample-projects/go-samples/compatible/go.mod
mv ./sample-projects/go-samples/incompatible/PLACEHOLDER_MANIFEST ./sample-projects/go-samples/incompatible/go.mod
mv ./sample-projects/java-samples/PLACEHOLDER_MANIFEST ./sample-projects/java-samples/pom.xml
mv ./sample-projects/node-samples/PLACEHOLDER_MANIFEST ./sample-projects/node-samples/package.json
mv ./sample-projects/python-samples/compatible/PLACEHOLDER_MANIFEST ./sample-projects/python-samples/compatible/requirements.txt
mv ./sample-projects/python-samples/incompatible/PLACEHOLDER_MANIFEST ./sample-projects/python-samples/incompatible/requirements.txt
mv ./sample-projects/ruby-samples/PLACEHOLDER_MANIFEST ./sample-projects/ruby-samples/Gemfile

echo "Running samples to console"
./dist/$FILE_NAME ./sample-projects/ > console_test.txt
test_report 'console' 'console_test.txt' "${lines_to_find[@]}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d8f99a1

Please sign in to comment.