Skip to content

Feature/26 t1 bac aa scan summary endpoint#236

Open
shaniashina wants to merge 124 commits into
feature/appsec-security-mdfrom
feature/26T1-BAC-AA-scan-summary-endpoint
Open

Feature/26 t1 bac aa scan summary endpoint#236
shaniashina wants to merge 124 commits into
feature/appsec-security-mdfrom
feature/26T1-BAC-AA-scan-summary-endpoint

Conversation

@shaniashina
Copy link
Copy Markdown
Collaborator

Summary name: AutoAudit Security CI/CD Pipeline
Security Fixes Implemented
Several security improvements were implemented to strengthen the AutoAudit Security CI/CD workflow and improve overall DevSecOps practices. The workflow logic was corrected to ensure proper conditional execution of security jobs, while GitHub CodeQL was integrated for automated static application security testing (SAST). Additional protections were added through dependency vulnerability scanning, secret and credential detection using Gitleaks, and Docker container vulnerability scanning using Trivy. Workflow permissions were restricted following least privilege principles to reduce unnecessary access and improve security hardening. The workflow was also enhanced with scheduled weekly scans, improved maintainability, dependency caching, and better workflow organisation to support secure software development lifecycle (SSDLC) practices and continuous security validation.

#name: AutoAudit Security CI/CD Pipeline

Workflow Triggers

on:
push:
branches:
- main
- staging
- dev

pull_request:
branches:
- main
- staging
- dev

Weekly scheduled security scan

schedule:
- cron: '32 23 * * 6'

Default Repository Permissions

permissions:
contents: read

Jobs

jobs:

Detect Relevant Security Changes

detect-changes:
name: Detect Security Related Changes
runs-on: ubuntu-latest

outputs:
  security: ${{ steps.filter.outputs.security }}

steps:
  - name: Checkout Repository
    uses: actions/checkout@v4

  - name: Detect Changed Files
    id: filter
    uses: dorny/paths-filter@v3

    with:
      filters: |
        security:
          - '.github/workflows/**'
          - 'security/**'
          - 'backend/**'
          - 'src/**'
          - 'package.json'
          - 'package-lock.json'

Static Application Security Testing (SAST)

codeql-analysis:
name: CodeQL Security Analysis

runs-on: ubuntu-latest

needs: detect-changes

# Run analysis if:
# - Pull request event
# - Scheduled scan
# - Security-related files changed
if: |
  github.event_name != 'push' ||
  needs.detect-changes.outputs.security == 'true'

permissions:
  actions: read
  contents: read
  security-events: write
  packages: read

strategy:
  fail-fast: false

  matrix:
    language:
      - javascript-typescript

steps:

  - name: Checkout Repository
    uses: actions/checkout@v4

  - name: Setup Node.js Environment
    uses: actions/setup-node@v4

    with:
      node-version: 20
      cache: npm

  - name: Install Dependencies
    run: npm install

  # Initialize GitHub CodeQL
  - name: Initialize CodeQL
    uses: github/codeql-action/init@v3

    with:
      languages: ${{ matrix.language }}

  # Automatically build project
  - name: Perform CodeQL Autobuild
    uses: github/codeql-action/autobuild@v3

  # Run security analysis
  - name: Execute CodeQL Analysis
    uses: github/codeql-action/analyze@v3

    with:
      category: "/language:${{ matrix.language }}"

Dependency Vulnerability Review

dependency-review:
name: Dependency Security Review

runs-on: ubuntu-latest

# Only run on pull requests
if: github.event_name == 'pull_request'

permissions:
  contents: read
  pull-requests: write

steps:

  - name: Checkout Repository
    uses: actions/checkout@v4

  - name: Review Dependency Vulnerabilities
    uses: actions/dependency-review-action@v4

Secret and Credential Scanning

secret-scanning:
name: Secret and Credential Detection

runs-on: ubuntu-latest

permissions:
  contents: read

steps:

  - name: Checkout Repository
    uses: actions/checkout@v4

  # Scan repository for exposed secrets
  - name: Run Gitleaks Secret Scan
    uses: gitleaks/gitleaks-action@v2

Linting and Code Quality Validation

lint-validation:
name: Linting and Code Quality Checks

runs-on: ubuntu-latest

needs:
  - detect-changes
  - codeql-analysis

if: |
  github.event_name != 'push' ||
  needs.detect-changes.outputs.security == 'true'

