coreason-runtime 0.1.0

Kinetic Plane execution engine for the CoReason Tripartite Cybernetic Manifold
Documentation
name: Advanced Security (Malware & Secrets)

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main, develop ]
  workflow_dispatch:

permissions:
  contents: read

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

jobs:
  secret-scan:
    name: High-Entropy Secret Sweeper
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Harden Runner (Endpoint Network Security)
        uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.1
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
        with:
          fetch-depth: 0

      - name: Gitleaks Scan
        uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}

  malware-scan:
    name: Repository-Wide Malware Scan (ClamAV)
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Harden Runner (Endpoint Network Security)
        uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.1
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2

      - name: Cache ClamAV Database
        uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
        with:
          path: /var/lib/clamav
          key: ${{ runner.os }}-clamav-db-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-clamav-db-

      - name: Install ClamAV
        run: |
          sudo apt-get update
          sudo apt-get install -y clamav clamav-daemon
          sudo systemctl stop clamav-freshclam
          sudo chown -R clamav:clamav /var/lib/clamav || true
          for i in {1..3}; do sudo freshclam && break || sleep 5; done

      - name: Run ClamAV Scan
        run: clamscan -r -i ./

  license-firewall:
    name: Dependency License Firewall (Copyleft Block)
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - name: Harden Runner (Endpoint Network Security)
        uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2.19.1
        with:
          egress-policy: audit

      - name: Checkout Repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2

      - name: Dependency Review & Legal Firewall
        uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
        with:
          comment-summary-in-pr: always
          fail-on-severity: high
          deny-licenses: AGPL-1.0, AGPL-3.0, GPL-1.0, GPL-2.0, GPL-3.0, LGPL-2.0, LGPL-2.1, LGPL-3.0