Skip to content

Commit d458887

Browse files
authored
Merge branch 'main' into copilot/add-peer-review-check-action
2 parents e61c544 + efa8879 commit d458887

39 files changed

+1461
-553
lines changed

.github/workflows/add-files-changed-label.yml

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- name: Add Files Changed Label
2121
env:
22-
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
22+
GITHUB_TOKEN: ${{ github.token }}
2323
PR_NUMBER: ${{ github.event.pull_request.number }}
2424
REPO_OWNER: ${{ github.repository_owner }}
2525
REPO_NAME: ${{ github.event.repository.name }}
@@ -42,9 +42,10 @@ jobs:
4242
-H "Accept: application/vnd.github.v3+json" \
4343
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER/files")
4444
45-
# Check if the API request was successful
46-
if [[ "$FILES_API_RESPONSE" == *"message"*"Not Found"* ]] || [[ "$FILES_API_RESPONSE" == *"Resource not accessible by integration"* ]]; then
47-
echo "Error: Could not fetch PR files. Response: $FILES_API_RESPONSE"
45+
# Check if the API request was successful by verifying it's a valid array
46+
if ! echo "$FILES_API_RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then
47+
echo "Error: Could not fetch PR files. The API response was not a valid array."
48+
echo "This could indicate an authentication issue or the PR may not exist."
4849
exit 1
4950
fi
5051
@@ -88,7 +89,9 @@ jobs:
8889
if echo "$ALL_LABELS_RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then
8990
ALL_REPO_LABELS=$(echo "$ALL_LABELS_RESPONSE" | jq -r '.[].name')
9091
else
91-
echo "Error: Failed to fetch repository labels. Response: $ALL_LABELS_RESPONSE"
92+
ERROR_MSG=$(echo "$ALL_LABELS_RESPONSE" | jq -r '.message // empty' 2>/dev/null || echo "Invalid response")
93+
ERROR_MSG="${ERROR_MSG:-Invalid response}"
94+
echo "Error: Failed to fetch repository labels. Error: $ERROR_MSG"
9295
exit 1
9396
fi
9497
@@ -101,17 +104,20 @@ jobs:
101104
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/labels" \
102105
-d "{\"name\":\"$LABEL\",\"color\":\"$LABEL_COLOR\",\"description\":\"$DESCRIPTION\"}")
103106
104-
# Check if label creation was successful
105-
if [[ "$CREATE_LABEL_RESPONSE" == *"message"* ]]; then
106-
echo "Warning: There might be an issue creating the label. Response: $CREATE_LABEL_RESPONSE"
107+
# Check if label creation was successful (successful response has "name" field)
108+
if echo "$CREATE_LABEL_RESPONSE" | jq -e 'has("name")' > /dev/null 2>&1; then
109+
echo "Label '$LABEL' created successfully."
110+
else
111+
ERROR_MSG=$(echo "$CREATE_LABEL_RESPONSE" | jq -r '.message // empty' 2>/dev/null || echo "Invalid response")
112+
ERROR_MSG="${ERROR_MSG:-Invalid response}"
113+
echo "Warning: There might be an issue creating the label. Error: $ERROR_MSG"
107114
108115
# Provide more detailed guidance for permission errors
109-
if [[ "$CREATE_LABEL_RESPONSE" == *"Resource not accessible by integration"* ]]; then
116+
if [[ "$ERROR_MSG" == *"Resource not accessible by integration"* ]]; then
110117
echo "This appears to be a permissions issue with creating labels."
111-
echo "Please check the .github/README.md file for instructions on setting up a CUSTOM_GITHUB_TOKEN with proper permissions."
118+
echo "The workflow has been configured with appropriate permissions (pull-requests: write, issues: write)."
119+
echo "If this error persists, please check the repository settings."
112120
fi
113-
else
114-
echo "Label '$LABEL' created successfully."
115121
fi
116122
else
117123
echo "Label '$LABEL' already exists in the repository."
@@ -128,7 +134,9 @@ jobs:
128134
if echo "$PR_LABELS_RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then
129135
EXISTING_LABELS=$(echo "$PR_LABELS_RESPONSE" | jq -r '.[].name')
130136
else
131-
echo "Error: Failed to fetch PR labels. Response: $PR_LABELS_RESPONSE"
137+
ERROR_MSG=$(echo "$PR_LABELS_RESPONSE" | jq -r '.message // empty' 2>/dev/null || echo "Invalid response")
138+
ERROR_MSG="${ERROR_MSG:-Invalid response}"
139+
echo "Error: Failed to fetch PR labels. Error: $ERROR_MSG"
132140
exit 1
133141
fi
134142
@@ -149,7 +157,9 @@ jobs:
149157
if [[ "$REMOVE_RESPONSE" == "" ]]; then
150158
echo "Successfully removed label: $EXISTING_LABEL"
151159
else
152-
echo "Warning: There might be an issue removing the label. Response: $REMOVE_RESPONSE"
160+
ERROR_MSG=$(echo "$REMOVE_RESPONSE" | jq -r '.message // empty' 2>/dev/null || echo "Invalid response")
161+
ERROR_MSG="${ERROR_MSG:-Invalid response}"
162+
echo "Warning: There might be an issue removing the label. Error: $ERROR_MSG"
153163
fi
154164
fi
155165
done
@@ -166,21 +176,20 @@ jobs:
166176
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/issues/$PR_NUMBER/labels" \
167177
-d "{\"labels\":[\"$LABEL\"]}")
168178
169-
# Check if label was added successfully
170-
if [[ "$ADD_LABEL_RESPONSE" == *"message"* ]]; then
171-
echo "Error: Failed to add label. Response: $ADD_LABEL_RESPONSE"
179+
# Check if label was added successfully (successful response is an array)
180+
if echo "$ADD_LABEL_RESPONSE" | jq -e 'type == "array"' > /dev/null 2>&1; then
181+
echo "Successfully applied label '$LABEL' to PR #$PR_NUMBER"
182+
else
183+
ERROR_MSG=$(echo "$ADD_LABEL_RESPONSE" | jq -r '.message // empty' 2>/dev/null || echo "Invalid response")
184+
ERROR_MSG="${ERROR_MSG:-Invalid response}"
185+
echo "Error: Failed to add label. Error: $ERROR_MSG"
172186
173-
# Check if it's a permissions issue and suggest using a custom token
174-
if [[ "$ADD_LABEL_RESPONSE" == *"Resource not accessible by integration"* ]]; then
175-
echo "This appears to be a permissions issue. Please follow these steps:"
176-
echo "1. Create a Personal Access Token (PAT) with 'repo' scope"
177-
echo "2. Add the token to your repository secrets as CUSTOM_GITHUB_TOKEN"
178-
echo "3. See the .github/README.md file for detailed instructions on setting up the token"
179-
echo ""
180-
echo "Note: The workflow is configured to use CUSTOM_GITHUB_TOKEN if available, falling back to GITHUB_TOKEN"
187+
# Check if it's a permissions issue
188+
if [[ "$ERROR_MSG" == *"Resource not accessible by integration"* ]]; then
189+
echo "This appears to be a permissions issue."
190+
echo "The workflow has been configured with appropriate permissions (pull-requests: write, issues: write)."
191+
echo "If this error persists, please verify the repository settings allow workflow actions."
181192
fi
182193
183194
exit 1
184-
else
185-
echo "Successfully applied label '$LABEL' to PR #$PR_NUMBER"
186195
fi

