Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added BLT Tomato (#2386) #2410

Merged
merged 19 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions blt/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
subscribe_to_domains,
vote_count,
weekly_report,
blt_tomato
)

favicon_view = RedirectView.as_view(url="/static/favicon.ico", permanent=True)
Expand Down Expand Up @@ -536,6 +537,7 @@
name="today-contributor-stats",
),
path("api/chatbot/conversation/", chatbot_conversation, name="chatbot_conversation"),
path("blt-tomato/", blt_tomato, name="blt-tomato"),
]

if settings.DEBUG:
Expand Down
122 changes: 122 additions & 0 deletions website/fixtures/blt_tomato_project_link.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[
{
"project_name": "O-Saft",
"repo_url": "https://github.com/OWASP/O-Saft",
"funding_url": "https://raw.githubusercontent.com/OWASP/O-Saft/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-o-saft&title=OWASP+O-Saft, OWASP"
},
{
"project_name": "OWASP-VWAD",
"repo_url": "https://github.com/OWASP/OWASP-VWAD",
"funding_url": "https://raw.githubusercontent.com/OWASP/OWASP-VWAD/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-vulnerable-web-applications-directory&title=OWASP+Vulnerable+Web+Applications+Directory"
},
{
"project_name": "ASVS",
"repo_url": "https://github.com/OWASP/ASVS",
"funding_url": "https://raw.githubusercontent.com/OWASP/ASVS/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-application-security-verification-standard&title=OWASP+Application+Security+Verification+Standard, OWASP"
},
{
"project_name": "ZSC",
"repo_url": "https://github.com/OWASP/ZSC",
"funding_url": "https://raw.githubusercontent.com/OWASP/ZSC/master/.github/FUNDING.yml",
"funding_details": "zdresearch"
},
{
"project_name": "Top10",
"repo_url": "https://github.com/OWASP/Top10",
"funding_url": "https://raw.githubusercontent.com/OWASP/Top10/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-top-ten&title=OWASP+Top+Ten, OWASP"
},
{
"project_name": "MAS",
"repo_url": "https://github.com/OWASP/owasp-masvs",
"funding_url": "https://raw.githubusercontent.com/OWASP/owasp-masvs/master/.github/FUNDING.yml",
"funding_details": "https://www.icrc.org/en/donate/ukraine"
},
{
"project_name": "owasp-mastg",
"repo_url": "https://github.com/OWASP/owasp-mastg",
"funding_url": "https://raw.githubusercontent.com/OWASP/owasp-mastg/master/.github/FUNDING.yml",
"funding_details": "https://www.icrc.org/en/donate/ukraine"
},
{
"project_name": "Nettacker",
"repo_url": "https://github.com/OWASP/Nettacker",
"funding_url": "https://raw.githubusercontent.com/OWASP/Nettacker/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-nettacker&title=OWASP+Nettacker"
},
{
"project_name": "wstg",
"repo_url": "https://github.com/OWASP/wstg",
"funding_url": "https://raw.githubusercontent.com/OWASP/wstg/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-web-security-testing-guide&title=OWASP+Web+Security+Testing+Guide, OWASP"
},
{
"project_name": "Python-Honeypot",
"repo_url": "https://github.com/OWASP/Python-Honeypot",
"funding_url": "https://raw.githubusercontent.com/OWASP/Python-Honeypot/master/.github/FUNDING.yml",
"funding_details": "zdresearch"
},
{
"project_name": "API-Security",
"repo_url": "https://github.com/OWASP/API-Security",
"funding_url": "https://raw.githubusercontent.com/OWASP/API-Security/master/.github/FUNDING.yml",
"funding_details": "OWASP, https://owasp.org/donate/?reponame=www-project-api-security&title=OWASP+API+Security+Project"
},
{
"project_name": "Intelligent-Intrusion-Detection-System",
"repo_url": "https://github.com/OWASP/Intelligent-Intrusion-Detection-System",
"funding_url": "https://raw.githubusercontent.com/OWASP/Intelligent-Intrusion-Detection-System/master/.github/FUNDING.yml",
"funding_details": "hardlyhuman, gsriharsha, https://www.paypal.me/SRIHARSHAGAJAVALLI"
},
{
"project_name": "owasp.github.io",
"repo_url": "https://github.com/OWASP/owasp.github.io",
"funding_url": "https://raw.githubusercontent.com/OWASP/owasp.github.io/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/"
},
{
"project_name": "Wrongsecrets",
"repo_url": "https://github.com/OWASP/wrongsecrets",
"funding_url": "https://raw.githubusercontent.com/OWASP/wrongsecrets/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-wrongsecrets&title=OWASP+wrongsecrets, https://www.icrc.org/en/donate/ukraine, OWASP"
},
{
"project_name": "wrongsecrets-binaries",
"repo_url": "https://github.com/OWASP/wrongsecrets-binaries",
"funding_url": "https://raw.githubusercontent.com/OWASP/wrongsecrets-binaries/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-wrongsecrets&title=OWASP+wrongsecrets"
},
{
"project_name": "wrongsecrets-ctf-party",
"repo_url": "https://github.com/OWASP/wrongsecrets-ctf-party",
"funding_url": "https://raw.githubusercontent.com/OWASP/wrongsecrets-ctf-party/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-wrongsecrets&title=OWASP+wrongsecrets, https://www.icrc.org/en/donate/ukraine, OWASP"
},
{
"project_name": "secure-coding-practices-quick-reference-guide",
"repo_url": "https://github.com/OWASP/secure-coding-practices-quick-reference-guide",
"funding_url": "https://raw.githubusercontent.com/OWASP/secure-coding-practices-quick-reference-guide/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate/?reponame=www-project-secure-coding-practices-quick-reference-guide&title=OWASP+Secure+Coding+Practices+Quick+Reference+Guide, OWASP"
},
{
"project_name": "BLT",
"repo_url": "https://github.com/OWASP-BLT/BLT",
"funding_url": "https://raw.githubusercontent.com/OWASP-BLT/BLT/master/.github/FUNDING.yml",
"funding_details": "https://owasp.org/donate?reponame=www-project-bug-logging-tool&title=OWASP+Bug+logging+tool"
},
{
"project_name": "Juice Shop",
"repo_url": "https://github.com/juice-shop/juice-shop",
"funding_url": "https://raw.githubusercontent.com/juice-shop/juice-shop/master/.github/FUNDING.yml",
"funding_details": "https://sponsor.owasp-juice.shop, OWASP"
},
{
"project_name": "ModSecurity Core Rule Set",
"repo_url": "https://github.com/coreruleset/coreruleset",
"funding_url": "https://raw.githubusercontent.com/coreruleset/coreruleset/master/.github/FUNDING.yml",
"funding_details": "https://coreruleset.org/donate"
}
]
49 changes: 49 additions & 0 deletions website/static/img/tomato-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions website/templates/blt_tomato.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% extends "base.html" %}
{% load static %}
{% block content %}
{% include "includes/sidenav.html" %}
<div class="min-h-screen flex flex-col mx-4 mt-5">
<h2 class="text-4xl font-semibold my-8 p-5 text-white rounded-md bg-[#d9534f]">BLT Tomato - This is an OWASP BLT project created to help other OWASP projects.</h2>
{% if data %}
nikhil25803 marked this conversation as resolved.
Show resolved Hide resolved
<p class="text-xl font-semibold mt-5">The following OWASP projects are seeking funding and have a funding.yml file:</p>
<ul class="text-2xl">
{% for project in data %}
nikhil25803 marked this conversation as resolved.
Show resolved Hide resolved
<li type="1" class=" my-2 py-2 px-4 shadow">
<p href="{{ item.repo_url }}" class="text-primary underline inline-block">{{ project.project_name }}</p>
<button class="bg-[#d9534f] ml-4 inline-block py-1 px-2 rounded text-white">
<a href="{{ project.funding_hyperlinks }}" target="_blank">
<span class="text-white">Donate</span>
</a>
</button>
<span class="ml-4">{{ project.funding_details }}</span>
</li>
{% endfor %}
</ul>

