Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down