.github/workflows/autoupdate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
autoupdate:
1212
name: autoupdate
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
steps:
1515
- uses: docker://chinthakagodawita/autoupdate-action:v1
1616
env:

.github/workflows/enforce-issue-number-in-description.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ jobs:
2020
github.actor != 'dependabot[bot]'
2121
&& github.actor != 'dependabot-preview[bot]'
2222
&& github.actor != 'dependabot'
23-
&& github.actor != github.repository_owner
2423
&& github.actor != 'sentry-autofix'
2524
&& github.actor != 'DonnieBLT'
25+
&& github.actor != 'Copilot'
26+
&& github.actor != 'copilot-swe-agent[bot]'
27+
&& github.actor != 'copilot-swe-agent'
2628
steps:
2729
- name: Validate PR closing issues with GraphQL
2830
env:

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ RUN apt-get update && \
2020
# chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver && \
2121
# ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver
2222

23-
# Install Google Chrome
24-
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
25-
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
26-
apt-get -yqq update && \
27-
apt-get -yqq install google-chrome-stable && \
23+
# Install Chromium (works on all architectures)
24+
RUN apt-get update && \
25+
apt-get install -y chromium && \
26+
ln -sf /usr/bin/chromium /usr/local/bin/google-chrome && \
2827
rm -rf /var/lib/apt/lists/*
2928

30-
RUN ln -s /usr/bin/google-chrome-stable /usr/local/bin/google-chrome
31-
3229
# Install Poetry and dependencies
3330
RUN pip install poetry
3431
RUN poetry config virtualenvs.create false

README.md

Lines changed: 152 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,148 @@
1-
<h1 align="center"> OWASP BLT </h1>
1+
<h1 align="center"> 🐛 OWASP BLT </h1>
2+
<h3 align="center">Bug Logging Tool - Democratizing Bug Bounties</h3>
23

4+
<p align="center">
5+
<strong>A community-driven platform for discovering, reporting, and tracking security vulnerabilities</strong>
6+
</p>
37

4-
<p align="center"><a href="https://github.com/OWASP/BLT/actions" rel="noopener noreferrer" target="__blank"><img alt="Build" src="https://github.com/OWASP/BLT/actions/workflows/auto-merge.yml/badge.svg"></a> <a href="https://github.com/OWASP/BLT/blob/main/LICENSE.md" rel="noopener noreferrer"><img src="https://img.shields.io/badge/license-AGPL--3.0-blue"></a>
5-
<a href="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/OWASP/BLT" rel="noopener noreferrer" target="__blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/OWASP/BLT?style=social"></a></p>
8+
<p align="center">
9+
<a href="https://owaspblt.org">🌐 Website</a> •
10+
<a href="https://github.com/OWASP-BLT/BLT/blob/main/CONTRIBUTING.md">📖 Contributing Guide</a> •
11+
<a href="https://owasp.org/slack/invite">💬 Join Slack</a> •
12+
<a href="https://github.com/OWASP-BLT/BLT/issues">🐛 Report Bug</a>
13+
</p>
614

7-
<img alt="Views" src="https://owaspblt.org/repos/blt/badge/">
15+
---
816

9-
Everything is on our <a href="https://owaspblt.org">homepage</a>
17+
## 📊 Project Stats
1018

11-
## Star History
19+
<p align="center">
20+
<a href="https://github.com/OWASP-BLT/BLT/actions">
21+
<img src="https://github.com/OWASP-BLT/BLT/actions/workflows/auto-merge.yml/badge.svg" alt="Build Status">
22+
</a>
23+
<a href="https://github.com/OWASP-BLT/BLT/blob/main/LICENSE.md">
24+
<img src="https://img.shields.io/badge/license-AGPL--3.0-blue" alt="License">
25+
</a>
26+
<a href="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/OWASP-BLT/BLT">
27+
<img src="https://img.shields.io/github/stars/OWASP-BLT/BLT?style=social" alt="GitHub stars">
28+
</a>
29+
</p>
30+
31+
<p align="center">
32+
<a href="https://github.com/OWASP-BLT/BLT/graphs/contributors">
33+
<img src="https://img.shields.io/github/contributors/OWASP-BLT/BLT?color=%23e74c3c" alt="Contributors">
34+
</a>
35+
<a href="https://github.com/OWASP-BLT/BLT/commits/main">
36+
<img src="https://img.shields.io/github/last-commit/OWASP-BLT/BLT?color=%23e74c3c" alt="Last Commit">
37+
</a>
38+
<a href="https://github.com/OWASP-BLT/BLT/issues">
39+
<img src="https://img.shields.io/github/issues/OWASP-BLT/BLT?color=%23e74c3c" alt="Open Issues">
40+
</a>
41+
<a href="https://github.com/OWASP-BLT/BLT/pulls">
42+
<img src="https://img.shields.io/github/issues-pr/OWASP-BLT/BLT?color=%23e74c3c" alt="Pull Requests">
43+
</a>
44+
</p>
45+
46+
<p align="center">
47+
<a href="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/OWASP-BLT/BLT">
48+
<img src="https://img.shields.io/github/languages/top/OWASP-BLT/BLT?color=%23e74c3c" alt="Top Language">
49+
</a>
50+
<a href="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/OWASP-BLT/BLT">
51+
<img src="https://img.shields.io/github/repo-size/OWASP-BLT/BLT?color=%23e74c3c" alt="Repo Size">
52+
</a>
53+
<a href="https://github.com/OWASP-BLT/BLT/fork">
54+
<img src="https://img.shields.io/github/forks/OWASP-BLT/BLT?style=social" alt="Forks">
55+
</a>
56+
<img src="https://owaspblt.org/repos/blt/badge/" alt="Views">
57+
</p>
58+
59+
---
60+
61+
## 🎯 What is OWASP BLT?
62+
63+
**OWASP BLT (Bug Logging Tool)** is an open-source platform that democratizes bug bounties and security research. Built by the community for the community, BLT makes it easy for security researchers, developers, and organizations to collaborate on finding and fixing security vulnerabilities.
64+
65+
### ✨ Key Features
66+
67+
- 🔍 **Bug Discovery & Reporting** - Discover and report security vulnerabilities across various applications and websites
68+
- 🏆 **Rewards & Recognition** - Earn rewards, badges, and recognition for your contributions to web security
69+
- 👥 **Community Driven** - Join a vibrant community of security researchers and developers
70+
- 🎮 **Gamification** - Leaderboards, challenges, and competitions to make security research engaging
71+
- 💰 **Staking System** - Innovative blockchain-based reward system for contributors
72+
- 📊 **Comprehensive Dashboard** - Track your progress, statistics, and impact
73+
- 🌐 **Open Source** - Built with transparency and collaboration at its core
74+
- 🛡️ **OWASP Project** - Part of the Open Worldwide Application Security Project family
75+
76+
---
77+
78+
## 🚀 Quick Start
79+
80+
### Prerequisites
81+
- Python 3.11.2+
82+
- PostgreSQL
83+
- Docker & Docker Compose (recommended)
84+
85+
### Installation
86+
87+
#### Using Docker (Recommended)
88+
```bash
89+
# Clone the repository
90+
git clone https://github.com/OWASP-BLT/BLT.git
91+
cd BLT
92+
93+
# Configure environment
94+
cp .env.example .env
95+
96+
# Build and start
97+
docker-compose build
98+
docker-compose up
99+
```
100+
101+
Access the application at **http://localhost:8000**
102+
103+
#### Using Poetry
104+
```bash
105+
# Install dependencies
106+
pip install poetry
107+
poetry shell
108+
poetry install
109+
110+
# Set up database
111+
python manage.py migrate
112+
python manage.py loaddata website/fixtures/initial_data.json
113+
python manage.py createsuperuser
114+
115+
# Run the server
116+
python manage.py runserver
117+
```
118+
119+
For detailed setup instructions, see our [Contributing Guide](https://github.com/OWASP-BLT/BLT/blob/main/CONTRIBUTING.md).
120+
121+
---
122+
123+
## 🤝 Contributing
124+
125+
We welcome contributions from everyone! Whether you're fixing bugs, adding features, improving documentation, or spreading the word, your help is appreciated.
126+
127+
- 📚 Read our [Contributing Guide](https://github.com/OWASP-BLT/BLT/blob/main/CONTRIBUTING.md)
128+
- 🐛 Check out [open issues](https://github.com/OWASP-BLT/BLT/issues)
129+
- 💡 Look for issues tagged with `good first issue` if you're new
130+
- 🎨 Follow our coding standards (Black, isort, ruff)
131+
- ✅ Run `pre-commit` before submitting changes
132+
133+
---
134+
135+
## 💬 Community & Support
136+
137+
- 🌐 **Website**: [owaspblt.org](https://owaspblt.org)
138+
- 💬 **Slack**: [Join OWASP Slack](https://owasp.org/slack/invite)
139+
- 🐦 **Twitter**: [@OWASP_BLT](https://twitter.com/OWASP_BLT)
140+
- 💰 **Sponsor**: [Support the project](https://github.com/sponsors/OWASP-BLT)
141+
- 📧 **Contact**: Reach out through GitHub issues
142+
143+
---
144+
145+
## 📈 Star History
12146

13147
<a href="https://star-history.com/#OWASP-BLT/BLT&Date">
14148
<picture>
@@ -18,3 +152,15 @@ Everything is on our <a href="https://owaspblt.org">homepage</a>
18152
</picture>
19153
</a>
20154

155+
---
156+
157+
## 📄 License
158+
159+
This project is licensed under the **AGPL-3.0 License** - see the [LICENSE.md](LICENSE.md) file for details.
160+
161+
---
162+
163+
<p align="center">
164+
<strong>⭐ Star this repository if you find it helpful!</strong><br>
165+
Made with ❤️ by the OWASP BLT Community
166+
</p>

blt/middleware/throttling.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import sys
32

43
from django.conf import settings
54
from django.core.cache import cache
@@ -49,7 +48,7 @@ def __call__(self, request):
4948
def should_skip_throttle(self, request):
5049
"""Check if request should be exempt from throttling."""
5150
# Skip throttling during tests
52-
if "test" in sys.argv:
51+
if getattr(settings, "IS_TEST", False) or getattr(settings, "TESTING", False):
5352
logger.debug("Skipping throttling for test mode")
5453
return True
5554
if any(request.path.startswith(p) for p in self.EXEMPT_PATHS):

blt/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@
318318
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage",
319319
},
320320
}
321-
DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
322321
# Removed DEBUG override - DEBUG should be controlled by environment variable
323322

324323
# use this to debug emails locally

blt/urls.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,8 @@
9393
badge_list,
9494
check_owasp_compliance,
9595
donate_view,
96-
facebook_callback,
9796
features_view,
9897
find_key,
99-
github_callback,
100-
google_callback,
10198
home,
10299
management_commands,
103100
robots_txt,
@@ -391,12 +388,12 @@
391388
path("accounts/", include("allauth.urls")),
392389
path("accounts/delete/", UserDeleteView.as_view(), name="user_deletion"),
393390
path("auth/github/", GithubLogin.as_view(), name="github_login"),
394-
path("accounts/github/login/callback/", github_callback, name="github_callback"),
391+
path("accounts/github/login/callback/", github_views.oauth2_callback, name="github_callback"),
395392
re_path(r"^auth/github/connect/$", GithubConnect.as_view(), name="github_connect"),
396393
path("auth/github/url/", github_views.oauth2_login),
397394
path("auth/google/", GoogleLogin.as_view(), name="google_login"),
398-
path("accounts/google/login/callback/", google_callback, name="google_callback"),
399-
path("accounts/facebook/login/callback/", facebook_callback, name="facebook_callback"),
395+
path("accounts/google/login/callback/", google_views.oauth2_callback, name="google_callback"),
396+
path("accounts/facebook/login/callback/", facebook_views.oauth2_callback, name="facebook_callback"),
400397
re_path(r"^auth/facebook/connect/$", FacebookConnect.as_view(), name="facebook_connect"),
401398
re_path(r"^auth/google/connect/$", GoogleConnect.as_view(), name="google_connect"),
402399
path("auth/github/url/", github_views.oauth2_login),

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
db:
3-
image: postgres
3+
image: postgres:17.6
44
ports:
55
- "${POSTGRES_PORT}:5432"
66
volumes:

0 commit comments

Comments
 (0)