From 0a1168d07e0d011d638ffe8a5d0b68a43bc0a3d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Nov 2025 20:44:52 +0000 Subject: [PATCH 1/2] Initial plan From a3a01d658220ab7508ab7fa21fc0877702cde9fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Nov 2025 20:49:04 +0000 Subject: [PATCH 2/2] Add CodeQL security scanning workflow and update README Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com> --- .github/workflows/codeql.yml | 88 ++++++++++++++++++++++++++++++++++++ README.md | 9 ++++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..504ed468 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,88 @@ +name: "CodeQL Security Scanning" + +# CodeQL is a static analysis tool that helps identify security vulnerabilities +# and code quality issues in your codebase. This workflow runs CodeQL analysis +# on the repository to detect potential security issues before they reach production. +# +# Customization Guide: +# - To analyze additional languages, add them to the language matrix below +# - Supported languages: c-cpp, csharp, go, java-kotlin, javascript-typescript, python, ruby, swift +# - For compiled languages, replace 'autobuild' step with explicit build commands +# - Adjust the schedule cron to match your preferred scanning frequency +# - Query suite can be customized in the 'Initialize CodeQL' step + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + # Run weekly on Mondays at 3:00 AM UTC + - cron: '0 3 * * 1' + +# Principle of least privilege: only grant necessary permissions +permissions: + security-events: write # Required to upload CodeQL results + contents: read # Required to checkout the repository + actions: read # Required to read workflow artifacts + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + timeout-minutes: 360 + + strategy: + fail-fast: false + matrix: + # Auto-detect languages in the repository + # This repository is primarily JavaScript/TypeScript (Meteor + React) + language: [ 'javascript-typescript' ] + # If you have additional languages, add them here: + # language: [ 'javascript-typescript', 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # For JavaScript/TypeScript, we need Node.js dependencies + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: | + # Install npm dependencies for better analysis + npm ci --ignore-scripts || npm install --ignore-scripts + + # Initialize CodeQL tools for scanning + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # Query suite options: 'default', 'security-extended', 'security-and-quality' + # 'security-extended' provides more security-focused queries + queries: security-extended + # If you want to use custom queries: + # queries: +security-and-quality + + # Autobuild attempts to build any compiled languages automatically + # For JavaScript/TypeScript, this step typically doesn't compile but may run build scripts + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # Alternative: Manual build steps for more control + # Uncomment and customize if autobuild doesn't work for your project + # - name: Build + # run: | + # npm run build + + # Perform CodeQL analysis + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" + # Upload results even if there are errors (for debugging) + upload: true diff --git a/README.md b/README.md index eeebc8ad..7ab3f1f7 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Mieweb Auth App +[![CodeQL](https://github.com/mieweb/mieweb_auth_app/actions/workflows/codeql.yml/badge.svg)](https://github.com/mieweb/mieweb_auth_app/actions/workflows/codeql.yml) + This is a full-stack Meteor application using React for the frontend and Cordova for mobile deployment. It integrates **Firebase Cloud Messaging (FCM)** to enable push notifications, using the `@havesource/cordova-plugin-push` plugin for mobile platforms. ## Architecture Overview @@ -324,6 +326,13 @@ The project includes automated CI/CD pipelines: ## Security Best Practices +### CodeQL Security Scanning +This repository uses GitHub CodeQL for automated security vulnerability scanning: +- **Automated Scanning**: CodeQL runs on every push to main, pull requests, and weekly via scheduled cron +- **Language Coverage**: JavaScript/TypeScript analysis with security-extended query suite +- **View Results**: Check the Security tab in the GitHub repository for detailed findings +- **Custom Configuration**: See `.github/workflows/codeql.yml` for customization options + ### Firebase Security - **Never commit Firebase Admin SDK JSON files to version control** - Use environment variables for all sensitive configuration