From 3e5239f7d35e57749c01adf3dbbcd365aebb39c8 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Thu, 28 Sep 2023 15:19:09 +0200 Subject: [PATCH] Add SAST security checks with SECURITY.md #178 This commit incorporates Static Analysis Security Testing (SAST) using CodeQL. This integration will enforce consistent security assessments with every change and on a predetermined schedule. This commit also involves a restructure of security checks. The existing security-checks workflow is renamed to better reflect its functionality related to dependency audits. These changes will enhance the project's resilience against potential vulnerabilities in both the codebase and third-party dependencies. Changes include: - Remove older LGTM badge that's replaced by SAST checks. - Rename `checks.security.yaml` to `checks.security.dependencies.yaml`, reinforcing the focus on dependency audits. - Update `README.md`, ensuring the clear representation of security check statuses, including new SAST integration. - Add new `SECURITY.md`, establishing the protocol for reporting vulnerabilities and outlining the project's commitment to robust security testing. - Enhance `docs/tests.md` with detailed information on the newly integrated security checks. - Add reference to SECURITY.md in README.md. --- ...yaml => checks.security.dependencies.yaml} | 2 +- .github/workflows/checks.security.sast.yaml | 42 +++++++++++++++++++ README.md | 32 +++++++------- SECURITY.md | 31 ++++++++++++++ docs/tests.md | 5 +++ 5 files changed, 97 insertions(+), 15 deletions(-) rename .github/workflows/{checks.security.yaml => checks.security.dependencies.yaml} (93%) create mode 100644 .github/workflows/checks.security.sast.yaml create mode 100644 SECURITY.md diff --git a/.github/workflows/checks.security.yaml b/.github/workflows/checks.security.dependencies.yaml similarity index 93% rename from .github/workflows/checks.security.yaml rename to .github/workflows/checks.security.dependencies.yaml index 543c05e8..0bd23dca 100644 --- a/.github/workflows/checks.security.yaml +++ b/.github/workflows/checks.security.dependencies.yaml @@ -1,4 +1,4 @@ -name: security-checks +name: checks.security.dependencies on: push: diff --git a/.github/workflows/checks.security.sast.yaml b/.github/workflows/checks.security.sast.yaml new file mode 100644 index 00000000..8df97017 --- /dev/null +++ b/.github/workflows/checks.security.sast.yaml @@ -0,0 +1,42 @@ +name: checks.security.sast + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 0' # at 00:00 on every Sunday + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ + javascript # analyzes code written in JavaScript, TypeScript and both. + ] + + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + - + name: Autobuild + uses: github/codeql-action/autobuild@v2 + - + name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}" diff --git a/README.md b/README.md index 0a018859..f9e10681 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,6 @@ src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" /> - -
- - Language grade: JavaScript/TypeScript - Maintainability + +
+ + Status of dependency security checks + + + Status of Static Analysis Security Testing (SAST) +
@@ -58,12 +64,6 @@ src="https://github.com/undergroundwires/privacy.sexy/workflows/quality-checks/badge.svg" /> - - Security checks status -