Skip to content

Commit dec285e

Browse files
Initialize alert-autofix-2
0 parents  commit dec285e

File tree

618 files changed

+193547
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

618 files changed

+193547
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python 3.12
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.12"
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
23+
- name: Test with pytest
24+
run: |
25+
PYTHONPATH=src pytest
26+
- name: Bandit Security Scan
27+
run: |
28+
pip install bandit
29+
bandit -r . -c pyproject.toml

.github/workflows/codeql.yml

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
name: "Advanced CodeQL + AI Security Analysis"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '17 17 * * 5'
10+
11+
jobs:
12+
codeql-analysis:
13+
name: CodeQL Analysis
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
actions: read
18+
contents: read
19+
packages: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: python
26+
build-mode: none
27+
- language: javascript-typescript
28+
build-mode: none
29+
- language: cpp
30+
build-mode: manual
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 2
37+
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v3
40+
with:
41+
languages: ${{ matrix.language }}
42+
build-mode: ${{ matrix.build-mode }}
43+
queries: security-extended,security-and-quality
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v3
47+
with:
48+
category: "language:${{ matrix.language }}"
49+
50+
ai-security-scan:
51+
name: AI-Powered Security Scan
52+
runs-on: ubuntu-latest
53+
needs: codeql-analysis
54+
permissions:
55+
security-events: write
56+
contents: read
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
- name: Setup Python
63+
uses: actions/setup-python@v4
64+
with:
65+
python-version: '3.10'
66+
67+
- name: Install dependencies
68+
env:
69+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
70+
run: |
71+
python -m pip install --upgrade pip
72+
pip install -r requirements.txt
73+
pip install httpx_ntlm beautifulsoup4
74+
echo "GEMINI_API_KEY=$GEMINI_API_KEY" >> $GITHUB_ENV
75+
if [ -n "${{ secrets.OPENAI_API_KEY }}" ]; then
76+
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
77+
else
78+
echo "Warning: OPENAI_API_KEY secret is not set." >&2
79+
fi
80+
81+
- name: Run AI-powered security scan
82+
run: |
83+
bughunter-cli ai scan-repo . \
84+
--gemini \
85+
--chatgpt \
86+
--output ai-report.json
87+
88+
# Generate human-readable report
89+
bughunter-cli ai generate-report ai-report.json --format markdown > ai-security-report.md
90+
91+
- name: Upload AI security report
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ai-security-report
95+
path: ai-security-report.md
96+
97+
- name: Upload SARIF for GitHub Security
98+
run: |
99+
# Convert AI findings to SARIF format
100+
bughunter-cli utils ai-to-sarif ai-report.json -o ai-scan.sarif
101+
if: always()
102+
103+
- name: Upload SARIF results
104+
uses: github/codeql-action/upload-sarif@v3
105+
with:
106+
sarif_file: ai-scan.sarif
107+
if: always()
108+
109+
ai-vulnerability-analysis:
110+
name: AI Vulnerability Analysis
111+
runs-on: ubuntu-latest
112+
needs: [codeql-analysis, ai-security-scan]
113+
steps:
114+
- name: Download CodeQL results
115+
uses: actions/download-artifact@v3
116+
with:
117+
name: codeql-sarif
118+
path: codeql-results
119+
120+
- name: Download AI results
121+
uses: actions/download-artifact@v3
122+
with:
123+
name: ai-security-report
124+
path: ai-results
125+
126+
- name: Combine and analyze results
127+
run: |
128+
pip install jq
129+
130+
# Combine CodeQL and AI results
131+
jq -s '.[0].runs + .[1].runs' \
132+
codeql-results/codeql.sarif \
133+
ai-results/ai-scan.sarif > combined.sarif
134+
135+
# AI-powered triage and prioritization
136+
bughunter-cli ai triage combined.sarif \
137+
--gemini \
138+
--output prioritized-findings.json
139+
140+
# Generate executive report
141+
bughunter-cli ai generate-report prioritized-findings.json \
142+
--format markdown > executive-report.md
143+
144+
- name: Upload Executive Report
145+
uses: actions/upload-artifact@v4
146+
with:
147+
name: security-executive-report
148+
path: executive-report.md
149+
150+
- name: Create Security Summary
151+
uses: actions/github-script@v6
152+
with:
153+
script: |
154+
const fs = require('fs');
155+
const report = fs.readFileSync('executive-report.md', 'utf8');
156+
157+
await github.rest.issues.createComment({
158+
issue_number: context.issue.number,
159+
owner: context.repo.owner,
160+
repo: context.repo.repo,
161+
body: `## AI Security Analysis Summary\n\n${report}`
162+
});
163+
if: github.event_name == 'pull_request'
164+
165+
container-scan:
166+
name: Container Security Scan
167+
runs-on: ubuntu-latest
168+
needs: codeql-analysis
169+
steps:
170+
- name: Checkout repository
171+
uses: actions/checkout@v4
172+
173+
- name: Set up Docker Buildx
174+
uses: docker/setup-buildx-action@v2
175+
176+
- name: Build Docker image
177+
run: docker build -t app-image .
178+
179+
- name: Scan container with AI
180+
run: |
181+
docker save app-image -o app.tar
182+
bughunter-cli ai scan-container app.tar \
183+
--gemini \
184+
--output container-scan.json
185+
186+
bughunter-cli ai generate-report container-scan.json \
187+
--format markdown > container-report.md
188+
189+
- name: Upload Container Report
190+
uses: actions/upload-artifact@v4
191+
with:
192+
name: container-security-report
193+
path: container-report.md
194+
195+
dependency-scan:
196+
name: Dependency Vulnerability Scan
197+
runs-on: ubuntu-latest
198+
steps:
199+
- name: Checkout repository
200+
uses: actions/checkout@v4
201+
202+
- name: Set up Python
203+
uses: actions/setup-python@v4
204+
with:
205+
python-version: '3.10'
206+
207+
- name: Install dependencies
208+
run: pip install safety
209+
210+
- name: Scan Python dependencies
211+
run: safety check --json > dependency-scan.json
212+
213+
- name: Upload results
214+
uses: actions/upload-artifact@v4
215+
with:
216+
name: dependency-scan-results
217+
path: dependency-scan.json

