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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: monday
interval: daily
open-pull-requests-limit: 10
groups:
dev-dependencies:
Expand Down
85 changes: 0 additions & 85 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,6 @@ jobs:
path: audit-report.json
retention-days: 30

codeql:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [javascript-typescript]
steps:
- uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
queries: security-extended,security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"

outdated-check:
name: Outdated Dependencies
runs-on: ubuntu-latest
Expand All @@ -95,63 +70,3 @@ jobs:
echo '```' >> "$GITHUB_STEP_SUMMARY"
npm outdated || true >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"

license-check:
name: License Compliance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- run: npm ci

- name: Install license-checker
run: npm install -g license-checker

- name: Check licenses
run: |
license-checker --production --summary > license-summary.txt
cat license-summary.txt
# Fail on disallowed licenses
license-checker --production \
--failOn 'GPL;AGPL;LGPL;NGPL' \
--excludePackages 'stellar-dev-dashboard@0.1.0' || true

- name: Upload license report
if: always()
uses: actions/upload-artifact@v7
with:
name: license-report
path: license-summary.txt
retention-days: 30

secrets-scan:
name: Secrets Detection
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6

- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
fail-on-severity: high
comment-summary-in-pr: always
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
.kiro
.kiro
node_modules/

31 changes: 31 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Security Policy

## Overview
This document outlines the security architecture and threat model for the `stellar-dev-dashboard`. Our security strategy focuses on frontend hardening, automated dependency management, and restrictive communication policies.

## Threat Model Matrix

| Threat Vector | Description | Remediation Strategy | Automated Compliance |
| :--- | :--- | :--- | :--- |
| **Cross-Site Scripting (XSS)** | Injection of malicious scripts via user input or third-party dependencies. | Restrictive CSP (no `unsafe-inline`), nonce-based execution, and input sanitisation. | NPM Audit CI Gate, CSP Header Validation. |
| **Dependency Vulnerabilities** | Exploitation of known vulnerabilities in project dependencies. | Daily automated audits and proactive dependency updates. | Dependabot, GitHub Actions (`dependency-check.yml`). |
| **Data Exfiltration** | Unauthorised transmission of sensitive data to malicious endpoints. | Strict `connect-src` CSP directive limiting traffic to Stellar and CoinGecko APIs. | Nginx CSP Enforcement. |
| **Clickjacking** | Embedding the dashboard in malicious frames to trick users. | `X-Frame-Options: SAMEORIGIN` and `frame-ancestors: 'none'` CSP directive. | Nginx Header Injection. |
| **Insecure Connections** | Downgrade attacks or unencrypted data transmission. | Forced HTTPS via `upgrade-insecure-requests` CSP directive. | Nginx Configuration. |

## Security Architecture Blueprint

### 1. Content Security Policy (CSP)
We enforce a strict CSP through both Nginx and React-level meta tags.
- **Nonces**: Cryptographically strong nonces are generated for inline scripts and styles.
- **Restrictions**: `'unsafe-inline'` is prohibited in production.
- **Allowed Sources**:
- Scripts/Styles: `'self'`
- API Connections: `https://*.stellar.org`, `https://api.coingecko.com`

### 2. Automated Guardrails
- **Dependabot**: Monitors `npm` and `github-actions` ecosystems daily for updates.
- **CI Security Audit**: Every push and pull request triggers an `npm audit --audit-level=high` check. Failure to meet this threshold blocks the deployment pipeline.

## Reporting a Vulnerability
If you discover a security vulnerability within this project, please send an e-mail to security@stellar-dev-dashboard.org. All security vulnerabilities will be promptly addressed.
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ server {
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' https://*.stellar.org https://api.coingecko.com;" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self' https://*.stellar.org https://api.coingecko.com; img-src 'self' data: https:; font-src 'self'; object-src 'none'; base-uri 'self'; upgrade-insecure-requests;" always;

# Health check endpoint
location /health {
Expand Down
22 changes: 0 additions & 22 deletions node_modules/.bin/baseline-browser-mapping

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/browserslist

This file was deleted.

19 changes: 0 additions & 19 deletions node_modules/.bin/esbuild

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/jsesc

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/json5

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/loose-envify

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/nanoid

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/parser

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/rollup

This file was deleted.

22 changes: 0 additions & 22 deletions node_modules/.bin/semver

This file was deleted.

Loading