config: add sarif output to semgrep workflow for CodeQL output - #8
Conversation
|
Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters. If you still want a review, comment |
| const { CohereClient } = require("cohere-ai"); | ||
|
|
||
| // ruleid: cohere-hardcoded-api-key-javascript | ||
| const client = new CohereClient({token: "abcdef1234567890"}); |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/cohere-hardcoded-api-key/cohere-hardcoded-api-key-javascript.js:generic-api-key:4 >> .gitleaksignore
| import cohere | ||
|
|
||
| # ruleid: cohere-hardcoded-api-key-python | ||
| client = cohere.Client(api_key="abcdef1234567890") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/cohere-hardcoded-api-key/cohere-hardcoded-api-key-python.py:generic-api-key:5 >> .gitleaksignore
| @@ -0,0 +1,11 @@ | |||
| # ruleid: openai-hardcoded-api-key-ruby | |||
| client = OpenAI::Client.new(access_token: "sk-1234567890abcdef") | |||
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/openai-hardcoded-api-key/openai-hardcoded-api-key-ruby.rb:generic-api-key:2 >> .gitleaksignore
| from google import genai as genai2 | ||
|
|
||
| # ruleid: gemini-hardcoded-api-key-python | ||
| genai.configure(api_key="AIzaSyA1234567890abcdefghijklmnopqrs") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/gemini-hardcoded-api-key/gemini-hardcoded-api-key-python.py:generic-api-key:6 >> .gitleaksignore
| genai.configure(api_key="AIzaSyA1234567890abcdefghijklmnopqrs") | ||
|
|
||
| # ruleid: gemini-hardcoded-api-key-python | ||
| client = genai2.Client(api_key="AIzaSyA1234567890abcdefghijklmnopqrs") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/gemini-hardcoded-api-key/gemini-hardcoded-api-key-python.py:generic-api-key:9 >> .gitleaksignore
| from mistralai import Mistral | ||
|
|
||
| # ruleid: mistral-hardcoded-api-key-python | ||
| client = Mistral(api_key="mySecretKey123456") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/mistral-hardcoded-api-key/mistral-hardcoded-api-key-python.py:generic-api-key:5 >> .gitleaksignore
| client = Mistral(api_key="mySecretKey123456") | ||
|
|
||
| # ruleid: mistral-hardcoded-api-key-python | ||
| client = MistralClient(api_key="mySecretKey123456") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/mistral-hardcoded-api-key/mistral-hardcoded-api-key-python.py:generic-api-key:8 >> .gitleaksignore
| const { OpenAI } = require("openai"); | ||
|
|
||
| // ruleid: openai-hardcoded-api-key-javascript | ||
| const client = new OpenAI({apiKey: "sk-1234567890abcdef"}); |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/openai-hardcoded-api-key/openai-hardcoded-api-key-javascript.js:generic-api-key:4 >> .gitleaksignore
| const client = new OpenAI({apiKey: "sk-1234567890abcdef"}); | ||
|
|
||
| // ruleid: openai-hardcoded-api-key-javascript | ||
| const client2 = new OpenAI({apiKey: "sk-proj-abc123"}); |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/openai-hardcoded-api-key/openai-hardcoded-api-key-javascript.js:generic-api-key:7 >> .gitleaksignore
| from openai import OpenAI, AsyncOpenAI | ||
|
|
||
| # ruleid: openai-hardcoded-api-key-python | ||
| client = OpenAI(api_key="sk-1234567890abcdef") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/openai-hardcoded-api-key/openai-hardcoded-api-key-python.py:generic-api-key:5 >> .gitleaksignore
| client = OpenAI(api_key="sk-1234567890abcdef") | ||
|
|
||
| # ruleid: openai-hardcoded-api-key-python | ||
| client = AsyncOpenAI(api_key="sk-proj-abc123") |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/openai-hardcoded-api-key/openai-hardcoded-api-key-python.py:generic-api-key:8 >> .gitleaksignore
| const { Mistral } = require("@mistralai/mistralai"); | ||
|
|
||
| // ruleid: mistral-hardcoded-api-key-javascript | ||
| const client = new Mistral({apiKey: "mySecretKey123456"}); |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/mistral-hardcoded-api-key/mistral-hardcoded-api-key-javascript.js:generic-api-key:4 >> .gitleaksignore
| "args": ["server.py"], | ||
| "env": { | ||
| // ruleid: mcp-hardcoded-config-secret-generic | ||
| "OPENAI_API_KEY": "sk-1234567890abcdef1234567890abcdef" |
There was a problem hiding this comment.
🛑 Gitleaks has detected a secret with rule-id generic-api-key in commit 1aafb3e.
If this secret is a true positive, please rotate the secret ASAP.
If this secret is a false positive, you can add the fingerprint below to your .gitleaksignore file and commit the change to this branch.
echo 1aafb3e7054ec095822c8783174b55b69fd9b483:apps/secure-semgrep/rules/ai/ai-best-practices/mcp-hardcoded-config-secret/mcp-hardcoded-config-secret.json:generic-api-key:8 >> .gitleaksignore
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write |
There was a problem hiding this comment.
Suggestion: Fork-originated pull requests receive read-only tokens, so this upload requiring security-events: write fails for the pull requests this workflow also processes. [api mismatch]
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** .github/workflows/semgrep.yml
**Line:** 13:13
**Comment:**
*Api Mismatch: Fork-originated pull requests receive read-only tokens, so this upload requiring `security-events: write` fails for the pull requests this workflow also processes.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
CodeAnt Nitpicks1 code suggestion1.
|
CodeAnt-AI Description
Publish Semgrep findings to GitHub Code Scanning and add Snyk scan tasks
What Changed
Impact
✅ Security findings visible in GitHub Code Scanning✅ Consistent Semgrep reports for pull requests and branch pushes✅ Dependency and source-code scans available through Snyk💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.