diff --git a/.gitea/workflows/datastack-docker-ci.yml b/.gitea/workflows/datastack-docker-ci.yml index 9669498..6149d90 100644 --- a/.gitea/workflows/datastack-docker-ci.yml +++ b/.gitea/workflows/datastack-docker-ci.yml @@ -1,9 +1,16 @@ name: DataStack Docker Build CI on: workflow_dispatch: + inputs: + security_probe_only: + description: Inspect locked security dependencies on disposable runner only + type: boolean + required: false + default: false jobs: docker-build: + if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.security_probe_only != 'true' }} runs-on: ubuntu-latest container: node:22-alpine timeout-minutes: 45 @@ -39,3 +46,42 @@ jobs: docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.proxy -t "$tag-proxy" . docker image inspect "$tag-ingestion" "$tag-web" "$tag-proxy" >/dev/null echo DATASTACK_THREE_IMAGES_BUILD_PASS + + security-backport-source-probe: + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.security_probe_only == 'true' }} + runs-on: ubuntu-latest + container: node:22-alpine + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + with: + github-server-url: https://dev.ivib.cc + persist-credentials: false + - name: Inspect locked production package sources in disposable checkout + run: | + set -eu + npm ci --omit=dev --ignore-scripts --no-audit --no-fund + node <<'NODE' + const fs = require('node:fs'); + const crypto = require('node:crypto'); + const targets = [ + ['got10', 'node_modules/got/dist/source/request-as-event-emitter.js', /redirectUrl|headers\.location|unix/i], + ['glob10', 'node_modules/glob/dist/commonjs/walker.js', /this\.signal.*aborted|walkCB\(/], + ['glob13', 'node_modules/onezip/node_modules/glob/dist/commonjs/walker.js', /this\.signal.*aborted|walkCB\(/], + ['minimatch9', 'node_modules/glob/node_modules/minimatch/dist/commonjs/index.js', /firstPhasePreProcess|secondPhasePreProcess|globParts\.length|didSomething/], + ['minimatch10', 'node_modules/onezip/node_modules/glob/node_modules/minimatch/dist/commonjs/index.js', /firstPhasePreProcess|secondPhasePreProcess|globParts\.length|didSomething/], + ['filetype16-join', 'node_modules/join-io/node_modules/ponse/node_modules/file-type/core.js', /tokenizer\.position \+ 24|readHeader\(|await tokenizer\.ignore\(payload\)/], + ['filetype16-rest', 'node_modules/restbox/node_modules/ponse/node_modules/file-type/core.js', /tokenizer\.position \+ 24|readHeader\(|await tokenizer\.ignore\(payload\)/], + ]; + for (const [name,path,re] of targets) { + if (!fs.existsSync(path)) {console.log('PROBE_MISSING', name, path);continue} + const src=fs.readFileSync(path,'utf8'),lines=src.split('\n'); + const indices=[]; + for(let i=0;i