steps:

  - name: Checkout Repository
    uses: actions/checkout@v4

    with:
      fetch-depth: 0

  # Run GitHub Super-Linter
  - name: Execute Super-Linter
    uses: super-linter/super-linter@v7

    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      DEFAULT_BRANCH: main
      VALIDATE_ALL_CODEBASE: false

      # Enabled Validators
      VALIDATE_YAML: true
      VALIDATE_GITHUB_ACTIONS: true

      # Disabled Validators
      VALIDATE_HTML: false
      VALIDATE_PYTHON_BLACK: false
      VALIDATE_PYTHON_FLAKE8: false
      VALIDATE_PYTHON_ISORT: false

Docker Container Security Scanning

container-security-scan:
name: Docker Container Vulnerability Scan

runs-on: ubuntu-latest

# Only run on main branch
if: github.ref == 'refs/heads/main'

permissions:
  contents: read

steps:

  - name: Checkout Repository
    uses: actions/checkout@v4

  # Build Docker image
  - name: Build Docker Image
    run: |
      docker build -t autoaudit-backend:latest .

  # Scan Docker image using Trivy
  - name: Scan Docker Image with Trivy
    uses: aquasecurity/trivy-action@0.24.0

    with:
      image-ref: autoaudit-backend:latest
      format: table
      exit-code: 0
      ignore-unfixed: true
      vuln-type: 'os,library'
      severity: 'CRITICAL,HIGH'

Future Secure Deployment Stage

deploy:

name: Secure Production Deployment

runs-on: ubuntu-latest

needs:

- codeql-analysis

- dependency-review

- secret-scanning

- lint-validation

- container-security-scan

if: github.ref == 'refs/heads/main'

environment: production

steps:

- name: Checkout Repository

uses: actions/checkout@v4

- name: Secure Deployment Placeholder

run: echo "Future production deployment process"

srujan0301 and others added 30 commits March 20, 2026 18:38
…YiFeng

feat: TailwindCSS migration for About Us and Contact Us pages, update…
phanvuminhtrung and others added 24 commits May 4, 2026 14:11
26T1-UI-RL-004  | Migrate from vanilla CSS to TailwindCSS
These are the GCP collectors and Rego files prepared by TAWALI CHAPAU for CIS v8 - domain: access control.
…26-2026

Adds a JSON version of the CIS Microsoft 365 Foundations Benchmark (v6.0.1) to make the benchmark content easier to parse, reference, and reuse across the project.
This change converts the benchmark structure into machine-readable JSON, preserving key fields such as control number, level, title, description, rationale, audit steps, remediation, default values, and references.
The test mirrors the path-building logic from tasks.py. Adding the framework-name and control_id transforms here so the two stay in sync. Required by frameworks like essential-eight that contain hyphens, and by control IDs like E8-MAC-2.1 that contain hyphens and uppercase letters.
…nsive-aamir

Improve mobile responsiveness for assigned pages
…nsive-sebin-clean

Improve mobile responsiveness for assigned pages
GRC Framework for CIS Microsoft 365 Foundations Benchmark v6.0.1 – 2-…
…-normalization

Normalize framework name and control_id when building OPA package path. Lowercases the framework name and replaces hyphens with underscores so frameworks like essential-eight and control IDs like E8-MAC-2.1 resolve to the correct Rego package. Backwards-compatible on existing CIS inputs. Unblocks PR #215.
design- gcp collector and rego files from TAWALI CHAPAU (s225172187)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c589c3ae93

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

]

def _extract_access_reviews(self, logs):
cutoff = datetime.utcnow() - timedelta(days=365)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use timezone-aware cutoff for access review filtering

_extract_access_reviews computes cutoff with datetime.utcnow() (naive), but the timestamps it compares against come from _parse_time, which returns timezone-aware datetimes (+00:00). When a log entry has a timestamp, this comparison raises TypeError: can't compare offset-naive and offset-aware datetimes, which aborts collection instead of returning access-review data.

Useful? React with 👍 / 👎.

Comment on lines +4 to +8
# push:
# branches: ['main', 'staging', 'dev']
pull_request:
branches: ['main', 'staging', 'dev']
schedule:
- cron: '32 23 * * 6'
branches: ['main']
# schedule:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore CI triggers for staging/dev and scheduled scans

This workflow now runs only for pull requests targeting main because push and schedule triggers were commented out and pull_request was narrowed to main. As a result, engine checks no longer run for staging/dev PRs or weekly scheduled security scans, so regressions and vulnerabilities in those flows will go untested.

Useful? React with 👍 / 👎.

@du-dhartley
Copy link
Copy Markdown
Collaborator

@shaniashina It appears that the target branch is incorrect - or was this deliberate?

@shaniashina
Copy link
Copy Markdown
Collaborator Author

shaniashina commented May 22, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.