diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index c2343f78..26356dfc 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -30,7 +30,11 @@ jobs: run: | mkdir ../action mv * ../action - mv ../action/sample-repo/* . + rsync --archive ../action/sample-repo/ . + - name: Compile test project + run: | + mvn --quiet clean compile + dotnet build --verbosity quiet . - name: Run action id: run-action uses: ./../action @@ -57,13 +61,12 @@ jobs: working-directory: artifact run: | if [ -f scanning-report.sarif ]; then + export expectedScaResults=9 export SCA_RESULTS=`jq '.runs | map (.results | length) | add' scanning-report.sarif` - echo "Got $SCA_RESULTS from SCA" - if [ "$SCA_RESULTS" -eq 0 ]; then + if [ "$SCA_RESULTS" -eq $expectedScaResults ]; then + echo "Found expected number of SCA results: $SCA_RESULTS" + else echo "::error::Expected to have $expectedScaResults SCA results!" exit 1 fi - else - echo "::error::SCA results not found!" - exit 1 fi diff --git a/sample-repo/.lacework/codesec.yaml b/sample-repo/.lacework/codesec.yaml new file mode 100644 index 00000000..f0fa23d0 --- /dev/null +++ b/sample-repo/.lacework/codesec.yaml @@ -0,0 +1,5 @@ +default: + sca: + enabled: true + scan: + taintAnalysis: true diff --git a/sample-repo/Program.cs b/sample-repo/Program.cs index 7f391280..993ffaf8 100644 --- a/sample-repo/Program.cs +++ b/sample-repo/Program.cs @@ -5,7 +5,7 @@ class PulseTaintTests { [HttpPost] - static void httpPostSourceToSqlSink(string inputParameter) + static void HttpPostSourceToSqlSink(string inputParameter) { using var _ = new SqlCommand(inputParameter); }