e2hln's picture
Update templates/index.html
a32544b verified
raw
history blame
13.8 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OWASP AIBOM Generator</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
line-height: 1.6;
color: #333;
background-color: #f9f9f9;
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 0 20px;
}
/* Header styling */
.header {
background-color: #ffffff;
padding: 15px 20px;
border-bottom: 1px solid #e9ecef;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30px;
}
.header-left {
display: flex;
align-items: center;
}
.header img {
height: 60px;
margin-right: 15px;
}
.header-content {
display: flex;
flex-direction: column;
}
.header h1 {
margin: 0;
font-size: 28px;
color: #2c3e50;
font-weight: 600;
margin-bottom: 5px;
}
.header-right {
display: flex;
gap: 10px;
}
.github-button {
display: inline-block;
padding: 12px 20px;
background-color: #3498db;
color: white;
text-decoration: none;
border-radius: 6px;
font-weight: 500;
font-size: 15px;
transition: background-color 0.3s;
}
.github-button:hover {
background-color: #2980b9;
color: white;
text-decoration: none;
}
/* Content styling */
.content-section {
background-color: #ffffff;
border-radius: 8px;
padding: 25px;
margin-bottom: 30px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.content-section h2 {
color: #2c3e50;
margin-top: 0;
margin-bottom: 20px;
font-size: 22px;
border-bottom: 2px solid #f0f0f0;
padding-bottom: 10px;
}
.content-section h3 {
color: #2c3e50;
margin-top: 0;
margin-bottom: 15px;
font-size: 18px;
}
.content-section p {
margin-bottom: 20px;
font-size: 16px;
line-height: 1.7;
color: #555;
}
/* Support section styling */
.support-section {
background-color: #f8f9fa;
border-left: 4px solid #6c757d;
padding: 20px;
margin: 30px 0;
border-radius: 8px;
text-align: center;
}
.support-section h3 {
margin-top: 0;
color: #495057;
margin-bottom: 15px;
}
.support-section p {
margin-bottom: 15px;
color: #6c757d;
}
/* Form styling */
.form-section {
background-color: #ffffff;
border-radius: 8px;
padding: 25px;
margin-bottom: 30px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.form-section p {
margin-bottom: 20px;
font-size: 16px;
color: #555;
}
form {
margin: 20px 0;
}
input[type="text"] {
padding: 12px;
border: 1px solid #ddd;
border-radius: 6px;
margin-right: 10px;
width: 350px;
font-size: 15px;
transition: border-color 0.3s;
}
input[type="text"]:focus {
border-color: #3498db;
outline: none;
box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}
button {
padding: 12px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 15px;
font-weight: 500;
transition: background-color 0.3s;
}
button:hover {
background-color: #2980b9;
}
/* Style for disabled button */
button:disabled {
background-color: #bdc3c7;
cursor: not-allowed;
}
code {
background-color: #f8f9fa;
padding: 2px 5px;
border-radius: 4px;
font-family: monospace;
font-size: 14px;
color: #e74c3c;
}
a {
color: #3498db;
text-decoration: none;
transition: color 0.3s;
}
a:hover {
color: #2980b9;
text-decoration: underline;
}
/* Footer styling */
.footer {
text-align: center;
padding: 20px;
color: #7f8c8d;
font-size: 14px;
margin-top: 30px;
}
/* Mobile responsiveness */
@media (max-width: 768px) {
.container {
padding: 0 15px;
}
.header {
flex-direction: column;
text-align: center;
padding: 15px;
}
.header-left {
margin-bottom: 15px;
}
.header img {
margin-bottom: 10px;
margin-right: 0;
}
form {
flex-direction: column !important;
align-items: stretch !important;
}
input[type="text"] {
width: 100% !important;
max-width: none !important;
margin-right: 0 !important;
margin-bottom: 15px;
}
button {
width: 100%;
}
}
</style>
<!-- Invisible Captcha v2 -->
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<!-- Header with logo and title -->
<div class="container">
<div class="header">
<div class="header-left">
<a href="https://genai.owasp.org/" target="_blank">
<img src="https://huggingface.co/spaces/GenAISecurityProject/OWASP-AIBOM-Generator/resolve/main/templates/images/OWASP_GenAI_Security_Project-logo.png" alt="OWASP GenAI Security Project logo">
</a>
<h1>OWASP AIBOM Generator</h1>
</div>
</div>
</div>
<div class="container">
<!-- Form Section (Moved to top) -->
<div class="form-section">
<h2>Generate AIBOM</h2>
<p>
Enter a model on Hugging Face, in a format <code>&lt;organization-or-username&gt;/&lt;model-name&gt;</code> (easy copy button), or model's URL, to generate AIBOM in CycloneDX format. You can browse available models in the <a href="https://huggingface.co/models" target="_blank" rel="noopener noreferrer">Hugging Face models repository</a>.
</p>
<form id="sbom-form" action="/generate" method="post" style="display: flex; flex-direction: row; align-items: center; width: 100%;">
<input type="text" name="model_id" placeholder="e.g., openai/whisper-tiny" required style="flex: 1; max-width: 70%; margin-right: 10px;">
<input type="hidden" name="g_recaptcha_response" id="g-recaptcha-response">
<button
class="g-recaptcha"
data-sitekey="6Ld57kcrAAAAAL7X-BF2EYLN5Adsom2VnFOnGsYR"
data-callback="onSubmit"
data-action="submit"
id="generate-button"
type="button">Generate AIBOM</button>
</form>
<div style="font-size: 12px; color: #777; margin-top: 10px;">
This site is protected by reCAPTCHA and the Google
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
</div>
</div>
<!-- Tool Description Section -->
<div class="content-section">
<h2>About This Tool</h2>
<p>This open-source tool generates AIBOM (AI Bill of Materials) for models hosted on Hugging Face. It automatically extracts and formats key information about AI models into a standardized, machine-readable SBOM (Software Bill of Materials) using the CycloneDX JSON format. Because metadata quality varies across models and much of the information is unstructured, the tool analyzes what is available, organizes it into a consistent structure, and provides an AIBOM completeness score that evaluates how well the model is documented. This helps users quickly understand documentation gaps and supports transparency, security, and compliance. The tool is also listed on <a href="hhttps://cyclonedx.org/tool-center/" target="_blank" rel="noopener noreferrer">CycloneDX Tool Center</a>.</p>
</div>
<!-- Introduction Section -->
<div class="content-section">
<h2>Understanding AIBOMs</h2>
<p>An AIBOM (Artificial Intelligence Bill of Materials, also known as AI/ML-BOM, AI SBOM, or SBOM for AI) is a detailed, structured inventory that lists the components and dependencies involved in building and operating an AI system—such as pre-trained models, datasets, libraries, and configuration parameters. Much like a traditional SBOM for software, an AIBOM brings transparency to what goes into an AI system, enabling organizations to assess security, compliance, and ethical risks. It is essential for managing AI supply chain risks, supporting regulatory requirements, ensuring model provenance, and enabling incident response and audits. As AI systems grow more complex and widely adopted, AIBOMs become critical for maintaining trust, accountability, and control over how AI technologies are developed, integrated, and deployed.</p>
</div>
<!-- Support Section -->
<div class="support-section">
<h3>🛠️ Support & Feedback</h3>
<p>If you encountered any problems, found a bug, or have suggestions for improvement, we'd love to hear from you!</p>
<a href="https://github.com/aetheris-ai/aibom-generator" target="_blank" class="github-button">
📋 View on GitHub
</a>
</div>
<!-- Social Section -->
<div class="content-section" style="text-align: center;">
<h3>🗣️ Help Us Spread the Word</h3>
<p>If you find this tool useful, share it with your network! <a href="https://genai.owasp.org" target="_blank" rel="noopener noreferrer">https://genai.owasp.org</a></p>
<a href="https://www.linkedin.com/sharing/share-offsite/?url=https://huggingface.co/spaces/GenAISecurityProject/OWASP-AIBOM-Generator" target="_blank" rel="noopener noreferrer" style="text-decoration: none;">
<button style="background-color: #0077b5;">🔗 Share on LinkedIn</button>
</a>
<p style="margin-top: 10px; font-size: 14px;">
Follow us for updates:
<a href="https://www.linkedin.com/company/owasp-top-10-for-large-language-model-applications/" target="_blank" rel="noopener noreferrer">@OWASP GenAI Security Project</a>
</p>
</div>
<!-- Info Section -->
<div class="content-section" style="text-align: center;">
<!-- Display the SBOM count -->
<div class="sbom-count">🚀 Generated AIBOMs using this tool: <strong>{{ sbom_count if sbom_count else 'N/A' }}</strong></div>
</div>
<!-- Footer -->
<div class="footer">
<p>© 2025 OWASP GenAI Security Project | OWASP AIBOM Generator</p>
</div>
</div>
<!-- JavaScript for loading indicator and Captcha -->
<script>
function onSubmit(token) {
console.log("reCAPTCHA callback executed with token:", token.substring(0, 10) + "...");
// Set the token in the hidden input
document.getElementById('g-recaptcha-response').value = token;
console.log("Token set in input:", document.getElementById('g-recaptcha-response').value.substring(0, 10) + "...");
// Disable button and change text
var button = document.getElementById('generate-button');
button.disabled = true;
button.textContent = 'Generating...';
// Submit the form
console.log("Submitting form");
document.getElementById('sbom-form').submit();
}
// Add Enter key support for form submission
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('input[name="model_id"]').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
e.preventDefault();
document.getElementById('generate-button').click();
}
});
});
</script>
</body>
</html>