From 8ac5f0ade6d5524be673a1c21c0ebfffb2f9c121 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 11:59:08 +1100 Subject: [PATCH 01/15] [#3317] Resolved docs server router paths with 'realpath()' and rejected any that resolve outside the build directory. --- .vortex/docs/.utils/serve-router.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.vortex/docs/.utils/serve-router.php b/.vortex/docs/.utils/serve-router.php index 288b1f5a8a..fccf82b9d3 100644 --- a/.vortex/docs/.utils/serve-router.php +++ b/.vortex/docs/.utils/serve-router.php @@ -15,27 +15,27 @@ declare(strict_types=1); -$doc_root = $_SERVER['DOCUMENT_ROOT']; +$doc_root = realpath($_SERVER['DOCUMENT_ROOT']); $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $path = is_string($path) ? rawurldecode($path) : '/'; -// Reject traversal outside the build directory before touching the filesystem. -if (str_contains($path, '..')) { +$target = realpath($doc_root . $path); + +// Reject a path that resolves outside the build directory. +if ($target !== FALSE && $target !== $doc_root && !str_starts_with($target, $doc_root . DIRECTORY_SEPARATOR)) { http_response_code(400); return TRUE; } -$target = $doc_root . $path; - // Serve an existing file as-is and let the server set the content type. -if (is_file($target)) { +if ($target !== FALSE && is_file($target)) { return FALSE; } -$index = rtrim($target, '/') . '/index.html'; +$index = $target === FALSE ? FALSE : realpath($target . '/index.html'); -if (is_file($index)) { +if ($index !== FALSE && is_file($index)) { header('Content-Type: text/html; charset=UTF-8'); readfile($index); From 8bdd68ecb92cf76761d7f3b9078242600f7f2042 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:01:01 +1100 Subject: [PATCH 02/15] [#3317] Added CodeQL and Semgrep code vulnerability scanning to the security audit workflow. --- .circleci/config.yml | 13 +++++--- .github/workflows/audit.yml | 65 +++++++++++++++++++++++++++++++++++++ renovate.json | 2 +- 3 files changed, 75 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4b43026f17..92ab432b84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,10 +219,7 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - #;< CI_GITLEAKS - *step_setup_remote_docker - #;> CI_GITLEAKS #;< VORTEX_DEV #; Vortex does not track 'composer.lock', so resolve dependencies to give @@ -261,9 +258,17 @@ jobs: npx --yes audit-ci@7.1.0 --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] #;> DRUPAL_THEME - #;< CI_GITLEAKS # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + + #;< CI_GITLEAKS - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 913cbf6d71..d6988de9c2 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -210,3 +210,68 @@ jobs: path: .logs/audit include-hidden-files: true if-no-files-found: ignore + + # The CodeQL action runs on the runner itself rather than in the CI runner + # container. + sast: + runs-on: ubuntu-latest + + permissions: + # The code scanning upload reads the workflow run in a private repository. + actions: read + contents: read + security-events: write + + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Create the directory for the scan reports + run: mkdir -p .logs/audit + + # CodeQL on a private repository requires a GitHub Code Security license. + - name: Initialize CodeQL + if: ${{ vars.VORTEX_CI_CODEQL_SKIP != '1' }} + uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 + with: + languages: actions,javascript-typescript + build-mode: none + #;< VORTEX_DEV + config: | + paths-ignore: + - .vortex/installer/tests/Fixtures + #;> VORTEX_DEV + + - name: Scan code for vulnerabilities with CodeQL + if: ${{ !cancelled() && vars.VORTEX_CI_CODEQL_SKIP != '1' }} + uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 + # CodeQL reports its findings only to code scanning, and the upload fails + # without a code scanning entitlement and on fork pull requests. + continue-on-error: true + with: + output: .logs/audit/codeql + + # CodeQL has no PHP analyzer. + - name: Scan PHP code for vulnerabilities with Semgrep + if: ${{ !cancelled() }} + run: docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif + continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} + + - name: Upload Semgrep findings to code scanning + if: ${{ !cancelled() && hashFiles('.logs/audit/semgrep.sarif') != '' }} + uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 + continue-on-error: true + with: + sarif_file: .logs/audit/semgrep.sarif + category: semgrep + + - name: Upload code scanning findings as an artifact + if: ${{ !cancelled() }} + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + with: + name: sast-findings + path: .logs/audit + include-hidden-files: true + if-no-files-found: ignore diff --git a/renovate.json b/renovate.json index c758ec2731..3ffef2dc7e 100644 --- a/renovate.json +++ b/renovate.json @@ -285,7 +285,7 @@ "/^\\.github/workflows/.+\\.yml$/" ], "matchStrings": [ - "docker run[^\\n]*?\\s(?[a-z0-9][a-z0-9._\\-]*(?:/[a-z0-9._\\-]+)+):(?v?[0-9][\\w.\\-]*)" + "docker (?:run|create)[^\\n]*?\\s(?[a-z0-9][a-z0-9._\\-]*(?:/[a-z0-9._\\-]+)+):(?v?[0-9][\\w.\\-]*)" ], "datasourceTemplate": "docker", "versioningTemplate": "docker" From 56e94d7b047ff4e95b2e256eb531a1c4bcf2251b Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:05:54 +1100 Subject: [PATCH 03/15] [#3317] Documented CodeQL and Semgrep code vulnerability scanning. --- .../.utils/variables/extra/ci.variables.sh | 6 + .../config/vocabularies/Vortex/accept.txt | 2 + .../content/continuous-integration/README.mdx | 43 ++++--- .../development/dependency-updates.mdx | 7 +- .../content/development/security/README.mdx | 15 ++- .../development/security/code-scanning.mdx | 105 ++++++++++++++++++ .../docs/content/development/variables.mdx | 2 + .vortex/docs/content/features.mdx | 2 + .vortex/docs/cspell.json | 5 + 9 files changed, 165 insertions(+), 22 deletions(-) create mode 100644 .vortex/docs/content/development/security/code-scanning.mdx diff --git a/.vortex/docs/.utils/variables/extra/ci.variables.sh b/.vortex/docs/.utils/variables/extra/ci.variables.sh index 1ef8a3fdd4..92777ed8ec 100755 --- a/.vortex/docs/.utils/variables/extra/ci.variables.sh +++ b/.vortex/docs/.utils/variables/extra/ci.variables.sh @@ -45,6 +45,12 @@ VORTEX_CI_COMPOSER_AUDIT_IGNORE_FAILURE=0 # Ignore `npm audit` failures. VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE=0 +# Ignore Semgrep failures. +VORTEX_CI_SEMGREP_IGNORE_FAILURE=0 + +# Skip the CodeQL scan. +VORTEX_CI_CODEQL_SKIP=0 + # Ignore PHPCS failures. VORTEX_CI_PHPCS_IGNORE_FAILURE=0 diff --git a/.vortex/docs/.vale/config/vocabularies/Vortex/accept.txt b/.vortex/docs/.vale/config/vocabularies/Vortex/accept.txt index b277af614c..c65b7b99c5 100644 --- a/.vortex/docs/.vale/config/vocabularies/Vortex/accept.txt +++ b/.vortex/docs/.vale/config/vocabularies/Vortex/accept.txt @@ -4,6 +4,7 @@ Behat CircleCI ClamAV Codecov +CodeQL CodeRabbit Composer DCLint @@ -30,6 +31,7 @@ Prompty Pygmy Rector Renovate +Semgrep Solr Storybook Stylelint diff --git a/.vortex/docs/content/continuous-integration/README.mdx b/.vortex/docs/content/continuous-integration/README.mdx index 20ded51063..6f5fda1862 100644 --- a/.vortex/docs/content/continuous-integration/README.mdx +++ b/.vortex/docs/content/continuous-integration/README.mdx @@ -138,8 +138,8 @@ provider defines the workflow in its own file: | GitHub Actions | The `Security audit` workflow in `.github/workflows/audit.yml` | | CircleCI | The `audit` workflow in `.circleci/config.yml` | -The workflow runs the same 4 checks on both providers. The checks read only -the codebase and its lock files, so the audit never waits for a build: +The workflow runs the following checks. They read only the codebase and its +lock files, so the audit never waits for a build: - `composer audit --locked` checks the packages pinned in `composer.lock` against published security advisories. @@ -152,10 +152,18 @@ the codebase and its lock files, so the audit never waits for a build: `package-lock.json`, with the theme's own `package-audit.jsonc`. - [Gitleaks](../development/security/secret-scanning.mdx) scans the codebase for committed secrets. - -Only the Composer check is always present. The root npm check ships when -your project keeps ESLint, Stylelint or Jest. The theme check ships with a -custom theme. The Gitleaks check ships when you turn on secret scanning at +- [Semgrep](../development/security/code-scanning.mdx) scans the PHP code + for vulnerabilities. +- [CodeQL](../development/security/code-scanning.mdx) scans the GitHub + Actions workflows and the JavaScript code for vulnerabilities. It runs on + GitHub Actions only. + +On GitHub Actions, Semgrep and CodeQL run in a separate `sast` job of the +same workflow. + +The Composer, Semgrep and CodeQL checks are always present. The root npm +check ships when your project keeps ESLint, Stylelint or Jest. The theme +check ships with a custom theme. The Gitleaks check ships when you turn on secret scanning at install time. Every check runs even if an earlier check failed, so a single run reports @@ -189,12 +197,15 @@ repository's **Security > Code scanning** tab, each under its own category: | `npm-audit` | `npm audit` advisories for the root `package-lock.json` | | `npm-audit-theme` | `npm audit` advisories for the custom theme's `package-lock.json` | | `gitleaks` | Committed secrets | +| `semgrep` | Semgrep vulnerabilities in the PHP code | +| `/language:actions` | CodeQL vulnerabilities in the GitHub Actions workflows | +| `/language:javascript-typescript` | CodeQL vulnerabilities in the JavaScript and TypeScript code | Code scanning keeps a history of every finding and tracks whether it's open or fixed. When you dismiss a false positive, the alert stores the reason, so the repository needs no ignore entry for it. -Gitleaks writes SARIF itself. `composer audit` and `npm audit` have no +Gitleaks, Semgrep and CodeQL write SARIF themselves. `composer audit` and `npm audit` have no SARIF formatter, so each of those checks runs once in JSON format. It pipes its output through `tee`, which feeds the job log and a report file in `.logs/audit/` from the same run. The npm checks pass @@ -222,17 +233,20 @@ it, and private repositories need a GitHub Code Security license. Without code scanning, and on pull requests from forks where the workflow token is read-only, the upload step fails and the workflow carries on. The checks still report their findings in the job log and still fail the -workflow. Every report is also attached to the run as the -`security-findings` artifact. +workflow. CodeQL is the exception: its findings appear only in code +scanning and in the reports. Every report is also attached to the run as +the `security-findings` or `sast-findings` artifact. -CircleCI has no code scanning destination. On CircleCI, the same checks run -and fail the `audit` workflow, and their findings appear only in the job -log. +CircleCI has no code scanning destination. On CircleCI, every check except +CodeQL runs and fails the `audit` workflow, and the findings appear only in +the job log. ➡️ See [Dependency audit > Dismissing a -finding](../development/security/dependency-audit.mdx#dismiss-a-finding) -and [Secret scanning > Dismissing a +finding](../development/security/dependency-audit.mdx#dismiss-a-finding), +[Secret scanning > Dismissing a finding](../development/security/secret-scanning.mdx#dismiss-a-finding) +and [Code vulnerability scanning > Dismissing a +finding](../development/security/code-scanning.mdx#dismiss-a-finding) for what dismissing a finding does and doesn't change. ## Working tree check @@ -847,6 +861,7 @@ The following table lists the variable for each tool: | [PHPStan](../development/code-quality/phpstan.mdx) | Analyze PHP code statically | `VORTEX_CI_PHPSTAN_IGNORE_FAILURE` | | [PHPUnit](../development/testing/phpunit.mdx) | Run unit, kernel and functional tests | `VORTEX_CI_PHPUNIT_IGNORE_FAILURE` | | [Rector](../development/code-quality/rector.mdx) | Check for automated refactoring rules | `VORTEX_CI_RECTOR_IGNORE_FAILURE` | +| [Semgrep](../development/security/code-scanning.mdx) | Scan PHP code for vulnerabilities | `VORTEX_CI_SEMGREP_IGNORE_FAILURE` | | [SDC Devel](../development/code-quality/sdc-devel.mdx) | Validate Single Directory Components | `VORTEX_CI_SDC_DEVEL_IGNORE_FAILURE` | | [Twig CS Fixer](../development/code-quality/twig-cs-fixer.mdx) | Lint Twig templates | `VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE` | | [Working tree check](#working-tree-check) | Check for files left behind by the build | `VORTEX_CI_WORKTREE_CHANGES_IGNORE_FAILURE` | diff --git a/.vortex/docs/content/development/dependency-updates.mdx b/.vortex/docs/content/development/dependency-updates.mdx index e77aff2c34..20851cb684 100644 --- a/.vortex/docs/content/development/dependency-updates.mdx +++ b/.vortex/docs/content/development/dependency-updates.mdx @@ -36,7 +36,7 @@ of each: | **Drupal core** | `drupal/core-recommended`, `drupal/core-composer-scaffold`, `drupal/core-project-message` and `drupal/core-dev` | Minor, patch | Daily before 2 AM UTC | None | | **Drupal contrib and PHP packages (non-core)** | All Drupal contrib modules and non-Drupal Packagist packages | Minor, patch | Weekly, Sunday before 2 AM UTC | 14 days for Packagist packages | | **JS packages** | All npm packages (root `package.json` only) | Minor, patch | Weekly, Sunday before 2 AM UTC | 14 days | -| **Container images** | Images in `.docker/` and `docker-compose.yml`, and the images CI starts with `docker run` | Major, minor, patch | Daily before 3 AM UTC | 14 days for Docker Hub images | +| **Container images** | Images in `.docker/` and `docker-compose.yml`, and the images CI starts with `docker run` or `docker create` | Major, minor, patch | Daily before 3 AM UTC | 14 days for Docker Hub images | | **CI tools** | npm packages that CI runs at a pinned version through `npx` | Major, minor, patch | Daily before 3 AM UTC | 14 days | | **Renovate version** | The `renovate/renovate` image in `.circleci/update-dependencies.yml`, and the `renovate-version` and `validator_version` inputs in `.github/workflows/` | Major, minor, patch | Weekly, Sunday before 3 AM UTC | 14 days | | **GitHub Actions** | All actions, and the container images that the jobs in `.github/workflows/` run in, all pinned to digests | Major, minor, patch | Daily before 3 AM UTC | 14 days | @@ -440,8 +440,9 @@ Renovate reads only the files that the managers in `enabledManagers` cover: - `docker-compose` for `docker-compose.yml` - `github-actions` for the workflows in `.github/workflows/` - `custom.regex` for 5 custom managers: the `IMAGE` build argument in - `docker-compose.yml`, the `docker run` and `npx --yes` lines in - `.circleci/config.yml` and `.github/workflows/`, the `renovate/renovate` + `docker-compose.yml`, the `docker run`, `docker create` and `npx --yes` + lines in `.circleci/config.yml` and `.github/workflows/`, the + `renovate/renovate` image in `.circleci/update-dependencies.yml`, and the `renovate-version` and `validator_version` inputs in `.github/workflows/` diff --git a/.vortex/docs/content/development/security/README.mdx b/.vortex/docs/content/development/security/README.mdx index 60dd58d04f..ef5933b5fc 100644 --- a/.vortex/docs/content/development/security/README.mdx +++ b/.vortex/docs/content/development/security/README.mdx @@ -6,13 +6,16 @@ sidebar_position: 1 # Security This overview is for developers and leads on a project built from -**Vortex**. It shows which check or setting covers each of 3 common risks, +**Vortex**. It shows which check or setting covers each of 4 common risks, and where it runs: - [Secret scanning](secret-scanning.mdx) catches an API token committed to Git. - The [dependency audit](dependency-audit.mdx) reports a dependency with a published vulnerability. +- [Code vulnerability scanning](code-scanning.mdx) reports a vulnerability + in the code your team writes, such as a file path built from request + input. - Shield puts a password prompt in front of a development site on a public URL. The following section describes it. @@ -52,7 +55,8 @@ on Lagoon. On Acquia, the platform's own PHP settings apply. ## Continuous integration -Secret scanning and the dependency audit run in the [security audit +Secret scanning, the dependency audit and code vulnerability scanning run in +the [security audit workflow](../../continuous-integration/README.mdx#security-audit), separate from the build pipeline. A failing audit therefore shows up separately from a failing linter, and you can re-run the audit on its own. @@ -61,11 +65,12 @@ The `deploy` job doesn't depend on the audit, so a failing audit doesn't stop a deployment. To block merges on the audit, add its check to the repository's branch protection rules as a required status check. -In GitHub Actions, both checks also upload their findings to the +In GitHub Actions, every check also uploads its findings to the repository's **Security > Code scanning** tab, which keeps an inventory of the open findings. The GitHub Actions workflow also attaches every report -to the run as the `security-findings` artifact. CircleCI has no code -scanning destination, so its findings stay in the job log. +to the run as the `security-findings` and `sast-findings` artifacts. +CircleCI has no code scanning destination, so its findings stay in the job +log. ➡️ See [Code scanning](../../continuous-integration/README.mdx#code-scanning). diff --git a/.vortex/docs/content/development/security/code-scanning.mdx b/.vortex/docs/content/development/security/code-scanning.mdx new file mode 100644 index 0000000000..ace43d0e7e --- /dev/null +++ b/.vortex/docs/content/development/security/code-scanning.mdx @@ -0,0 +1,105 @@ +--- +sidebar_label: Code vulnerability scanning +sidebar_position: 4 +--- + +# Code vulnerability scanning + +Code your team writes can carry a vulnerability that no linter flags, such +as a file path built from request input. This page is for developers and +leads on a project built from **Vortex**. It shows what the vulnerability +scanners check, how to run Semgrep locally, how to ignore a false positive +and where the findings appear in continuous integration (CI). + +2 static analysis tools read the code without running it: + +| Tool | Code it scans | Providers | +|------|---------------|-----------| +| [CodeQL](https://codeql.github.com/) | GitHub Actions workflows, JavaScript and TypeScript | GitHub Actions | +| [Semgrep](https://semgrep.dev/) | PHP, with the [`p/php`](https://semgrep.dev/p/php) rule set | GitHub Actions and CircleCI | + +CodeQL has no PHP analyzer, so Semgrep covers the PHP code. + +## Usage + +**Vortex** doesn't install Semgrep locally. Run it from its Docker image in +the project root, with the same version and flags as CI: + +```shell +docker run --rm -v "${PWD}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error +``` + +Semgrep scans only the files tracked by Git. It skips test directories, +dependency directories and the other paths in its [default ignore +list](https://semgrep.dev/docs/ignoring-files-folders-code#understand-semgrep-defaults). +`--error` makes the command exit with `1` when it finds a vulnerability. On +a clean codebase, the scan ends with `0 findings`. + +CodeQL runs only in GitHub Actions. + +## Ignore findings + +To ignore a Semgrep finding on a line you've assessed, add a `nosemgrep` +comment with the rule ID from the finding to that line: + +```php +phpinfo(); // nosemgrep: php.lang.security.phpinfo-use.phpinfo-use +``` + +To skip a path, list it in a `.semgrepignore` file at the project root. +That file replaces Semgrep's default ignore list, so also add the default +paths you still want skipped, such as `tests/`. + +CodeQL findings have no in-code exception. Dismiss them in code scanning, +as described in [Dismiss a finding](#dismiss-a-finding). + +## Continuous integration + +The scanners run in the [security audit +workflow](../../continuous-integration/README.mdx#security-audit). In +GitHub Actions, they run in the workflow's `sast` job, next to the `audit` +job. In CircleCI, Semgrep runs in the `audit` job. + +A Semgrep finding fails the workflow. CodeQL reports its findings to code +scanning only, so a CodeQL finding leaves the workflow passing. + +### Ignore failures + +Set `VORTEX_CI_SEMGREP_IGNORE_FAILURE` to `1` to let the workflow pass +despite Semgrep findings. In GitHub Actions, set it as a repository +variable. In CircleCI, set it as an environment variable. Semgrep still +runs and prints every finding in the job log. + +➡️ See [Ignore tool +failures](../../continuous-integration/README.mdx#ignore-tool-failures). + +### Skip CodeQL + +CodeQL on a private repository requires a GitHub Code Security license. To +turn CodeQL off, set the `VORTEX_CI_CODEQL_SKIP` repository variable to `1`. +Semgrep keeps running. + +### Where findings appear + +In GitHub Actions, the findings reach the repository's +**Security > Code scanning** tab: + +- CodeQL uploads its findings under 1 category per language, + `/language:actions` and `/language:javascript-typescript`. +- Semgrep findings go under the `semgrep` category. + +The `sast` job also attaches every report to the run as the `sast-findings` +artifact. In CircleCI, the findings appear only in the job log. + +➡️ See [Code +scanning](../../continuous-integration/README.mdx#code-scanning). + +### Dismiss a finding + +Dismissing an alert in the **Security > Code scanning** tab records a reason +against that finding and removes it from the open list. For a CodeQL +finding, dismissing is the way to record a false positive. + +A dismissed Semgrep alert still fails the workflow. To stop the failure, +add a `nosemgrep` comment as described in +[Ignore findings](#ignore-findings). diff --git a/.vortex/docs/content/development/variables.mdx b/.vortex/docs/content/development/variables.mdx index be78299b73..c224e96eee 100644 --- a/.vortex/docs/content/development/variables.mdx +++ b/.vortex/docs/content/development/variables.mdx @@ -227,6 +227,7 @@ The list below is automatically generated with [Shellvar](https://github.com/ale | `VORTEX_CI_ARTIFACTS` | Directory to store test artifacts in CI. | `/tmp/artifacts` | `CI config` | | `VORTEX_CI_BEHAT_IGNORE_FAILURE` | Ignore Behat test failures. | `UNDEFINED` | `CI config` | | `VORTEX_CI_BEHAT_PROFILE` | Test Behat profile to use in CI. If not set, the `default` profile will be used. | `UNDEFINED` | `CI config` | +| `VORTEX_CI_CODEQL_SKIP` | Skip the CodeQL scan. | `UNDEFINED` | `CI config` | | `VORTEX_CI_CODE_COVERAGE_PR_COMMENT_SKIP` | Skip posting code coverage report as a PR comment. | `UNDEFINED` | `CI config` | | `VORTEX_CI_CODE_COVERAGE_THRESHOLD` | Code coverage threshold percentage. Build fails if coverage is below this value. | `90` | `CI config` | | `VORTEX_CI_COMPOSER_AUDIT_IGNORE_FAILURE` | Ignore `composer audit` failures. | `UNDEFINED` | `CI config` | @@ -245,6 +246,7 @@ The list below is automatically generated with [Shellvar](https://github.com/ale | `VORTEX_CI_PHPSTAN_IGNORE_FAILURE` | Ignore PHPStan failures. | `UNDEFINED` | `CI config` | | `VORTEX_CI_PHPUNIT_IGNORE_FAILURE` | Ignore PHPUnit test failures. | `UNDEFINED` | `CI config` | | `VORTEX_CI_RECTOR_IGNORE_FAILURE` | Ignore Rector failures. | `UNDEFINED` | `CI config` | +| `VORTEX_CI_SEMGREP_IGNORE_FAILURE` | Ignore Semgrep failures. | `UNDEFINED` | `CI config` | | `VORTEX_CI_TEST_RESULTS` | Directory to store test results in CI. | `/tmp/tests` | `CI config` | | `VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE` | Ignore Twig CS Fixer failures. | `UNDEFINED` | `CI config` | | `VORTEX_CI_WORKTREE_CHANGES_IGNORE_FAILURE` | Ignore working tree check failures. | `UNDEFINED` | `CI config` | diff --git a/.vortex/docs/content/features.mdx b/.vortex/docs/content/features.mdx index 70df8ab568..f1c2a0e499 100644 --- a/.vortex/docs/content/features.mdx +++ b/.vortex/docs/content/features.mdx @@ -188,6 +188,8 @@ import { - Dependency audit with [`composer audit`](https://getcomposer.org/doc/03-cli.md#audit) and [`npm audit`](https://docs.npmjs.com/cli/commands/npm-audit) + - Code vulnerability scanning with [CodeQL](https://codeql.github.com/) + and [Semgrep](https://semgrep.dev/) - Findings uploaded to [GitHub code scanning](https://docs.github.com/en/code-security/code-scanning) diff --git a/.vortex/docs/cspell.json b/.vortex/docs/cspell.json index 6b66040eb6..0b3ab87c98 100644 --- a/.vortex/docs/cspell.json +++ b/.vortex/docs/cspell.json @@ -35,6 +35,7 @@ "checkstyle", "clamav", "cobertura", + "codeql", "coderabbit", "commandfiles", "containerisation", @@ -77,6 +78,7 @@ "minimised", "minimumReleaseAgeBehaviour", "multisite", + "nosemgrep", "novnc", "oomphinc", "palantirnet", @@ -99,8 +101,11 @@ "runsheet", "runsheets", "sarif", + "sast", "sdc", "seckit", + "semgrep", + "semgrepignore", "shellvar", "shortlink", "simpletest", From 3faeb36ebb4a48425c83e8b46cca0cc683582586 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:06:11 +1100 Subject: [PATCH 04/15] [#3317] Listed the Semgrep image among the CI tool images in the release skill. --- .vortex/skills/prepare-vortex-release/SKILL.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.vortex/skills/prepare-vortex-release/SKILL.md b/.vortex/skills/prepare-vortex-release/SKILL.md index 27a9d23ab0..e1f83ab10c 100644 --- a/.vortex/skills/prepare-vortex-release/SKILL.md +++ b/.vortex/skills/prepare-vortex-release/SKILL.md @@ -67,9 +67,10 @@ Work through each checklist item from the release process doc: unchecked. 2. **Container images** - Check current versions in CI configs, verify if latest. - - **CI tool images** - `hadolint`, `dclint`, `gitleaks` and `actionlint` - are invoked as `docker run :` inside `.github/workflows/**` - and `.circleci/config.yml`. The `customManagers` regex in + - **CI tool images** - `hadolint`, `dclint`, `gitleaks`, `semgrep` and + `actionlint` are invoked as `docker run :` or + `docker create :` inside `.github/workflows/**` and + `.circleci/config.yml`. The `customManagers` regex in `renovate.json` tracks them, so this is a verification step, not a manual bump: confirm no open Renovate PR is bumping them and that both CI providers carry the same tag for the same tool. Bump by hand only From 4bb5ba7600255192007d6d3561dea27b42c4512e Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:06:23 +1100 Subject: [PATCH 05/15] Updated snapshots. --- .../_baseline/.github/workflows/audit.yml | 60 +++++++++++++++++++ .../handler_process/_baseline/renovate.json | 2 +- .../ciprovider_circleci/.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../code_provider_other/.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../timezone_circleci/.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- .../.circleci/config.yml | 9 ++- 28 files changed, 269 insertions(+), 27 deletions(-) diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml index 5cf0fac15e..4f3eda9672 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml @@ -181,3 +181,63 @@ jobs: path: .logs/audit include-hidden-files: true if-no-files-found: ignore + + # The CodeQL action runs on the runner itself rather than in the CI runner + # container. + sast: + runs-on: ubuntu-latest + + permissions: + # The code scanning upload reads the workflow run in a private repository. + actions: read + contents: read + security-events: write + + steps: + - name: Checkout code + uses: actions/checkout@__HASH__ # __VERSION__ + with: + persist-credentials: false + + - name: Create the directory for the scan reports + run: mkdir -p .logs/audit + + # CodeQL on a private repository requires a GitHub Code Security license. + - name: Initialize CodeQL + if: ${{ vars.VORTEX_CI_CODEQL_SKIP != '1' }} + uses: github/codeql-action/init@__HASH__ # __VERSION__ + with: + languages: actions,javascript-typescript + build-mode: none + + - name: Scan code for vulnerabilities with CodeQL + if: ${{ !cancelled() && vars.VORTEX_CI_CODEQL_SKIP != '1' }} + uses: github/codeql-action/analyze@__HASH__ # __VERSION__ + # CodeQL reports its findings only to code scanning, and the upload fails + # without a code scanning entitlement and on fork pull requests. + continue-on-error: true + with: + output: .logs/audit/codeql + + # CodeQL has no PHP analyzer. + - name: Scan PHP code for vulnerabilities with Semgrep + if: ${{ !cancelled() }} + run: docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif + continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} + + - name: Upload Semgrep findings to code scanning + if: ${{ !cancelled() && hashFiles('.logs/audit/semgrep.sarif') != '' }} + uses: github/codeql-action/upload-sarif@__HASH__ # __VERSION__ + continue-on-error: true + with: + sarif_file: .logs/audit/semgrep.sarif + category: semgrep + + - name: Upload code scanning findings as an artifact + if: ${{ !cancelled() }} + uses: actions/upload-artifact@__HASH__ # __VERSION__ + with: + name: sast-findings + path: .logs/audit + include-hidden-files: true + if-no-files-found: ignore diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/renovate.json b/.vortex/installer/tests/Fixtures/handler_process/_baseline/renovate.json index 344886a033..6ba6b34b62 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/renovate.json +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/renovate.json @@ -282,7 +282,7 @@ "/^\\.github/workflows/.+\\.yml$/" ], "matchStrings": [ - "docker run[^\\n]*?\\s(?[a-z0-9][a-z0-9._\\-]*(?:/[a-z0-9._\\-]+)+):(?v?[0-9][\\w.\\-]*)" + "docker (?:run|create)[^\\n]*?\\s(?[a-z0-9][a-z0-9._\\-]*(?:/[a-z0-9._\\-]+)+):(?v?[0-9][\\w.\\-]*)" ], "datasourceTemplate": "docker", "versioningTemplate": "docker" diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml index 095f6fc249..f8e29db025 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml index 70ccf44837..0668e75908 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml index 57684e83a9..d6a90f87e7 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml index 69a8a20830..4cd8de0dff 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml index 962162638f..86c1714d76 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml @@ -176,7 +176,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -205,6 +204,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml index 0b83288c75..6e4a8ca97f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml @@ -184,7 +184,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -213,6 +212,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml index 0d5dd2cae9..d30dd740d8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml @@ -177,7 +177,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -196,6 +195,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml index 87d8397465..4d8d7571c3 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml @@ -177,7 +177,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -187,6 +186,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml index 194ac3218b..6b37b65797 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml @@ -184,7 +184,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -213,6 +212,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml index 3cf240711d..2e716bc928 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml @@ -179,7 +179,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -208,6 +207,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml index 64bcd3e9ab..3198e253f8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml @@ -172,7 +172,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -201,6 +200,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml index 37281e8ff5..22703aa03d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml @@ -181,7 +181,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -210,6 +209,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml index 52fdedfed1..a90e7b30ab 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml index f2aacd0e81..c010c1d194 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml @@ -184,7 +184,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -213,6 +212,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml index bf65b2a0ba..32620e1473 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml @@ -184,7 +184,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -213,6 +212,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml index affec2423a..d96756eb51 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml index 65af74315e..fa2a131900 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml @@ -184,7 +184,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -213,6 +212,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml index f56bdf626c..564f33a098 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml @@ -188,7 +188,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -217,6 +216,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml index 5001ef54a4..81c78c01b6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml @@ -184,7 +184,6 @@ jobs: steps: - checkout - *load_variables_from_dotenv - - *step_setup_remote_docker - run: @@ -213,6 +212,14 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. + - run: + name: Scan PHP code for vulnerabilities with Semgrep + when: always + command: | + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + docker cp ./. "${container}:/src" + docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] + - run: name: Scan for committed secrets with Gitleaks when: always From f5dc0b8ff7f23ef86b7b20372312dd6be033c5f8 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:15:40 +1100 Subject: [PATCH 06/15] [#3317] Passed Drupal PHP files with '.module', '.install', '.theme', '.inc', '.profile' and '.engine' extensions to Semgrep explicitly. --- .circleci/config.yml | 7 +++++-- .github/workflows/audit.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92ab432b84..1611ac3ee4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -259,12 +259,15 @@ jobs: #;> DRUPAL_THEME # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index d6988de9c2..30b594d58b 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -253,10 +253,13 @@ jobs: with: output: .logs/audit/codeql - # CodeQL has no PHP analyzer. + # CodeQL has no PHP analyzer. Semgrep detects PHP by the '.php' extension + # only, so Drupal PHP files with other extensions are passed explicitly. - name: Scan PHP code for vulnerabilities with Semgrep if: ${{ !cancelled() }} - run: docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif + run: | + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} - name: Upload Semgrep findings to code scanning From 904e9ed67d66e979b87742dd03fcf5835597e1bb Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:15:41 +1100 Subject: [PATCH 07/15] [#3317] Documented the Semgrep scan scope and the Drupal file extensions passed to it. --- .../content/development/security/code-scanning.mdx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.vortex/docs/content/development/security/code-scanning.mdx b/.vortex/docs/content/development/security/code-scanning.mdx index ace43d0e7e..d2188832a6 100644 --- a/.vortex/docs/content/development/security/code-scanning.mdx +++ b/.vortex/docs/content/development/security/code-scanning.mdx @@ -26,12 +26,17 @@ CodeQL has no PHP analyzer, so Semgrep covers the PHP code. the project root, with the same version and flags as CI: ```shell -docker run --rm -v "${PWD}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error +docker run --rm -v "${PWD}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . $(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') ``` -Semgrep scans only the files tracked by Git. It skips test directories, -dependency directories and the other paths in its [default ignore +Semgrep scans the files tracked by Git and the untracked files that +`.gitignore` doesn't exclude. It skips test directories, dependency +directories and the other paths in its [default ignore list](https://semgrep.dev/docs/ignoring-files-folders-code#understand-semgrep-defaults). + +Semgrep detects PHP by the `.php` extension only. The `git ls-files` list +passes the Drupal PHP files with other extensions, such as `.module` and +`.theme`, and `--scan-unknown-extensions` makes Semgrep scan them as PHP. `--error` makes the command exit with `1` when it finds a vulnerability. On a clean codebase, the scan ends with `0 findings`. From 11ff0f9b303c90a9cae5e0c63820bc6f164ffe4e Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:15:52 +1100 Subject: [PATCH 08/15] Updated snapshots. --- .../handler_process/_baseline/.github/workflows/audit.yml | 7 +++++-- .../ciprovider_circleci/.circleci/config.yml | 7 +++++-- .../.circleci/config.yml | 7 +++++-- .../code_provider_other/.circleci/config.yml | 7 +++++-- .../deploy_types_all_circleci/.circleci/config.yml | 7 +++++-- .../deploy_types_none_circleci/.circleci/config.yml | 7 +++++-- .../deps_updates_provider_ci_circleci/.circleci/config.yml | 7 +++++-- .../lighthouse_enabled_circleci/.circleci/config.yml | 7 +++++-- .../migration_disabled_circleci/.circleci/config.yml | 7 +++++-- .../migration_enabled_circleci/.circleci/config.yml | 7 +++++-- .../handler_process/timezone_circleci/.circleci/config.yml | 7 +++++-- .../tools_groups_no_be_lint_circleci/.circleci/config.yml | 7 +++++-- .../tools_groups_no_be_tests_circleci/.circleci/config.yml | 7 +++++-- .../tools_groups_no_fe_lint_circleci/.circleci/config.yml | 7 +++++-- .../.circleci/config.yml | 7 +++++-- .../tools_no_behat_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_dclint_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_docker_linters_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_eslint_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_hadolint_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_jest_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_phpcs_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_phpstan_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_phpunit_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_rector_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_stylelint_circleci/.circleci/config.yml | 7 +++++-- .../tools_no_twig_circleci/.circleci/config.yml | 7 +++++-- 27 files changed, 135 insertions(+), 54 deletions(-) diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml index 4f3eda9672..17bfac09f1 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml @@ -219,10 +219,13 @@ jobs: with: output: .logs/audit/codeql - # CodeQL has no PHP analyzer. + # CodeQL has no PHP analyzer. Semgrep detects PHP by the '.php' extension + # only, so Drupal PHP files with other extensions are passed explicitly. - name: Scan PHP code for vulnerabilities with Semgrep if: ${{ !cancelled() }} - run: docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif + run: | + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} - name: Upload Semgrep findings to code scanning diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml index f8e29db025..a5e4bc9d83 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml index 0668e75908..0531f3b780 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml index d6a90f87e7..d3e5fba077 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml index 4cd8de0dff..4d98d0e3e7 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml index 86c1714d76..7231a2e84e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml @@ -203,12 +203,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml index 6e4a8ca97f..64329c4884 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml @@ -211,12 +211,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml index d30dd740d8..12b84d8d6a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml @@ -194,12 +194,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml index 4d8d7571c3..d27e93bd63 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml @@ -185,12 +185,15 @@ jobs: command: composer audit --locked || [ "${VORTEX_CI_COMPOSER_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml index 6b37b65797..a43921347d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml @@ -211,12 +211,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml index 2e716bc928..356ac1cb88 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml @@ -206,12 +206,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml index 3198e253f8..282d60cf42 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml @@ -199,12 +199,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml index 22703aa03d..87d54a3db5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml @@ -208,12 +208,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml index a90e7b30ab..d08fe4c49f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml index c010c1d194..471ede392a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml @@ -211,12 +211,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml index 32620e1473..1bc2590c43 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml @@ -211,12 +211,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml index d96756eb51..029635b166 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml index fa2a131900..f0f8a8d116 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml @@ -211,12 +211,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml index 564f33a098..1e2f36cd57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml @@ -215,12 +215,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml index 81c78c01b6..54e272aeed 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml @@ -211,12 +211,15 @@ jobs: npx --yes audit-ci@__VERSION__ --high --extra-args=--package-lock-only --directory "${dir}" "${config[@]}" || [ "${VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE:-0}" -eq 1 ] # The remote Docker engine has no access to the checkout, so the files - # are copied into the container. + # are copied into the container. Semgrep detects PHP by the '.php' + # extension only, so Drupal PHP files with other extensions are passed + # explicitly. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error)" + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] From 9e184cd4698afec5203493a5c4a87a8ccdeb42c5 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:59:08 +1100 Subject: [PATCH 09/15] [#3317] Moved the Semgrep scan into the 'audit' job with '--volumes-from' and left CodeQL alone in a skippable 'codeql' job. --- .github/workflows/audit.yml | 57 ++++++++++++++----------------------- 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 30b594d58b..6f1c8e8933 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -187,6 +187,23 @@ jobs: category: npm-audit-theme #;> DRUPAL_THEME + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. + - name: Scan PHP code for vulnerabilities with Semgrep + if: ${{ !cancelled() }} + run: | + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + docker run --rm --volumes-from "${HOSTNAME}" -w "${PWD}" semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" + continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} + + - name: Upload Semgrep findings to code scanning + if: ${{ !cancelled() && hashFiles('.logs/audit/semgrep.sarif') != '' }} + uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 + continue-on-error: true + with: + sarif_file: .logs/audit/semgrep.sarif + category: semgrep + #;< CI_GITLEAKS - name: Scan for committed secrets with Gitleaks if: ${{ !cancelled() }} @@ -212,9 +229,11 @@ jobs: if-no-files-found: ignore # The CodeQL action runs on the runner itself rather than in the CI runner - # container. - sast: + # container. CodeQL on a private repository requires a GitHub Code Security + # license. + codeql: runs-on: ubuntu-latest + if: ${{ vars.VORTEX_CI_CODEQL_SKIP != '1' }} permissions: # The code scanning upload reads the workflow run in a private repository. @@ -228,12 +247,7 @@ jobs: with: persist-credentials: false - - name: Create the directory for the scan reports - run: mkdir -p .logs/audit - - # CodeQL on a private repository requires a GitHub Code Security license. - name: Initialize CodeQL - if: ${{ vars.VORTEX_CI_CODEQL_SKIP != '1' }} uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 with: languages: actions,javascript-typescript @@ -245,36 +259,7 @@ jobs: #;> VORTEX_DEV - name: Scan code for vulnerabilities with CodeQL - if: ${{ !cancelled() && vars.VORTEX_CI_CODEQL_SKIP != '1' }} uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 # CodeQL reports its findings only to code scanning, and the upload fails # without a code scanning entitlement and on fork pull requests. continue-on-error: true - with: - output: .logs/audit/codeql - - # CodeQL has no PHP analyzer. Semgrep detects PHP by the '.php' extension - # only, so Drupal PHP files with other extensions are passed explicitly. - - name: Scan PHP code for vulnerabilities with Semgrep - if: ${{ !cancelled() }} - run: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') - docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" - continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} - - - name: Upload Semgrep findings to code scanning - if: ${{ !cancelled() && hashFiles('.logs/audit/semgrep.sarif') != '' }} - uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4 - continue-on-error: true - with: - sarif_file: .logs/audit/semgrep.sarif - category: semgrep - - - name: Upload code scanning findings as an artifact - if: ${{ !cancelled() }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 - with: - name: sast-findings - path: .logs/audit - include-hidden-files: true - if-no-files-found: ignore From e0e47df13ac535463b3d4e6f75cb1c10fd2d7482 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 12:59:10 +1100 Subject: [PATCH 10/15] [#3317] Documented Semgrep in the 'audit' job and CodeQL in the 'codeql' job. --- .vortex/docs/content/continuous-integration/README.mdx | 8 ++++---- .vortex/docs/content/development/security/README.mdx | 5 ++--- .../content/development/security/code-scanning.mdx | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.vortex/docs/content/continuous-integration/README.mdx b/.vortex/docs/content/continuous-integration/README.mdx index 6f5fda1862..8e03198b45 100644 --- a/.vortex/docs/content/continuous-integration/README.mdx +++ b/.vortex/docs/content/continuous-integration/README.mdx @@ -158,8 +158,8 @@ lock files, so the audit never waits for a build: Actions workflows and the JavaScript code for vulnerabilities. It runs on GitHub Actions only. -On GitHub Actions, Semgrep and CodeQL run in a separate `sast` job of the -same workflow. +On GitHub Actions, CodeQL runs in a separate `codeql` job of the same +workflow. The other checks run in the `audit` job. The Composer, Semgrep and CodeQL checks are always present. The root npm check ships when your project keeps ESLint, Stylelint or Jest. The theme @@ -234,8 +234,8 @@ Without code scanning, and on pull requests from forks where the workflow token is read-only, the upload step fails and the workflow carries on. The checks still report their findings in the job log and still fail the workflow. CodeQL is the exception: its findings appear only in code -scanning and in the reports. Every report is also attached to the run as -the `security-findings` or `sast-findings` artifact. +scanning. Every other report is also attached to the run as the +`security-findings` artifact. CircleCI has no code scanning destination. On CircleCI, every check except CodeQL runs and fails the `audit` workflow, and the findings appear only in diff --git a/.vortex/docs/content/development/security/README.mdx b/.vortex/docs/content/development/security/README.mdx index ef5933b5fc..53ad0d516d 100644 --- a/.vortex/docs/content/development/security/README.mdx +++ b/.vortex/docs/content/development/security/README.mdx @@ -68,9 +68,8 @@ repository's branch protection rules as a required status check. In GitHub Actions, every check also uploads its findings to the repository's **Security > Code scanning** tab, which keeps an inventory of the open findings. The GitHub Actions workflow also attaches every report -to the run as the `security-findings` and `sast-findings` artifacts. -CircleCI has no code scanning destination, so its findings stay in the job -log. +to the run as the `security-findings` artifact. CircleCI has no code +scanning destination, so its findings stay in the job log. ➡️ See [Code scanning](../../continuous-integration/README.mdx#code-scanning). diff --git a/.vortex/docs/content/development/security/code-scanning.mdx b/.vortex/docs/content/development/security/code-scanning.mdx index d2188832a6..cfa7261f9b 100644 --- a/.vortex/docs/content/development/security/code-scanning.mdx +++ b/.vortex/docs/content/development/security/code-scanning.mdx @@ -61,9 +61,9 @@ as described in [Dismiss a finding](#dismiss-a-finding). ## Continuous integration The scanners run in the [security audit -workflow](../../continuous-integration/README.mdx#security-audit). In -GitHub Actions, they run in the workflow's `sast` job, next to the `audit` -job. In CircleCI, Semgrep runs in the `audit` job. +workflow](../../continuous-integration/README.mdx#security-audit). Semgrep +runs in the workflow's `audit` job on both providers. In GitHub Actions, +CodeQL runs in its own `codeql` job. A Semgrep finding fails the workflow. CodeQL reports its findings to code scanning only, so a CodeQL finding leaves the workflow passing. @@ -82,7 +82,7 @@ failures](../../continuous-integration/README.mdx#ignore-tool-failures). CodeQL on a private repository requires a GitHub Code Security license. To turn CodeQL off, set the `VORTEX_CI_CODEQL_SKIP` repository variable to `1`. -Semgrep keeps running. +The `codeql` job then shows as skipped, and Semgrep keeps running. ### Where findings appear @@ -93,7 +93,7 @@ In GitHub Actions, the findings reach the repository's `/language:actions` and `/language:javascript-typescript`. - Semgrep findings go under the `semgrep` category. -The `sast` job also attaches every report to the run as the `sast-findings` +The Semgrep report is also attached to the run in the `security-findings` artifact. In CircleCI, the findings appear only in the job log. ➡️ See [Code From e3700075ab588658c49607e93ff2bc62fa1175d0 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 13:03:47 +1100 Subject: [PATCH 11/15] Updated snapshots. --- .../_baseline/.github/workflows/audit.yml | 57 +++++++------------ .../.github/workflows/audit.yml | 6 +- .../theme_claro/.github/workflows/audit.yml | 4 +- .../theme_olivero/.github/workflows/audit.yml | 4 +- .../theme_stark/.github/workflows/audit.yml | 4 +- .../.github/workflows/audit.yml | 4 +- .../.github/workflows/audit.yml | 4 +- .../.github/workflows/audit.yml | 4 +- 8 files changed, 36 insertions(+), 51 deletions(-) diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml index 17bfac09f1..69107b1861 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml @@ -160,6 +160,23 @@ jobs: sarif_file: .logs/audit/npm-audit-theme.sarif category: npm-audit-theme + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. + - name: Scan PHP code for vulnerabilities with Semgrep + if: ${{ !cancelled() }} + run: | + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + docker run --rm --volumes-from "${HOSTNAME}" -w "${PWD}" semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" + continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} + + - name: Upload Semgrep findings to code scanning + if: ${{ !cancelled() && hashFiles('.logs/audit/semgrep.sarif') != '' }} + uses: github/codeql-action/upload-sarif@__HASH__ # __VERSION__ + continue-on-error: true + with: + sarif_file: .logs/audit/semgrep.sarif + category: semgrep + - name: Scan for committed secrets with Gitleaks if: ${{ !cancelled() }} run: docker run --rm --volumes-from "${HOSTNAME}" -w "${PWD}" ghcr.io/gitleaks/gitleaks:__VERSION__ dir . --no-banner --report-format sarif --report-path .logs/audit/gitleaks.sarif @@ -183,9 +200,11 @@ jobs: if-no-files-found: ignore # The CodeQL action runs on the runner itself rather than in the CI runner - # container. - sast: + # container. CodeQL on a private repository requires a GitHub Code Security + # license. + codeql: runs-on: ubuntu-latest + if: ${{ vars.VORTEX_CI_CODEQL_SKIP != '1' }} permissions: # The code scanning upload reads the workflow run in a private repository. @@ -199,48 +218,14 @@ jobs: with: persist-credentials: false - - name: Create the directory for the scan reports - run: mkdir -p .logs/audit - - # CodeQL on a private repository requires a GitHub Code Security license. - name: Initialize CodeQL - if: ${{ vars.VORTEX_CI_CODEQL_SKIP != '1' }} uses: github/codeql-action/init@__HASH__ # __VERSION__ with: languages: actions,javascript-typescript build-mode: none - name: Scan code for vulnerabilities with CodeQL - if: ${{ !cancelled() && vars.VORTEX_CI_CODEQL_SKIP != '1' }} uses: github/codeql-action/analyze@__HASH__ # __VERSION__ # CodeQL reports its findings only to code scanning, and the upload fails # without a code scanning entitlement and on fork pull requests. continue-on-error: true - with: - output: .logs/audit/codeql - - # CodeQL has no PHP analyzer. Semgrep detects PHP by the '.php' extension - # only, so Drupal PHP files with other extensions are passed explicitly. - - name: Scan PHP code for vulnerabilities with Semgrep - if: ${{ !cancelled() }} - run: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') - docker run --rm -v "${GITHUB_WORKSPACE}:/src" -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" - continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} - - - name: Upload Semgrep findings to code scanning - if: ${{ !cancelled() && hashFiles('.logs/audit/semgrep.sarif') != '' }} - uses: github/codeql-action/upload-sarif@__HASH__ # __VERSION__ - continue-on-error: true - with: - sarif_file: .logs/audit/semgrep.sarif - category: semgrep - - - name: Upload code scanning findings as an artifact - if: ${{ !cancelled() }} - uses: actions/upload-artifact@__HASH__ # __VERSION__ - with: - name: sast-findings - path: .logs/audit - include-hidden-files: true - if-no-files-found: ignore diff --git a/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml index 4790adba94..dec57e2cd8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml @@ -1,6 +1,6 @@ -@@ -160,19 +160,6 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme +@@ -177,19 +177,6 @@ + sarif_file: .logs/audit/semgrep.sarif + category: semgrep - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml index 3f167425e3..acb075490a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml @@ -32,5 +32,5 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml index 3f167425e3..acb075490a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml @@ -32,5 +32,5 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml index 3f167425e3..acb075490a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml @@ -32,5 +32,5 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml index 0dc5262aec..c083a59cfc 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml @@ -55,5 +55,5 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml index 3f167425e3..acb075490a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml @@ -32,5 +32,5 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml index 3f167425e3..acb075490a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml @@ -32,5 +32,5 @@ - sarif_file: .logs/audit/npm-audit-theme.sarif - category: npm-audit-theme - - name: Scan for committed secrets with Gitleaks - if: ${{ !cancelled() }} + # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files + # with other extensions are passed explicitly. From 90583bb6b9a8c206c8307938f1948618610fbded Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 13:27:38 +1100 Subject: [PATCH 12/15] Re-triggered CI to clear a flaky check. From b3df9d4690fae33b2a6b42c61ff90e1d3c5ff230 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 13:30:36 +1100 Subject: [PATCH 13/15] [#3317] Wrapped 2 security audit lines in the CI docs at 76 characters. --- .vortex/docs/content/continuous-integration/README.mdx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.vortex/docs/content/continuous-integration/README.mdx b/.vortex/docs/content/continuous-integration/README.mdx index 8e03198b45..c41c3e3350 100644 --- a/.vortex/docs/content/continuous-integration/README.mdx +++ b/.vortex/docs/content/continuous-integration/README.mdx @@ -163,8 +163,8 @@ workflow. The other checks run in the `audit` job. The Composer, Semgrep and CodeQL checks are always present. The root npm check ships when your project keeps ESLint, Stylelint or Jest. The theme -check ships with a custom theme. The Gitleaks check ships when you turn on secret scanning at -install time. +check ships with a custom theme. The Gitleaks check ships when you turn on +secret scanning at install time. Every check runs even if an earlier check failed, so a single run reports all the findings. The workflow fails if any check failed, unless that @@ -205,8 +205,9 @@ Code scanning keeps a history of every finding and tracks whether it's open or fixed. When you dismiss a false positive, the alert stores the reason, so the repository needs no ignore entry for it. -Gitleaks, Semgrep and CodeQL write SARIF themselves. `composer audit` and `npm audit` have no -SARIF formatter, so each of those checks runs once in JSON format. It pipes +Gitleaks, Semgrep and CodeQL write SARIF themselves. `composer audit` and +`npm audit` have no SARIF formatter, so each of those checks runs once in +JSON format. It pipes its output through `tee`, which feeds the job log and a report file in `.logs/audit/` from the same run. The npm checks pass `--output-format json --report-type full` to `audit-ci`, so `audit-ci` From c40983c22ee270b9eb7179867a39308123158773 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 13:57:22 +1100 Subject: [PATCH 14/15] Addressed code review: checked the resolved 'index.html' against the build directory, excluded 'test/' from the explicit Semgrep targets and documented untracked and ignored Drupal files. --- .circleci/config.yml | 5 +++-- .github/workflows/audit.yml | 5 +++-- .vortex/docs/.utils/serve-router.php | 2 +- .../docs/content/development/security/code-scanning.mdx | 8 +++++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1611ac3ee4..943334a0c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -261,12 +261,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 6f1c8e8933..c1efb0e5d7 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -188,11 +188,12 @@ jobs: #;> DRUPAL_THEME # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip + # Semgrep's ignore rules, so test directories are excluded here. - name: Scan PHP code for vulnerabilities with Semgrep if: ${{ !cancelled() }} run: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') docker run --rm --volumes-from "${HOSTNAME}" -w "${PWD}" semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} diff --git a/.vortex/docs/.utils/serve-router.php b/.vortex/docs/.utils/serve-router.php index fccf82b9d3..15c85bea4c 100644 --- a/.vortex/docs/.utils/serve-router.php +++ b/.vortex/docs/.utils/serve-router.php @@ -35,7 +35,7 @@ $index = $target === FALSE ? FALSE : realpath($target . '/index.html'); -if ($index !== FALSE && is_file($index)) { +if ($index !== FALSE && str_starts_with($index, $doc_root . DIRECTORY_SEPARATOR) && is_file($index)) { header('Content-Type: text/html; charset=UTF-8'); readfile($index); diff --git a/.vortex/docs/content/development/security/code-scanning.mdx b/.vortex/docs/content/development/security/code-scanning.mdx index cfa7261f9b..69575aebee 100644 --- a/.vortex/docs/content/development/security/code-scanning.mdx +++ b/.vortex/docs/content/development/security/code-scanning.mdx @@ -26,7 +26,7 @@ CodeQL has no PHP analyzer, so Semgrep covers the PHP code. the project root, with the same version and flags as CI: ```shell -docker run --rm -v "${PWD}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . $(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') +docker run --rm -v "${PWD}:/src" -w /src semgrep/semgrep:1.185.0 semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . $(git ls-files --cached --others --exclude-standard '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') ``` Semgrep scans the files tracked by Git and the untracked files that @@ -37,6 +37,8 @@ list](https://semgrep.dev/docs/ignoring-files-folders-code#understand-semgrep-de Semgrep detects PHP by the `.php` extension only. The `git ls-files` list passes the Drupal PHP files with other extensions, such as `.module` and `.theme`, and `--scan-unknown-extensions` makes Semgrep scan them as PHP. +The list includes untracked files and leaves out `tests/` and `test/` +directories. `--error` makes the command exit with `1` when it finds a vulnerability. On a clean codebase, the scan ends with `0 findings`. @@ -55,6 +57,10 @@ To skip a path, list it in a `.semgrepignore` file at the project root. That file replaces Semgrep's default ignore list, so also add the default paths you still want skipped, such as `tests/`. +Semgrep scans every file passed by name, even when `.semgrepignore` lists +it. The Drupal files in the `git ls-files` list are passed by name, so +ignore their findings with `nosemgrep` comments. + CodeQL findings have no in-code exception. Dismiss them in code scanning, as described in [Dismiss a finding](#dismiss-a-finding). From a4d035a21e97952372697eb59d9fdeda91a7031b Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 17 Nov 2026 14:14:35 +1100 Subject: [PATCH 15/15] Updated snapshots. --- .../handler_process/_baseline/.github/workflows/audit.yml | 5 +++-- .../handler_process/ciprovider_circleci/.circleci/config.yml | 5 +++-- .../.circleci/config.yml | 5 +++-- .../handler_process/code_provider_other/.circleci/config.yml | 5 +++-- .../deploy_types_all_circleci/.circleci/config.yml | 5 +++-- .../deploy_types_none_circleci/.circleci/config.yml | 5 +++-- .../deps_updates_provider_ci_circleci/.circleci/config.yml | 5 +++-- .../gitleaks_disabled/.github/workflows/audit.yml | 2 +- .../lighthouse_enabled_circleci/.circleci/config.yml | 5 +++-- .../migration_disabled_circleci/.circleci/config.yml | 5 +++-- .../migration_enabled_circleci/.circleci/config.yml | 5 +++-- .../handler_process/theme_claro/.github/workflows/audit.yml | 2 +- .../theme_olivero/.github/workflows/audit.yml | 2 +- .../handler_process/theme_stark/.github/workflows/audit.yml | 2 +- .../handler_process/timezone_circleci/.circleci/config.yml | 5 +++-- .../tools_groups_no_be_lint_circleci/.circleci/config.yml | 5 +++-- .../tools_groups_no_be_tests_circleci/.circleci/config.yml | 5 +++-- .../tools_groups_no_fe_lint_circleci/.circleci/config.yml | 5 +++-- .../.github/workflows/audit.yml | 2 +- .../.circleci/config.yml | 5 +++-- .../tools_no_behat_circleci/.circleci/config.yml | 5 +++-- .../tools_no_dclint_circleci/.circleci/config.yml | 5 +++-- .../tools_no_docker_linters_circleci/.circleci/config.yml | 5 +++-- .../tools_no_eslint_circleci/.circleci/config.yml | 5 +++-- .../tools_no_eslint_no_theme/.github/workflows/audit.yml | 2 +- .../tools_no_hadolint_circleci/.circleci/config.yml | 5 +++-- .../tools_no_jest_circleci/.circleci/config.yml | 5 +++-- .../tools_no_phpcs_circleci/.circleci/config.yml | 5 +++-- .../tools_no_phpstan_circleci/.circleci/config.yml | 5 +++-- .../tools_no_phpunit_circleci/.circleci/config.yml | 5 +++-- .../tools_no_rector_circleci/.circleci/config.yml | 5 +++-- .../tools_no_stylelint_circleci/.circleci/config.yml | 5 +++-- .../tools_no_stylelint_no_theme/.github/workflows/audit.yml | 2 +- .../tools_no_twig_circleci/.circleci/config.yml | 5 +++-- 34 files changed, 88 insertions(+), 61 deletions(-) diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml index 69107b1861..b40c85a27b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.github/workflows/audit.yml @@ -161,11 +161,12 @@ jobs: category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip + # Semgrep's ignore rules, so test directories are excluded here. - name: Scan PHP code for vulnerabilities with Semgrep if: ${{ !cancelled() }} run: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') docker run --rm --volumes-from "${HOSTNAME}" -w "${PWD}" semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --sarif-output=.logs/audit/semgrep.sarif --scan-unknown-extensions . "${files[@]}" continue-on-error: ${{ vars.VORTEX_CI_SEMGREP_IGNORE_FAILURE == '1' }} diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml index a5e4bc9d83..606617866d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/code_provider_other/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml index 0531f3b780..8fa7556622 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml index dec57e2cd8..90dba5e6dd 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/gitleaks_disabled/.github/workflows/audit.yml @@ -1,4 +1,4 @@ -@@ -177,19 +177,6 @@ +@@ -178,19 +178,6 @@ sarif_file: .logs/audit/semgrep.sarif category: semgrep diff --git a/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml index d3e5fba077..b23c065637 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/lighthouse_enabled_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml index 4d98d0e3e7..81e48d2aa2 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml index acb075490a..5b712b7c78 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_claro/.github/workflows/audit.yml @@ -33,4 +33,4 @@ - category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml index acb075490a..5b712b7c78 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.github/workflows/audit.yml @@ -33,4 +33,4 @@ - category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip diff --git a/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml index acb075490a..5b712b7c78 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/theme_stark/.github/workflows/audit.yml @@ -33,4 +33,4 @@ - category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml index 7231a2e84e..72008711b2 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.circleci/config.yml @@ -205,12 +205,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml index 64329c4884..47469b644e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.circleci/config.yml @@ -213,12 +213,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml index 12b84d8d6a..215c773a59 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.circleci/config.yml @@ -196,12 +196,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml index c083a59cfc..e8fbe3ae4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.github/workflows/audit.yml @@ -56,4 +56,4 @@ - category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml index d27e93bd63..45a3d0397e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.circleci/config.yml @@ -187,12 +187,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml index a43921347d..52d2cbd28c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.circleci/config.yml @@ -213,12 +213,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml index 356ac1cb88..9b9e6a1940 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/.circleci/config.yml @@ -208,12 +208,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml index 282d60cf42..7eb4d5d399 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/.circleci/config.yml @@ -201,12 +201,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml index acb075490a..5b712b7c78 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.github/workflows/audit.yml @@ -33,4 +33,4 @@ - category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml index 87d54a3db5..266736fad2 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/.circleci/config.yml @@ -210,12 +210,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml index d08fe4c49f..44fd17395a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml index 471ede392a..5e5136940e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.circleci/config.yml @@ -213,12 +213,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml index 1bc2590c43..5a56d2391d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.circleci/config.yml @@ -213,12 +213,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml index 029635b166..81991e774a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml index f0f8a8d116..765d138c2a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.circleci/config.yml @@ -213,12 +213,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml index 1e2f36cd57..158e9aef29 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/.circleci/config.yml @@ -217,12 +217,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ] diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml index acb075490a..5b712b7c78 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.github/workflows/audit.yml @@ -33,4 +33,4 @@ - category: npm-audit-theme # Semgrep detects PHP by the '.php' extension only, so Drupal PHP files - # with other extensions are passed explicitly. + # with other extensions are passed explicitly. Explicit targets skip diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml index 54e272aeed..a2716701e4 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/.circleci/config.yml @@ -213,12 +213,13 @@ jobs: # The remote Docker engine has no access to the checkout, so the files # are copied into the container. Semgrep detects PHP by the '.php' # extension only, so Drupal PHP files with other extensions are passed - # explicitly. + # explicitly. Explicit targets skip Semgrep's ignore rules, so test + # directories are excluded here. - run: name: Scan PHP code for vulnerabilities with Semgrep when: always command: | - mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**') + mapfile -t files < <(git ls-files '*.module' '*.install' '*.theme' '*.inc' '*.profile' '*.engine' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/test/**') container="$(docker create --rm -w /src semgrep/semgrep:__VERSION__ semgrep scan --config p/php --metrics=off --error --scan-unknown-extensions . "${files[@]}")" docker cp ./. "${container}:/src" docker start --attach "${container}" || [ "${VORTEX_CI_SEMGREP_IGNORE_FAILURE:-0}" -eq 1 ]