Skip to content

Feat/testing security improvements#141

Merged
Hexstar-labs merged 7 commits intoBrainTease:mainfrom
caxtonacollins:feat/testing-security-improvements
Mar 28, 2026
Merged

Feat/testing security improvements#141
Hexstar-labs merged 7 commits intoBrainTease:mainfrom
caxtonacollins:feat/testing-security-improvements

Conversation

@caxtonacollins
Copy link
Copy Markdown
Contributor

Testing & Security Improvements

Overview

Comprehensive implementation of testing and security enhancements across the Brain-Storm project, addressing issues #96, #97, #98, and #99.

Closes #96
Closes #97
Closes #98
Closes #99

Changes

Issue #97: ESLint and Prettier

  • Added .eslintrc.js for backend with @typescript-eslint rules
  • Added .eslintrc.js for frontend with React and TypeScript support
  • Added .prettierrc at repo root with consistent formatting rules
  • Added npm run lint, npm run lint:fix, npm run format:check, and npm run format scripts to both apps
  • Updated package.json with ESLint and Prettier devDependencies

Issue #98: SonarCloud Static Analysis

  • Created sonar-project.properties at repo root
  • Configured coverage report paths for Jest (backend) and Vitest (frontend)
  • Added SonarCloud GitHub Action to CI pipeline
  • Set quality gate: coverage ≥ 70%, no new critical issues
  • Updated Jest config to generate LCOV coverage reports

Issue #99: Cargo Audit & Deny

  • Created deny.toml at repo root for Rust dependency policy enforcement
  • Configured advisories to deny warnings on vulnerabilities
  • Set up license allowlist (MIT, Apache-2.0, BSD variants, ISC, Unicode)
  • Added cargo audit --deny warnings step to CI
  • Added cargo deny check step to CI

Issue #96: OWASP ZAP Security Scanning

  • Added OWASP ZAP baseline scan as GitHub Actions job
  • Configured to target backend URL with full scan (-a flag)
  • Uploads zap-report.html as CI artifact
  • Fails CI if HIGH severity findings are detected
  • Created docs/security.md with comprehensive security guidelines and triage workflow

CI/CD Updates

  • Added linting steps to backend and frontend build jobs
  • Added SonarCloud job for code quality analysis
  • Added OWASP ZAP security scanning job
  • Added cargo audit and cargo deny checks to contracts job
  • All jobs properly configured with dependencies and error handling

Documentation

  • Created docs/security.md with:
    • OWASP ZAP findings triage workflow
    • Common vulnerabilities and remediation steps
    • Local testing instructions
    • Cargo audit and deny usage guidelines
    • Code quality and linting best practices

Testing

All configurations have been validated:

  • ESLint and Prettier configs are syntactically correct
  • Package.json files are valid JSON with compatible dependency versions
  • CI workflow YAML is properly formatted
  • deny.toml follows cargo-deny specification
  • sonar-project.properties is correctly configured

Breaking Changes

None. All changes are additive and backward compatible.

Migration Guide

No migration needed. Developers should:

  1. Run npm install to get new devDependencies
  2. Run npm run lint:fix and npm run format to fix existing code
  3. Review docs/security.md for security best practices

- Add .eslintrc.js for backend with @typescript-eslint rules
- Add .eslintrc.js for frontend with React and TypeScript support
- Add .prettierrc at repo root with consistent formatting rules
- Add .prettierignore to exclude build artifacts and dependencies
- Add lint, lint:fix, format:check, and format scripts to both apps
- Add ESLint and Prettier devDependencies with compatible versions
- Update frontend to use ESLint instead of Next.js built-in linting
- Ensure TypeScript ESLint compatibility across both apps
- Add deny.toml at repo root for Rust dependency policy enforcement
- Configure advisories to deny warnings on vulnerabilities
- Set up license allowlist (MIT, Apache-2.0, BSD variants, ISC, Unicode)
- Configure bans for GPL and AGPL licenses
- Enable duplicate dependency detection
…orts

- Add lcov and html to coverageReporters for SonarCloud integration
- Ensure coverage reports are generated in correct format for CI
- Create sonar-project.properties at repo root
- Configure source paths for backend, frontend, and contracts
- Set up coverage report paths for Jest (backend) and Vitest (frontend)
- Enable quality gate with wait flag
- Configure TypeScript language settings
…tation

- Document OWASP ZAP scanning process and finding triage workflow
- Provide common ZAP findings and remediation steps
- Include local ZAP testing instructions
- Document cargo audit and cargo deny usage
- Add code quality and linting guidelines
…mprehensive CI/CD testing and security jobs

- Add ESLint linting steps to backend and frontend build jobs
- Add SonarCloud job for code quality analysis with coverage reporting
- Add OWASP ZAP security scanning job with baseline scan and artifact upload
- Add cargo audit and cargo deny checks to contracts job
- Configure quality gates and security thresholds
- Update job names for clarity
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@caxtonacollins Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Hexstar-labs Hexstar-labs merged commit 61c21c5 into BrainTease:main Mar 28, 2026
2 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants