-
Notifications
You must be signed in to change notification settings - Fork 0
chore: harden repository security #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - dependencies | ||
| - security | ||
| groups: | ||
| next-stack: | ||
| patterns: | ||
| - next | ||
| - react | ||
| - react-dom | ||
| tooling: | ||
| patterns: | ||
| - eslint* | ||
| - typescript | ||
| - @types/* | ||
| - tailwindcss | ||
| - postcss | ||
| - autoprefixer | ||
| - wrangler | ||
| - @opennextjs/* | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - dependencies | ||
| - security | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| name: Security | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| push: | ||
| branches: | ||
| - main | ||
| schedule: | ||
| - cron: '23 4 * * 1' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| concurrency: | ||
| group: security-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| name: Dependency review | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Dependency review | ||
| uses: actions/dependency-review-action@v4 | ||
| with: | ||
| fail-on-severity: high | ||
|
|
||
| audit: | ||
| name: npm audit | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Audit production dependencies | ||
| run: npm audit --omit=dev --audit-level=high | ||
|
|
||
| secret-scan: | ||
| name: Secret scan | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Scan for secrets | ||
| uses: gitleaks/gitleaks-action@v2 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITLEAKS_ENABLE_COMMENTS: false | ||
|
Comment on lines
+78
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This secret-scan job will fail in organization-owned repositories because Useful? React with 👍 / 👎. |
||
|
|
||
| codeql: | ||
| name: CodeQL | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: | ||
| - javascript-typescript | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: none | ||
|
|
||
| - name: Perform CodeQL analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Security Policy | ||
|
|
||
| ## Supported Versions | ||
|
|
||
| This project currently supports security fixes on the latest state of the `main` branch. | ||
|
|
||
| ## Reporting a Vulnerability | ||
|
|
||
| Please do not open a public issue for security reports, leaked secrets, or deployment credentials. | ||
|
|
||
| Instead, use one of these channels: | ||
|
|
||
| 1. GitHub security advisory reporting for this repository, if available. | ||
| 2. A private direct contact channel with the maintainer. | ||
|
|
||
| When reporting, include: | ||
|
|
||
| - a short summary of the issue | ||
| - affected files, routes, or workflows | ||
| - reproduction steps or proof of concept | ||
| - impact assessment | ||
| - any suggested remediation | ||
|
|
||
| ## Secret Handling | ||
|
|
||
| - Never commit `.env*`, `.dev.vars*`, `secrets.json`, private keys, or cloud credentials. | ||
| - Use GitHub Actions secrets, Cloudflare dashboard secrets, or `wrangler secret put` for production secrets. | ||
| - Rotate exposed secrets immediately, then remove them from the repository history if they were ever committed. | ||
|
|
||
| ## Project Security Baseline | ||
|
|
||
| - Branch protection on `main` | ||
| - Build validation in CI | ||
| - Dependency review on pull requests | ||
| - Production dependency audit in CI | ||
| - Secret scanning in CI | ||
| - CodeQL static analysis | ||
| - Dependabot updates for npm and GitHub Actions |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: peixl/Codex-Getting-Started-Tutorial
Length of output: 323
Quote
@-prefixed Dependabot patterns to fix YAML parse failure.Lines 21 and 26 use unquoted scalars starting with
@, which is invalid YAML. The parser fails with "found character '@' that cannot start any token" and prevents Dependabot from loading the config.Suggested fix
tooling: patterns: - eslint* - typescript - - `@types/`* + - "@types/*" - tailwindcss - postcss - autoprefixer - wrangler - - `@opennextjs/`* + - "@opennextjs/*"🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 21-21: syntax error: found character '@' that cannot start any token
(syntax)
🤖 Prompt for AI Agents