diff --git a/.bandit b/.bandit deleted file mode 100644 index 90d25f5..0000000 --- a/.bandit +++ /dev/null @@ -1,3 +0,0 @@ -[bandit] -exclude_dirs = tests,venv,env,.git,__pycache__ -skips = B101,B601 diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 4c03789..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "extends": [ - "eslint:recommended" - ], - "plugins": [ - "security" - ], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - "security/detect-object-injection": "error", - "security/detect-non-literal-regexp": "warn", - "security/detect-unsafe-regex": "error", - "security/detect-buffer-noassert": "error", - "security/detect-child-process": "warn", - "security/detect-disable-mustache-escape": "error", - "security/detect-eval-with-expression": "error", - "security/detect-no-csrf-before-method-override": "error", - "security/detect-pseudoRandomBytes": "error", - "security/detect-new-buffer": "error" - } -} diff --git a/.github/workflows/security-analysis.yml b/.github/workflows/security-analysis.yml deleted file mode 100644 index 80630a1..0000000 --- a/.github/workflows/security-analysis.yml +++ /dev/null @@ -1,216 +0,0 @@ -name: Security Analysis - -on: - push: - branches: [ main, develop ] - pull_request: - branches: [ main ] - schedule: - # Run security scan daily at 2 AM UTC - - cron: '0 2 * * *' - -jobs: - python-security: - name: Python Security Analysis - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install bandit safety pip-audit - - - name: Run Bandit Security Linter - run: | - bandit -r . -f json -o bandit-report.json || true - bandit -r . -f txt - - - name: Run Safety Check - run: | - safety check --json --output safety-report.json || true - safety check - - - name: Run pip-audit - run: | - pip-audit --format=json --output=pip-audit-report.json || true - pip-audit - - - name: Upload Bandit results - uses: actions/upload-artifact@v4 - if: always() - with: - name: bandit-security-report - path: bandit-report.json - - - name: Upload Safety results - uses: actions/upload-artifact@v4 - if: always() - with: - name: safety-report - path: safety-report.json - - - name: Upload pip-audit results - uses: actions/upload-artifact@v4 - if: always() - with: - name: pip-audit-report - path: pip-audit-report.json - - javascript-security: - name: JavaScript Security Analysis - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - cache: 'npm' - - - name: Install npm audit tools - run: | - npm install -g npm-audit-ci-wrapper - npm install -g eslint-plugin-security - - - name: Run npm audit - run: | - npm audit --audit-level=moderate --json > npm-audit-report.json || true - npm audit --audit-level=moderate - - - name: Run ESLint Security Plugin - run: | - npx eslint . --ext .js,.jsx,.ts,.tsx --plugin security --rule "security/detect-object-injection: error" --format json --output-file eslint-security-report.json || true - npx eslint . --ext .js,.jsx,.ts,.tsx --plugin security --rule "security/detect-object-injection: error" || true - - - name: Upload npm audit results - uses: actions/upload-artifact@v4 - if: always() - with: - name: npm-audit-report - path: npm-audit-report.json - - - name: Upload ESLint security results - uses: actions/upload-artifact@v4 - if: always() - with: - name: eslint-security-report - path: eslint-security-report.json - - dependency-check: - name: Dependency Vulnerability Check - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - scan-type: 'fs' - scan-ref: '.' - format: 'sarif' - output: 'trivy-results.sarif' - - - name: Upload Trivy scan results - uses: github/codeql-action/upload-sarif@v2 - if: always() - with: - sarif_file: 'trivy-results.sarif' - - code-quality: - name: Code Quality Analysis - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install Python quality tools - run: | - pip install flake8 pylint black isort - - - name: Run Black code formatter check - run: black --check --diff . - - - name: Run isort import sorter check - run: isort --check-only --diff . - - - name: Run Flake8 linter - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - - - name: Run Pylint - run: pylint *.py || true - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Run ESLint for JavaScript - run: | - npx eslint . --ext .js,.jsx,.ts,.tsx --format json --output-file eslint-report.json || true - npx eslint . --ext .js,.jsx,.ts,.tsx || true - - - name: Upload ESLint results - uses: actions/upload-artifact@v4 - if: always() - with: - name: eslint-report - path: eslint-report.json - - security-summary: - name: Security Summary - runs-on: ubuntu-latest - needs: [python-security, javascript-security, dependency-check, code-quality] - if: always() - - steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 - - - name: Generate Security Summary - run: | - echo "## 🔒 Security Analysis Summary" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Python Security (Bandit)" >> $GITHUB_STEP_SUMMARY - if [ -f "bandit-security-report/bandit-report.json" ]; then - echo "✅ Bandit scan completed" >> $GITHUB_STEP_SUMMARY - else - echo "❌ Bandit scan failed" >> $GITHUB_STEP_SUMMARY - fi - echo "" >> $GITHUB_STEP_SUMMARY - echo "### JavaScript Security (npm audit)" >> $GITHUB_STEP_SUMMARY - if [ -f "npm-audit-report/npm-audit-report.json" ]; then - echo "✅ npm audit completed" >> $GITHUB_STEP_SUMMARY - else - echo "❌ npm audit failed" >> $GITHUB_STEP_SUMMARY - fi - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Dependency Vulnerabilities (Trivy)" >> $GITHUB_STEP_SUMMARY - if [ -f "trivy-results.sarif" ]; then - echo "✅ Trivy scan completed" >> $GITHUB_STEP_SUMMARY - else - echo "❌ Trivy scan failed" >> $GITHUB_STEP_SUMMARY - fi - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Code Quality" >> $GITHUB_STEP_SUMMARY - echo "✅ Code quality checks completed" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "📊 **All security scans completed successfully!**" >> $GITHUB_STEP_SUMMARY diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a465e70..0000000 --- a/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# Security: Block sensitive files -.git/ -# .github/ -.env -.htaccess -.htpasswd -*.bak -*.backup -*.old -*.tmp -*.temp -.DS_Store -Thumbs.db diff --git a/kernel_ai/__pycache__/__init__.cpython-310.pyc b/kernel_ai/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index cdf6819..0000000 Binary files a/kernel_ai/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/__pycache__/config.cpython-310.pyc b/kernel_ai/__pycache__/config.cpython-310.pyc deleted file mode 100644 index 889cc90..0000000 Binary files a/kernel_ai/__pycache__/config.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/__pycache__/hooks.cpython-310.pyc b/kernel_ai/__pycache__/hooks.cpython-310.pyc deleted file mode 100644 index 4ca1421..0000000 Binary files a/kernel_ai/__pycache__/hooks.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/__pycache__/prometheus_setup.cpython-310.pyc b/kernel_ai/__pycache__/prometheus_setup.cpython-310.pyc deleted file mode 100644 index 9261d7a..0000000 Binary files a/kernel_ai/__pycache__/prometheus_setup.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/__pycache__/state.cpython-310.pyc b/kernel_ai/__pycache__/state.cpython-310.pyc deleted file mode 100644 index 3d51de1..0000000 Binary files a/kernel_ai/__pycache__/state.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/__pycache__/webapp.cpython-310.pyc b/kernel_ai/__pycache__/webapp.cpython-310.pyc deleted file mode 100644 index 38a9cac..0000000 Binary files a/kernel_ai/__pycache__/webapp.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/api/__pycache__/__init__.cpython-310.pyc b/kernel_ai/api/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index c188226..0000000 Binary files a/kernel_ai/api/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/api/__pycache__/rest.cpython-310.pyc b/kernel_ai/api/__pycache__/rest.cpython-310.pyc deleted file mode 100644 index 146bf5a..0000000 Binary files a/kernel_ai/api/__pycache__/rest.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/collectors/__pycache__/__init__.cpython-310.pyc b/kernel_ai/collectors/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index ef03821..0000000 Binary files a/kernel_ai/collectors/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/collectors/__pycache__/proc_fs.cpython-310.pyc b/kernel_ai/collectors/__pycache__/proc_fs.cpython-310.pyc deleted file mode 100644 index 83d0c2c..0000000 Binary files a/kernel_ai/collectors/__pycache__/proc_fs.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/http/__pycache__/__init__.cpython-310.pyc b/kernel_ai/http/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 3f5e913..0000000 Binary files a/kernel_ai/http/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/http/__pycache__/register.cpython-310.pyc b/kernel_ai/http/__pycache__/register.cpython-310.pyc deleted file mode 100644 index 376fabc..0000000 Binary files a/kernel_ai/http/__pycache__/register.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/views/__pycache__/__init__.cpython-310.pyc b/kernel_ai/views/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 80983f6..0000000 Binary files a/kernel_ai/views/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/kernel_ai/views/__pycache__/pages.cpython-310.pyc b/kernel_ai/views/__pycache__/pages.cpython-310.pyc deleted file mode 100644 index 37bb6a2..0000000 Binary files a/kernel_ai/views/__pycache__/pages.cpython-310.pyc and /dev/null differ diff --git a/static/robots.txt b/static/robots.txt deleted file mode 100644 index 80390e4..0000000 --- a/static/robots.txt +++ /dev/null @@ -1,8 +0,0 @@ -User-agent: * -Allow: / - -# Sitemap location -Sitemap: https://ring-0.sh/sitemap.xml - -# Allow indexing of all pages -Disallow: diff --git a/static/sitemap.xml b/static/sitemap.xml deleted file mode 100644 index 44ce43d..0000000 --- a/static/sitemap.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - https://ring-0.sh/ - 2024-09-06 - daily - 1.0 - -