<!-- <ul>
nikhil25803 marked this conversation as resolved.
Show resolved Hide resolved
{% for project in data %}
<li>
<h2>{{ project.project_name }}</h2>
<p>Repository: <a href="{{ project.repo_url }}" target="_blank">{{ project.repo_url }}</a></p>
<p>Funding: {{ project.funding_hyperlinks|safe }}</p>
</li>
{% endfor %}
</ul> -->
nikhil25803 marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}
</div>
{% endblock content %}

<style>
.min-h-screen {
min-height: 100vh;
}
.shadow {
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.link-button {
background-color: #d9534f;
color: white;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
text-decoration: none;
}

.link-button:hover {
background-color: #c9302c;
}

.link-button:visited {
color: white;
}

</style>
10 changes: 10 additions & 0 deletions website/templates/includes/sidenav.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load static %}
<aside id="sidebar"
class="tracking-tight fixed top-0 left-0 z-40 w-[210px] h-screen pt-[70px] transition-transform -translate-x-full bg-white lg:translate-x-0 no-scrollbar"
aria-label="Sidebar">
Expand Down Expand Up @@ -210,6 +211,15 @@
<span>Stats</span>
</a>
</li>
<li class="{% if request.path == '/blt-tomato/' %}bg-gray-200{% endif %}">
<a href="{% url 'blt-tomato' %}" class="flex items-center w-full text-black no-underline p-2">
<div class="w-8 mr-4">
<img src="{% static 'img/tomato-svgrepo-com.svg' %}" width="100" height="100" alt="ant">
</div>
<span>BLT Tomato</span>
</a>
</li>

<li>
<div class="border-t-2 border-gray-200"></div>
</li>
Expand Down
21 changes: 21 additions & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from django.db.models.functions import ExtractMonth
from django.db.transaction import atomic
from django.dispatch import receiver
from django.utils.safestring import mark_safe
from django.http import (
Http404,
HttpRequest,
Expand Down Expand Up @@ -4710,3 +4711,23 @@ def weekly_report(request):
return HttpResponse("An error occurred while sending the weekly report")

return HttpResponse("Weekly report sent successfully.")

def blt_tomato(request):
current_dir = os.path.dirname(__file__)
json_file_path = os.path.join(current_dir, "fixtures", "blt_tomato_project_link.json")
nikhil25803 marked this conversation as resolved.
Show resolved Hide resolved

try:
with open(json_file_path, "r") as json_file:
data = json.load(json_file)
except Exception:
data = []

for project in data:
funding_details = project.get("funding_details", "").split(", ")
funding_links = [
url.strip() for url in funding_details if url.startswith("https://")
]
funding_link = funding_links[0] if funding_links else "#"
project["funding_hyperlinks"] = funding_link

return render(request, "blt_tomato.html", {"data": data})
Loading