Skip to content

Commit b3c0598

Browse files
test(COD-6066): enable the taint analysis in the integration tests (#246)
1 parent d6c79c4 commit b3c0598

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ jobs:
3030
run: |
3131
mkdir ../action
3232
mv * ../action
33-
mv ../action/sample-repo/* .
33+
rsync --archive ../action/sample-repo/ .
34+
- name: Compile test project
35+
run: |
36+
mvn --quiet clean compile
37+
dotnet build --verbosity quiet .
3438
- name: Run action
3539
id: run-action
3640
uses: ./../action
@@ -57,13 +61,12 @@ jobs:
5761
working-directory: artifact
5862
run: |
5963
if [ -f scanning-report.sarif ]; then
64+
export expectedScaResults=9
6065
export SCA_RESULTS=`jq '.runs | map (.results | length) | add' scanning-report.sarif`
61-
echo "Got $SCA_RESULTS from SCA"
62-
if [ "$SCA_RESULTS" -eq 0 ]; then
66+
if [ "$SCA_RESULTS" -eq $expectedScaResults ]; then
67+
echo "Found expected number of SCA results: $SCA_RESULTS"
68+
else
6369
echo "::error::Expected to have $expectedScaResults SCA results!"
6470
exit 1
6571
fi
66-
else
67-
echo "::error::SCA results not found!"
68-
exit 1
6972
fi

sample-repo/.lacework/codesec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
default:
2+
sca:
3+
enabled: true
4+
scan:
5+
taintAnalysis: true

sample-repo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class PulseTaintTests
66
{
77
[HttpPost]
8-
static void httpPostSourceToSqlSink(string inputParameter)
8+
static void HttpPostSourceToSqlSink(string inputParameter)
99
{
1010
using var _ = new SqlCommand(inputParameter);
1111
}

0 commit comments

Comments
 (0)