diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..1f70c8fd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..09f03b33 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + push: + branches: [ "master", "main" ] + pull_request: + branches: [ "master", "main" ] + schedule: + - cron: '30 2 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: security-extended,security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml new file mode 100644 index 00000000..a80d9f63 --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,20 @@ +name: Gitleaks +on: + push: + branches: [ "master", "main" ] + pull_request: + branches: [ "master", "main" ] + +jobs: + scan: + name: Secret Scanning + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITLEAKS_ENABLE_UPLOAD_ARTIFACT: false + GITLEAKS_ENABLE_SUMMARY: true diff --git a/.github/workflows/nuclei-scan.yml b/.github/workflows/nuclei-scan.yml new file mode 100644 index 00000000..67d22de2 --- /dev/null +++ b/.github/workflows/nuclei-scan.yml @@ -0,0 +1,64 @@ +name: "Nuclei Security Scan" + +on: + push: + branches: [ "master", "main" ] + pull_request: + branches: [ "master", "main" ] + +jobs: + nuclei-scan: + runs-on: ubuntu-latest + name: Nuclei API & Web Security Scan + permissions: + contents: read + issues: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build Next.js (static export) + run: npm run build + env: + NEXT_PUBLIC_FIREBASE_API_KEY: "mock_api_key" + NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: "mock.firebaseapp.com" + NEXT_PUBLIC_FIREBASE_PROJECT_ID: "mock_project_id" + NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: "mock.appspot.com" + NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: "123456789" + NEXT_PUBLIC_FIREBASE_APP_ID: "1:123456789:web:abcdef" + + - name: Serve static build + run: npx serve@latest out -l 3000 & + + - name: Wait for server to be ready + run: | + for i in {1..15}; do + curl -s http://localhost:3000 > /dev/null && echo "Server is up!" && break + echo "Waiting for server... ($i)" + sleep 2 + done + + - name: Run Nuclei Scan + uses: projectdiscovery/nuclei-action@v2 + with: + target: http://localhost:3000 + flags: "-tags exposure,misconfig,headers,tech -severity low,medium,high,critical" + output: nuclei-results.txt + + - name: Upload Nuclei Results + uses: actions/upload-artifact@v4 + if: always() + with: + name: nuclei-security-report + path: nuclei-results.txt + retention-days: 30