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
21 changes: 21 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Security
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

permissions:
contents: read
pull-requests: read

jobs:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Missing explicit permissions on the workflow

The workflow doesn't set permissions, so GITHUB_TOKEN uses default permissions. For private repos, the token has write permissions by default. Since this workflow only reads code, it should explicitly set read-only permissions (e.g., permissions: contents: read).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

secret-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ go.work.sum
# Editor/IDE
# .idea/
# .vscode/
__pycache__/
node_modules/
build/
.pytest_cache/
.idea/
.vscode/
*.pyc
*.log
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: local
hooks:
- id: no-plaintext-secrets
name: block plaintext secrets
entry: bash -c 'if grep -RInE "(sk_live_|sk_test_|ghp_|AIza|BEGIN RSA)" . --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=vendor --exclude-dir=dist --exclude-dir=build --exclude-dir=test --exclude-dir=tests --exclude-dir=fixtures --exclude-dir=examples --exclude-dir=docs 2>/dev/null; then exit 1; fi'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: grep error handling is broken - the hook passes silently on filesystem errors

The if grep ...; then exit 1; fi pattern treats grep's exit code 2 (error, e.g., permission denied) as a non-match. With 2>/dev/null suppressing stderr, the hook will silently pass when grep encounters filesystem errors, potentially missing secrets.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: AIza pattern is overly broad and may cause false positives

AIza is only 4 characters and can appear in legitimate strings (e.g., documentation, variable names). Consider using a more specific pattern like AIza[0-9A-Za-z-_]{35} to match actual Google API key formats.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

language: system
pass_filenames: []
always_run: true
Loading