Repository navigation
chore(security): add scanning baseline #5670
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
Closed
xXKillerNoobYT
wants to merge
3
commits into
paperclipai:master
from
xXKillerNoobYT:wei-120-security-scanning
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,42 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: "/" | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| day: monday | ||
| time: "06:00" | ||
| open-pull-requests-limit: 10 | ||
| time: "10:00" | ||
| timezone: Etc/UTC | ||
| open-pull-requests-limit: 8 | ||
| labels: | ||
| - "dependencies" | ||
| ignore: | ||
| # Ignore major version bumps — review those manually | ||
| - dependency-name: "*" | ||
| update-types: ["version-update:semver-major"] | ||
| - dependencies | ||
| groups: | ||
| production-dependencies: | ||
| dependency-type: production | ||
| update-types: | ||
| - minor | ||
| - patch | ||
| development-dependencies: | ||
| dependency-type: development | ||
| update-types: | ||
| - minor | ||
| - patch | ||
| major-dependencies: | ||
| update-types: | ||
| - major | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| day: monday | ||
| time: "06:00" | ||
| time: "10:30" | ||
| timezone: Etc/UTC | ||
| open-pull-requests-limit: 5 | ||
| labels: | ||
| - dependencies | ||
| - github-actions | ||
| groups: | ||
| github-actions: | ||
| patterns: | ||
| - "*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| push: | ||
| branches: | ||
| - master | ||
| schedule: | ||
| - cron: "26 7 * * 2" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'schedule' && 'schedule' || github.ref }} | ||
| cancel-in-progress: ${{ github.event_name != 'schedule' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze JavaScript and TypeScript | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4 | ||
| with: | ||
| languages: javascript-typescript | ||
|
|
||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4 | ||
|
|
||
| - name: Perform CodeQL analysis | ||
| uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Security Scanning Playbook | ||
|
|
||
| Paperclip uses GitHub CodeQL for source scanning and Dependabot for dependency and GitHub Actions update pull requests. | ||
|
|
||
| ## Ownership | ||
|
|
||
| The CTO owns security alert triage. The assignee for the alert or remediation issue owns the code change until the fix is merged and verified. If an alert has no assignee after one business day, the CTO assigns it directly or creates a Paperclip issue for the relevant engineer. | ||
|
|
||
| ## Alert Intake | ||
|
|
||
| 1. Review new GitHub Security alerts every business day. | ||
| 2. Confirm whether the alert affects supported Paperclip code, release artifacts, or CI/CD execution. | ||
| 3. Create or update a Paperclip issue for every actionable alert. Link the GitHub alert, affected package or source path, severity, and planned remediation. | ||
| 4. Close false positives only after documenting the reason in the GitHub alert or linked issue. | ||
|
|
||
| ## Remediation SLA | ||
|
|
||
| | Severity | First response | Remediation target | | ||
| | --- | --- | --- | | ||
| | Critical | Same business day | 2 business days | | ||
| | High | 1 business day | 5 business days | | ||
| | Medium | 2 business days | 10 business days | | ||
| | Low | 5 business days | Next planned maintenance window | | ||
|
|
||
| If a fix cannot meet its target, the owner must update the Paperclip issue with the blocker, temporary mitigation, and new target date. | ||
|
|
||
| ## Dependabot Pull Requests | ||
|
|
||
| Dependabot runs weekly for npm dependencies and GitHub Actions. Minor and patch updates are grouped by dependency type to reduce review noise; major updates are grouped separately so breaking-change risk is explicit. | ||
|
|
||
| For each Dependabot PR: | ||
|
|
||
| 1. Review release notes and lockfile changes. | ||
| 2. Run the smallest relevant local verification, then rely on required CI for broad coverage. | ||
| 3. Merge low-risk patch and minor updates once checks pass. | ||
| 4. Split or defer grouped updates if one dependency causes failures. | ||
|
|
||
| ## CodeQL Alerts | ||
|
|
||
| CodeQL runs on pull requests, pushes to `master`, and a weekly scheduled scan. Pull request findings should be fixed before merge unless the CTO accepts the risk in writing. Default-branch findings follow the SLA table above. | ||
|
|
||
| When fixing a CodeQL alert: | ||
|
|
||
| 1. Identify the vulnerable data flow or unsafe API use. | ||
| 2. Add a regression test or guardrail when practical. | ||
| 3. Reference the alert and verification in the pull request description. | ||
| 4. Confirm the alert is closed or dismissed with rationale after the fix lands on `master`. | ||
|
|
||
| ## Escalation | ||
|
|
||
| Escalate to the CTO immediately when an alert indicates exploitable remote code execution, credential exposure, authentication bypass, cross-company data access, or a compromised dependency. The CTO decides whether to pause releases, request board approval, or coordinate a private security advisory. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
uses:references use mutable version tags (@v4) rather than immutable commit SHAs. If a tag is forcibly moved—whether through a supply chain compromise or an accidental re-tag—the workflow silently adopts the new code. This is especially risky here because the job runs withsecurity-events: writeand checkout access, so compromised action code could tamper with SARIF results or exfiltrate secrets. Pin each action to its full SHA (e.g.,actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4) and reference the tag in a comment for readability.Prompt To Fix With AI