Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ jobs:
working-directory: frontend

- name: Post frontend coverage summary on PR
if: github.event_name == 'pull_request' && !cancelled()
if: >-
github.event_name == 'pull_request' && !cancelled() &&
hashFiles('frontend/coverage/coverage-summary.json') != ''
# Fork PRs get a read-only token; never fail the build over the comment.
continue-on-error: true
uses: davelosert/vitest-coverage-report-action@v2
Expand Down Expand Up @@ -245,7 +247,9 @@ jobs:
NODE_ENV: test

- name: Post backend coverage summary on PR
if: github.event_name == 'pull_request' && !cancelled()
if: >-
github.event_name == 'pull_request' && !cancelled() &&
hashFiles('backend/coverage/coverage-summary.json') != ''
continue-on-error: true
uses: davelosert/vitest-coverage-report-action@v2
with:
Expand Down
52 changes: 51 additions & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pull_request:
branches: [ main, develop ]
schedule:
- cron: '0 2 * * 0'
- cron: '0 0 * * 0'

jobs:
dependency-check:
Expand Down Expand Up @@ -89,6 +89,56 @@
run: cargo audit --ignore RUSTSEC-2026-0387
working-directory: contracts

secret-scanning:
name: Secret Leak Detection (Gitleaks)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
fetch-depth: 0

# The gitleaks CLI is MIT-licensed and free for organisations; only the
# `gitleaks/gitleaks-action` wrapper is licence-gated, so the release
# binary is installed directly instead of using the action.
- name: Install Gitleaks
env:
GITLEAKS_VERSION: 8.30.1
run: |
set -euo pipefail
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
| tar -xz -C /usr/local/bin gitleaks
gitleaks version

- name: Run Gitleaks
run: gitleaks dir . --config .gitleaks.toml --redact --verbose --exit-code 1

semgrep-sast:
name: Static Application Security Testing (Semgrep SAST)
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

container:
image: semgrep/semgrep

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

- name: Run Semgrep SAST Scan
run: semgrep scan --config auto --sarif --output=semgrep.sarif || true

- name: Upload Semgrep SARIF report
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: semgrep.sarif

codeql-analysis:
name: CodeQL Analysis
runs-on: ubuntu-latest
Expand Down
24 changes: 24 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Gitleaks configuration — https://github.com/gitleaks/gitleaks#configuration
#
# The default ruleset is kept as-is. The allowlists below only silence fixture
# data that the `generic-api-key` rule mistakes for a credential: Stellar
# contract addresses (56-character `C…` base32 strings) that appear in tests,
# seed data and documentation. Production sources are still scanned.
[extend]
useDefault = true

[[allowlists]]
description = "Test fixtures and documented demo contract addresses"
paths = [
'''backend/tests/.*''',
'''frontend/.*__tests__/.*''',
'''frontend/.*\.test\.tsx?''',
]

[[allowlists]]
description = "Public Stellar contract addresses used as demo data"
regexTarget = "match"
regexes = [
'''CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA''',
'''CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC''',
]
16 changes: 16 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ When using FlowFi, please follow these security guidelines:
4. **Software Updates**: Keep your wallet software and browser up to date
5. **Phishing Protection**: Always verify you're on the official FlowFi domain

## Automated Static Security Analysis & Vulnerability Scanning Pipeline

To protect financial payment infrastructure and detect supply chain vulnerabilities, secret leaks, and static code issues early, FlowFi runs an automated continuous security pipeline on all pull requests and on a weekly recurring schedule:

1. **Supply Chain & Dependency Audits**:
- **Rust Smart Contracts**: Automated `cargo audit` scanning Soroban contracts for known dependency vulnerabilities.
- **Node.js Workspaces**: Automated `npm audit --audit-level=high` auditing dependencies across root, frontend, and backend packages.
2. **Secret Leak Detection**:
- Automated `Gitleaks` scanning the complete commit history on all pull requests to block accidental commits of API keys, private credentials, or secrets.
3. **Static Application Security Testing (SAST)**:
- **Semgrep SAST**: Automated pattern scanning across TypeScript, React, and Rust code to detect insecure idioms, improper state mutations, and common web/smart contract anti-patterns.
- **SARIF Security Reporting**: Automated SARIF file generation uploaded directly to the repository's GitHub Security tab.
- **GitHub CodeQL Analysis**: In-depth semantic code analysis across JavaScript, TypeScript, and Rust.
4. **Automated Weekly Recurring Scans**:
- Scheduled weekly audit runs (`cron: '0 0 * * 0'`) to detect newly disclosed CVEs against existing stable dependencies.

## Bug Bounty Program

Currently, FlowFi does not have a formal bug bounty program. However, we greatly appreciate security researchers who help improve our security posture and will acknowledge their contributions appropriately.
Expand Down
1 change: 1 addition & 0 deletions backend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default defineConfig({
coverage: {
enabled: true,
provider: 'v8',
reportOnFailure: true,
reportsDirectory: './coverage',
reporter: ['text', 'json', 'json-summary', 'html', 'lcov'],
exclude: [
Expand Down
1 change: 1 addition & 0 deletions frontend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default defineConfig({
include: ['src/__tests__/**/*.{test,spec}.{ts,tsx}', 'src/**/*.{test,spec}.{ts,tsx}'],
coverage: {
provider: 'v8',
reportOnFailure: true,
reportsDirectory: './coverage',
// lcov feeds Codecov; json + json-summary feed the PR coverage table.
reporter: ['text', 'json', 'json-summary', 'html', 'lcov'],
Expand Down
Loading