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
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 🛡️ Security Checklist
*Review and check all that apply before requesting a review.*

- [ ] **Secrets:** I have verified that no API keys, passwords, or certificates are hardcoded.
- [ ] **Dependencies:** I have checked for known vulnerabilities in any new libraries added.
- [ ] **Data Handling:** Sensitive data (PII) is encrypted or masked in logs.
- [ ] **Input Validation:** All user-provided input is sanitized to prevent SQLi or XSS.
- [ ] **Permissions:** New endpoints or features follow the Principle of Least Privilege.

## ⚙️ Backend & Performance
- [ ] **Database:** I have checked for N+1 query issues and verified index usage.
- [ ] **Migrations:** Database migrations are reversible (where applicable) and tested.
- [ ] **Error Handling:** Errors are caught and returned with appropriate HTTP status codes.
- [ ] **Scalability:** Large datasets are handled via pagination, not loaded entirely into memory.
- [ ] **Async:** Long-running tasks are moved to background workers (if applicable).

## 🧪 Testing & Quality
- [ ] **Unit Tests:** Added/updated tests for the core logic.
- [ ] **Integration:** Verified that API contracts haven't broken for downstream services.
- [ ] **Observability:** Added logs or metrics to track the success/failure of this feature.
- [ ] **Documentation:** Updated Swagger/OpenAPI specs or internal READMEs.

## ✍️ Sign-off
- [ ] I confirm that I have performed a self-review of this code from a security perspective.

**Reviewer Sign-off:** *(To be completed by the reviewer)*
- [ ] Security standards verified.
26 changes: 26 additions & 0 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Security Scan"

on:
pull_request:
branches: [ "master" ]
Comment on lines +3 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add a push trigger on master for CodeQL baseline results.

CodeQL needs to run on pushes to the default branch to populate the Security tab and establish a baseline for PR comparisons. Without this, PR scans may produce incomplete or noisy results.

Proposed fix
 on:
+  push:
+    branches: [ "master" ]
   pull_request:
     branches: [ "master" ]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
pull_request:
branches: [ "master" ]
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
🤖 Prompt for AI Agents
In @.github/workflows/security-scan.yml around lines 3 - 5, The workflow
currently triggers only on pull_request (branches: ["master"]) which prevents
CodeQL from running on pushes to the default branch and thus stops baseline
results from being populated; update the GitHub Actions triggers in
.github/workflows/security-scan.yml by adding a push trigger for branch "master"
alongside the existing pull_request trigger so CodeQL runs on pushes to master
(ensuring Security tab baseline population) while keeping the existing
pull_request configuration intact.


jobs:
analyze:
name: Analyze Code
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'javascript' # Change to your language (python, go, etc.)
Comment on lines +20 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the primary languages used in the repo
fd -e js -e ts -e py -e go -e java -e rb -e cpp -e cs | head -30
echo "---"
# Check if package.json exists to confirm JS/TS project
fd -g 'package.json' --max-depth 2

Repository: CloudStuffTech/tracker-utils

Length of output: 596


🏁 Script executed:

cat -n .github/workflows/security-scan.yml

Repository: CloudStuffTech/tracker-utils

Length of output: 805


🏁 Script executed:

cat package.json

Repository: CloudStuffTech/tracker-utils

Length of output: 987


Remove the misleading placeholder comment from the language setting.

The repository is a pure JavaScript project (package.json with only JavaScript files). The languages: 'javascript' setting is correct and not a placeholder. The comment "Change to your language (python, go, etc.)" is misleading and should be removed.

The autobuild step is optional for JavaScript-only projects without build processes. Since this repo has no build scripts, autobuild is not necessary for the CodeQL analysis to function correctly. It would only be required if compiled languages (Python, Go, C++, etc.) are added in the future.

Suggested change
      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
-          languages: 'javascript' # Change to your language (python, go, etc.)
+          languages: 'javascript'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'javascript' # Change to your language (python, go, etc.)
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'javascript'
🤖 Prompt for AI Agents
In @.github/workflows/security-scan.yml around lines 20 - 23, Remove the
misleading inline comment in the "Initialize CodeQL" step by deleting the
"Change to your language (python, go, etc.)" text after languages: 'javascript'
in the uses: github/codeql-action/init@v3 block, and remove the unnecessary
autobuild step entirely (the step that invokes github/codeql-action/autobuild)
since this repo is pure JavaScript with no build scripts.


- name: Perform Analysis
uses: github/codeql-action/analyze@v3
Loading