.github/workflows/osv-scanner.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# A sample workflow which sets up periodic OSV-Scanner scanning for vulnerabilities,
7+
# in addition to a PR check which fails if new vulnerabilities are introduced.
8+
#
9+
# For more examples and options, including how to ignore specific vulnerabilities,
10+
# see https://google.github.io/osv-scanner/github-action/
11+
12+
name: OSV-Scanner
13+
14+
on:
15+
pull_request:
16+
branches: [ "main" ]
17+
merge_group:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '19 10 * * 3'
21+
push:
22+
branches: [ "main" ]
23+
24+
permissions:
25+
# Require writing security events to upload SARIF file to security tab
26+
security-events: write
27+
# Read commit contents
28+
contents: read
29+
30+
jobs:
31+
scan-scheduled:
32+
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
33+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@1f1242919d8a60496dd1874b24b62b2370ed4c78" # v1.7.1
34+
with:
35+
# Example of specifying custom arguments
36+
scan-args: |-
37+
-r
38+
--skip-git
39+
./
40+
scan-pr:
41+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
42+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@1f1242919d8a60496dd1874b24b62b2370ed4c78" # v1.7.1
43+
with:
44+
# Example of specifying custom arguments
45+
scan-args: |-
46+
-r
47+
--skip-git
48+
./

.github/workflows/security.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Security Audit
2+
on: [push, pull_request]
3+
4+
jobs:
5+
dependency-check:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Check dependencies
10+
run: |
11+
pip install safety
12+
safety check --full-report

0 commit comments

Comments
 (0)