From c82f7ad88016405f42f604a4132b664a21049ac6 Mon Sep 17 00:00:00 2001 From: Horia Stere Date: Fri, 28 Aug 2026 14:10:15 +0300 Subject: [PATCH 1/2] [MSDKS-2201] test semgrep for ios, android & dart --- .github/workflows/semgrep.yml | 122 ++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 .github/workflows/semgrep.yml diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml new file mode 100644 index 0000000..8ae3103 --- /dev/null +++ b/.github/workflows/semgrep.yml @@ -0,0 +1,122 @@ +name: Semgrep SAST Scan + +on: + push: + branches: + - main + - feature/MSDKS-2201-implement-semgrep + pull_request: + branches: [ "main" ] + schedule: + # Run a full scan every Monday at midnight + - cron: '0 0 * * 1' + workflow_dispatch: + +jobs: + semgrep-android: + name: Semgrep Scan (Android) + runs-on: ubuntu-latest + + permissions: + actions: read + contents: read + security-events: write + + container: + image: semgrep/semgrep:1.171.0@sha256:bdf7013b2c3634a487671158da77c554f531742326b543a9464d2adf6c433ac8 + + steps: + - name: Checkout Code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Run Semgrep Scan + run: >- + semgrep scan + --config p/security-audit + --config p/secrets + --config p/owasp-top-ten + --config p/kotlin + BlinkCard/android + --sarif + --output=semgrep.sarif + + - name: Upload SARIF Results to GitHub Security Tab + uses: github/codeql-action/upload-sarif@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + if: always() + with: + sarif_file: semgrep.sarif + category: semgrep-android + + semgrep-ios: + name: Semgrep Scan (iOS) + runs-on: ubuntu-latest + + permissions: + actions: read + contents: read + security-events: write + + container: + image: semgrep/semgrep:1.171.0@sha256:bdf7013b2c3634a487671158da77c554f531742326b543a9464d2adf6c433ac8 + + steps: + - name: Checkout Code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Run Semgrep Scan + run: >- + semgrep scan + --config p/security-audit + --config p/secrets + --config p/owasp-top-ten + --config p/swift + BlinkCard/ios + --sarif + --output=semgrep.sarif + + - name: Upload SARIF Results to GitHub Security Tab + uses: github/codeql-action/upload-sarif@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + if: always() + with: + sarif_file: semgrep.sarif + category: semgrep-ios + + semgrep-dart: + name: Semgrep Scan (Dart) + runs-on: ubuntu-latest + + permissions: + actions: read + contents: read + security-events: write + + container: + image: semgrep/semgrep:1.171.0@sha256:bdf7013b2c3634a487671158da77c554f531742326b543a9464d2adf6c433ac8 + + steps: + - name: Checkout Code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Run Semgrep Scan + run: >- + semgrep scan + --config p/security-audit + --config p/secrets + --config p/owasp-top-ten + BlinkCard/lib + sample_files + --sarif + --output=semgrep.sarif + + - name: Upload SARIF Results to GitHub Security Tab + uses: github/codeql-action/upload-sarif@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + if: always() + with: + sarif_file: semgrep.sarif + category: semgrep-dart From 23efbcd4600f200f92d57351ab4c2d4d5f15235d Mon Sep 17 00:00:00 2001 From: Horia Stere Date: Fri, 28 Aug 2026 15:00:04 +0300 Subject: [PATCH 2/2] [MSDKS-2201] trigger semgrep only on main branch --- .github/workflows/semgrep.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index 8ae3103..89f4e18 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - feature/MSDKS-2201-implement-semgrep pull_request: branches: [ "main" ] schedule: