Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔍 chore: add CodeQL configuration for security scanning #5700

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 6, 2025

Summary

This PR introduces CodeQL security scanning to our repository. It adds a new CodeQL configuration file and a GitHub Actions workflow that automatically runs security analyses on our codebase. These changes aim to proactively detect vulnerabilities and improve the overall security posture of the project.

Changes

  • .codeql-config.yml

    • Added a configuration file to define the paths for CodeQL scanning.
    • Excludes test directories and files (**/test/**, **/__tests__/**, **/*.spec.*, and **/*.test.*) to focus the analysis on production code.
  • .github/workflows/codeql.yml

    • Added a new GitHub Actions workflow for CodeQL.
    • The workflow triggers on pushes and pull requests to the main branch, as well as on a scheduled basis (every Friday at 23:43).
    • It initializes CodeQL for the specified languages (currently using the javascript-typescript configuration) and performs a security analysis based on our custom configuration.
    • Provides an optional section for a manual build step if needed for specific languages.

Motivation and Context

Integrating CodeQL into our CI pipeline helps us automatically scan for security vulnerabilities and bugs, ensuring our code remains secure as it evolves. By excluding test files from the analysis, we reduce noise and focus on critical production code. This change aligns with our commitment to security best practices and continuous improvement of our code quality.

Testing

  • Locally:

    • Verify the presence of the new configuration and workflow files in your local repository.
  • CI/CD:

    • Open a pull request or push to the main branch to trigger the CodeQL workflow.
    • Monitor the GitHub Actions tab to ensure that the CodeQL analysis runs successfully.

Checklist

  • My code adheres to this project's style guidelines.
  • I have performed a self-review of my changes.
  • The new CodeQL configuration excludes non-production files.
  • The CodeQL workflow is configured to run on pushes, pull requests, and a weekly schedule.
  • Documentation and comments have been added where necessary.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@rubentalstra rubentalstra marked this pull request as ready for review February 6, 2025 20:04
@berry-13 berry-13 changed the title Create codeql.yml 🔍 chore: add CodeQL configuration for security scanning Feb 7, 2025
@rubentalstra rubentalstra added the 🧹 chore Routine maintenance tasks label Feb 8, 2025
@rubentalstra rubentalstra marked this pull request as draft February 10, 2025 10:44
@rubentalstra rubentalstra marked this pull request as ready for review February 12, 2025 17:20
@rubentalstra rubentalstra self-assigned this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 chore Routine maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant