Files
corestate/.github/workflows/security-scan.yml
Wiktor d89118eb70 feat: complete full-fledged mobile app and comprehensive system improvements
## Major Features Added:

### 📱 Complete Native Mobile App
- Full Android app with Material 3 design and Jetpack Compose
- Dashboard, Backup, Files, and Settings screens with rich functionality
- Biometric authentication, file management, and real-time sync
- Modern UI components and navigation with proper state management
- Comprehensive permissions and Android manifest configuration

### 🚀 Enhanced CI/CD Pipelines
- 7 comprehensive GitHub workflows with proper testing and deployment
- Multi-language support (Kotlin, Rust, Python, Node.js, Scala)
- Security scanning with Trivy, CodeQL, Semgrep, and infrastructure validation
- Performance testing with automated benchmarking and reporting
- ML training pipeline with model validation and artifact management

### 🏗️ Production-Ready Infrastructure
- Complete Terraform configuration with VPC, EKS, security groups, IAM
- Kubernetes deployments with proper resource management and health checks
- Service mesh integration with Prometheus monitoring
- Multi-environment support with secrets management

### 🤖 Advanced ML Capabilities
- Enhanced anomaly detection with Variational Autoencoders and Isolation Forest
- Sophisticated backup prediction with ensemble methods and temporal features
- 500+ lines of production-ready ML code with proper error handling
- Model serving infrastructure with fallback mechanisms

### 🔧 Complete Microservices Architecture
- 5 new production-ready services with Docker containers:
  - Compression Engine (Rust) - Multi-algorithm compression optimization
  - Deduplication Service (Python) - Content-defined chunking
  - Encryption Service (Node.js) - Advanced cryptography and key management
  - Index Service (Kotlin) - Elasticsearch integration for fast search
  - Enhanced existing services with comprehensive dependency management

### 📊 System Improvements
- Removed web dashboard in favor of full mobile app
- Enhanced build configurations across all services
- Comprehensive dependency updates with security patches
- Cross-platform mobile support (Android + iOS KMP ready)

## Technical Details:
- 91 files changed: 9,459 additions, 2,600 deletions
- Modern Android app with Hilt DI, Room, Compose, WebRTC, gRPC
- Production infrastructure with proper security and monitoring
- Advanced ML models with ensemble approaches and feature engineering
- Comprehensive CI/CD with security scanning and performance testing
2025-07-23 02:55:21 +02:00

193 lines
6.0 KiB
YAML

name: Security Scan
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
jobs:
dependency-scan:
runs-on: ubuntu-latest
strategy:
matrix:
component:
- path: 'apps/web-dashboard'
type: 'npm'
- path: 'services/sync-coordinator'
type: 'npm'
- path: 'apps/daemon'
type: 'cargo'
- path: 'services/storage-hal'
type: 'cargo'
- path: 'services/ml-optimizer'
type: 'pip'
- path: '.'
type: 'gradle'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '${{ matrix.component.path }}'
format: 'sarif'
output: 'trivy-results-${{ matrix.component.type }}.sarif'
severity: 'CRITICAL,HIGH,MEDIUM'
- name: Upload Trivy scan results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results-${{ matrix.component.type }}.sarif'
category: 'trivy-${{ matrix.component.type }}'
secret-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run GitLeaks secret scanner
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
code-security-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java, javascript, python, cpp
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:multi"
semgrep-scan:
runs-on: ubuntu-latest
name: Semgrep Security Scan
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Semgrep
uses: returntocorp/semgrep-action@v1
with:
config: >
p/security-audit
p/owasp-top-10
p/kotlin
p/java
p/typescript
p/python
p/rust
p/cpp
generateSarif: "1"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: semgrep.sarif
license-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: FOSSA Scan
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
continue-on-error: true
container-scan:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
matrix:
service: [backup-engine, storage-hal, ml-optimizer, sync-coordinator]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker image for scanning
run: |
cd services/${{ matrix.service }}
if [ -f "Dockerfile" ]; then
docker build -t scan-image:${{ matrix.service }} .
else
echo "No Dockerfile found for ${{ matrix.service }}, skipping"
exit 0
fi
- name: Run Trivy container scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'scan-image:${{ matrix.service }}'
format: 'sarif'
output: 'container-scan-${{ matrix.service }}.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload container scan results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'container-scan-${{ matrix.service }}.sarif'
category: 'container-${{ matrix.service }}'
infrastructure-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Checkov IaC scan
uses: bridgecrewio/checkov-action@master
with:
directory: infrastructure/
framework: terraform,kubernetes,dockerfile
output_format: sarif
output_file_path: checkov-results.sarif
- name: Upload Checkov scan results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: checkov-results.sarif
category: 'infrastructure'
security-report:
needs: [dependency-scan, secret-scan, code-security-scan, semgrep-scan, license-scan, container-scan, infrastructure-scan]
runs-on: ubuntu-latest
if: always()
steps:
- name: Security Scan Summary
run: |
echo "## Security Scan Results" >> $GITHUB_STEP_SUMMARY
echo "- Dependency Scan: ${{ needs.dependency-scan.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Secret Scan: ${{ needs.secret-scan.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Code Security Scan: ${{ needs.code-security-scan.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Semgrep Scan: ${{ needs.semgrep-scan.result }}" >> $GITHUB_STEP_SUMMARY
echo "- License Scan: ${{ needs.license-scan.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Container Scan: ${{ needs.container-scan.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Infrastructure Scan: ${{ needs.infrastructure-scan.result }}" >> $GITHUB_STEP_SUMMARY