Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- index.html +224 -517
index.html
CHANGED
|
@@ -1,49 +1,16 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
-
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
-
<
|
| 8 |
-
<
|
| 9 |
-
<meta name="robots" content="noindex, nofollow, noarchive">
|
| 10 |
-
<!-- Enhanced Security Headers -->
|
| 11 |
-
<meta http-equiv="Content-Security-Policy"
|
| 12 |
-
content="default-src 'none'; script-src 'self' 'nonce-EDNnf03nceIOfn39fn3e9h3sdfa' https://cdn.jsdelivr.net; style-src 'self' 'nonce-EDNnf03nceIOfn39fn3e9h3sdfa' https://fonts.googleapis.com; img-src 'self' data:; font-src 'self' https://fonts.gstatic.com; connect-src 'self'; frame-src 'none'; object-src 'none'; base-uri 'self'; form-action 'self'; manifest-src 'self'; worker-src 'self'; prefetch-src 'self';">
|
| 13 |
-
<meta http-equiv="Strict-Transport-Security" content="max-age=63072000; includeSubDomains; preload">
|
| 14 |
-
<meta http-equiv="X-Content-Type-Options" content="nosniff">
|
| 15 |
-
<meta http-equiv="X-Frame-Options" content="DENY">
|
| 16 |
-
<meta http-equiv="X-XSS-Protection" content="0">
|
| 17 |
-
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin">
|
| 18 |
-
<meta http-equiv="Permissions-Policy"
|
| 19 |
-
content="geolocation=(), microphone=(), camera=(), payment=(), usb=(), vr=(), accelerometer=(), gyroscope=(), magnetometer=(), fullscreen=(self)">
|
| 20 |
-
<meta http-equiv="Expect-CT" content="max-age=86400, enforce">
|
| 21 |
-
<meta http-equiv="Feature-Policy" content="autoplay 'none'; document-write 'none'; sync-xhr 'none'">
|
| 22 |
-
<meta name="theme-color" content="#2c3e50">
|
| 23 |
-
<title>Ultra-Secure IP Workstation | Built with anycoder</title>
|
| 24 |
-
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"
|
| 25 |
-
as="style" onload="this.onload=null;this.rel='stylesheet'">
|
| 26 |
-
<noscript>
|
| 27 |
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap">
|
| 28 |
-
</noscript>
|
| 29 |
-
<link rel="preload" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" as="style"
|
| 30 |
-
onload="this.onload=null;this.rel='stylesheet'">
|
| 31 |
-
<noscript>
|
| 32 |
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
|
| 33 |
-
</noscript>
|
| 34 |
-
<style nonce="EDNnf03nceIOfn39fn3e9h3sdfa">
|
| 35 |
:root {
|
| 36 |
-
--primary
|
| 37 |
-
--secondary
|
| 38 |
-
--accent
|
| 39 |
-
--
|
| 40 |
-
--
|
| 41 |
-
--success-color: #27ae60;
|
| 42 |
-
--warning-color: #f39c12;
|
| 43 |
-
--danger-color: #e74c3c;
|
| 44 |
-
--border-radius: 8px;
|
| 45 |
-
--box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 46 |
-
--transition: all 0.3s ease;
|
| 47 |
}
|
| 48 |
|
| 49 |
* {
|
|
@@ -53,557 +20,297 @@
|
|
| 53 |
}
|
| 54 |
|
| 55 |
body {
|
| 56 |
-
font-family: '
|
|
|
|
|
|
|
| 57 |
line-height: 1.6;
|
| 58 |
-
|
| 59 |
-
background-color: var(--light-color);
|
| 60 |
-
min-height: 100vh;
|
| 61 |
-
display: flex;
|
| 62 |
-
flex-direction: column;
|
| 63 |
}
|
| 64 |
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
padding: 1rem 2rem;
|
| 69 |
-
box-shadow: var(--box-shadow);
|
| 70 |
-
position: sticky;
|
| 71 |
-
top: 0;
|
| 72 |
-
z-index: 1000;
|
| 73 |
}
|
| 74 |
|
| 75 |
-
|
| 76 |
display: flex;
|
| 77 |
justify-content: space-between;
|
| 78 |
align-items: center;
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
}
|
| 83 |
|
| 84 |
.logo {
|
| 85 |
font-size: 1.5rem;
|
| 86 |
-
font-weight:
|
| 87 |
-
text-decoration: none;
|
| 88 |
-
color: white;
|
| 89 |
-
display: flex;
|
| 90 |
-
align-items: center;
|
| 91 |
-
gap: 0.5rem;
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
.logo-icon {
|
| 95 |
-
font-size: 1.8rem;
|
| 96 |
}
|
| 97 |
|
| 98 |
.anycoder-link {
|
| 99 |
-
color: var(--
|
| 100 |
text-decoration: none;
|
| 101 |
-
font-size: 0.9rem;
|
| 102 |
-
transition: var(--transition);
|
| 103 |
}
|
| 104 |
|
| 105 |
.anycoder-link:hover {
|
| 106 |
-
color: white;
|
| 107 |
text-decoration: underline;
|
| 108 |
}
|
| 109 |
|
| 110 |
-
.
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
}
|
| 114 |
-
|
| 115 |
-
.nav-link {
|
| 116 |
-
color: white;
|
| 117 |
-
text-decoration: none;
|
| 118 |
-
font-weight: 500;
|
| 119 |
-
transition: var(--transition);
|
| 120 |
-
padding: 0.5rem 1rem;
|
| 121 |
-
border-radius: var(--border-radius);
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
.nav-link:hover {
|
| 125 |
-
background-color: rgba(255, 255, 255, 0.1);
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
.nav-link.active {
|
| 129 |
-
background-color: var(--secondary-color);
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
.hamburger {
|
| 133 |
-
display: none;
|
| 134 |
-
background: none;
|
| 135 |
-
border: none;
|
| 136 |
-
color: white;
|
| 137 |
-
font-size: 1.5rem;
|
| 138 |
-
cursor: pointer;
|
| 139 |
-
}
|
| 140 |
-
|
| 141 |
-
main {
|
| 142 |
-
flex: 1;
|
| 143 |
-
max-width: 1200px;
|
| 144 |
-
margin: 2rem auto;
|
| 145 |
-
padding: 0 1rem;
|
| 146 |
-
width: 100%;
|
| 147 |
-
}
|
| 148 |
-
|
| 149 |
-
.security-card {
|
| 150 |
-
background-color: white;
|
| 151 |
-
border-radius: var(--border-radius);
|
| 152 |
-
box-shadow: var(--box-shadow);
|
| 153 |
padding: 2rem;
|
| 154 |
margin-bottom: 2rem;
|
|
|
|
| 155 |
}
|
| 156 |
|
| 157 |
-
|
| 158 |
-
color: var(--
|
| 159 |
margin-bottom: 1rem;
|
| 160 |
-
font-size: 1.8rem;
|
| 161 |
-
}
|
| 162 |
-
|
| 163 |
-
.security-feature {
|
| 164 |
-
margin-bottom: 1.5rem;
|
| 165 |
-
padding-bottom: 1.5rem;
|
| 166 |
-
border-bottom: 1px solid #eee;
|
| 167 |
-
}
|
| 168 |
-
|
| 169 |
-
.security-feature:last-child {
|
| 170 |
-
border-bottom: none;
|
| 171 |
-
margin-bottom: 0;
|
| 172 |
-
padding-bottom: 0;
|
| 173 |
-
}
|
| 174 |
-
|
| 175 |
-
.feature-icon {
|
| 176 |
-
font-size: 2rem;
|
| 177 |
-
color: var(--secondary-color);
|
| 178 |
-
margin-bottom: 0.5rem;
|
| 179 |
}
|
| 180 |
|
| 181 |
-
.
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
}
|
| 190 |
|
| 191 |
-
.security-
|
| 192 |
display: inline-block;
|
|
|
|
|
|
|
| 193 |
padding: 0.3rem 0.8rem;
|
| 194 |
-
border-radius:
|
| 195 |
font-size: 0.8rem;
|
| 196 |
-
font-weight:
|
| 197 |
margin-left: 0.5rem;
|
| 198 |
}
|
| 199 |
|
| 200 |
-
.
|
| 201 |
-
|
| 202 |
-
|
| 203 |
}
|
| 204 |
|
| 205 |
-
.
|
| 206 |
-
|
| 207 |
-
|
|
|
|
| 208 |
}
|
| 209 |
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
color:
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
margin-top: auto;
|
| 216 |
}
|
| 217 |
|
| 218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
font-size: 0.9rem;
|
| 220 |
}
|
| 221 |
|
| 222 |
-
.security-badge {
|
| 223 |
-
display: inline-block;
|
| 224 |
-
background-color: var(--success-color);
|
| 225 |
-
color: white;
|
| 226 |
-
padding: 0.3rem 0.8rem;
|
| 227 |
-
border-radius: 20px;
|
| 228 |
-
font-size: 0.8rem;
|
| 229 |
-
font-weight: 700;
|
| 230 |
-
margin-left: 0.5rem;
|
| 231 |
-
}
|
| 232 |
-
|
| 233 |
-
/* Responsive Design */
|
| 234 |
@media (max-width: 768px) {
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
gap: 1rem;
|
| 238 |
-
}
|
| 239 |
-
|
| 240 |
-
.nav-links {
|
| 241 |
-
display: none;
|
| 242 |
-
flex-direction: column;
|
| 243 |
-
gap: 0.5rem;
|
| 244 |
-
width: 100%;
|
| 245 |
-
}
|
| 246 |
-
|
| 247 |
-
.nav-links.active {
|
| 248 |
-
display: flex;
|
| 249 |
-
}
|
| 250 |
-
|
| 251 |
-
.hamburger {
|
| 252 |
-
display: block;
|
| 253 |
-
position: absolute;
|
| 254 |
-
right: 1rem;
|
| 255 |
-
top: 1rem;
|
| 256 |
-
}
|
| 257 |
-
|
| 258 |
-
.security-card {
|
| 259 |
-
padding: 1.5rem;
|
| 260 |
-
}
|
| 261 |
-
}
|
| 262 |
-
|
| 263 |
-
/* Animation */
|
| 264 |
-
@keyframes fadeIn {
|
| 265 |
-
from {
|
| 266 |
-
opacity: 0;
|
| 267 |
-
transform: translateY(20px);
|
| 268 |
}
|
| 269 |
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
transform: translateY(0);
|
| 273 |
-
}
|
| 274 |
-
}
|
| 275 |
-
|
| 276 |
-
.security-card {
|
| 277 |
-
animation: fadeIn 0.5s ease-out;
|
| 278 |
-
}
|
| 279 |
-
|
| 280 |
-
/* Focus styles for accessibility */
|
| 281 |
-
:focus {
|
| 282 |
-
outline: 3px solid var(--secondary-color);
|
| 283 |
-
outline-offset: 2px;
|
| 284 |
-
}
|
| 285 |
-
|
| 286 |
-
/* Reduced motion for accessibility */
|
| 287 |
-
@media (prefers-reduced-motion: reduce) {
|
| 288 |
-
* {
|
| 289 |
-
transition: none !important;
|
| 290 |
-
animation: none !important;
|
| 291 |
}
|
| 292 |
}
|
| 293 |
</style>
|
| 294 |
</head>
|
| 295 |
-
|
| 296 |
<body>
|
| 297 |
-
<
|
| 298 |
-
<
|
| 299 |
-
<
|
| 300 |
-
|
| 301 |
-
<span>Ultra-Secure IP Workstation</span>
|
| 302 |
<span class="security-badge">MAX SECURITY</span>
|
| 303 |
-
</a>
|
| 304 |
-
<button class="hamburger" aria-label="Menu">
|
| 305 |
-
<i class="bi bi-list"></i>
|
| 306 |
-
</button>
|
| 307 |
-
<nav class="nav-links">
|
| 308 |
-
<a href="#" class="nav-link active">Dashboard</a>
|
| 309 |
-
<a href="#" class="nav-link">Security Center</a>
|
| 310 |
-
<a href="#" class="nav-link">Settings</a>
|
| 311 |
-
<a href="#" class="nav-link">Audit Logs</a>
|
| 312 |
-
<a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link" target="_blank"
|
| 313 |
-
rel="noopener noreferrer">
|
| 314 |
-
Built with anycoder
|
| 315 |
-
</a>
|
| 316 |
-
</nav>
|
| 317 |
-
</div>
|
| 318 |
-
</header>
|
| 319 |
-
|
| 320 |
-
<main>
|
| 321 |
-
<div class="security-card">
|
| 322 |
-
<h2>Advanced Security Measures</h2>
|
| 323 |
-
|
| 324 |
-
<div class="security-feature">
|
| 325 |
-
<div class="feature-icon">
|
| 326 |
-
<i class="bi bi-shield-check"></i>
|
| 327 |
-
</div>
|
| 328 |
-
<h3 class="feature-title">
|
| 329 |
-
Strict CSP with Nonce
|
| 330 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 331 |
-
</h3>
|
| 332 |
-
<p class="feature-description">
|
| 333 |
-
Implemented strict CSP with nonce-based script loading to prevent inline script execution and XSS attacks.
|
| 334 |
-
</p>
|
| 335 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
<h3 class="feature-title">
|
| 342 |
-
HSTS Enforcement
|
| 343 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 344 |
-
</h3>
|
| 345 |
-
<p class="feature-description">
|
| 346 |
-
HTTP Strict Transport Security with preload and includeSubDomains for maximum security.
|
| 347 |
-
</p>
|
| 348 |
</div>
|
| 349 |
|
| 350 |
-
<div class="
|
| 351 |
-
<
|
| 352 |
-
|
| 353 |
-
</div>
|
| 354 |
-
<h3 class="feature-title">
|
| 355 |
-
Enhanced XSS Protection
|
| 356 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 357 |
-
</h3>
|
| 358 |
-
<p class="feature-description">
|
| 359 |
-
X-XSS-Protection disabled in favor of CSP for modern browser security.
|
| 360 |
-
</p>
|
| 361 |
-
</div>
|
| 362 |
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
</div>
|
| 367 |
-
<h3 class="feature-title">
|
| 368 |
-
Certificate Transparency
|
| 369 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 370 |
-
</h3>
|
| 371 |
-
<p class="feature-description">
|
| 372 |
-
Expect-CT header enforces certificate transparency for all connections.
|
| 373 |
-
</p>
|
| 374 |
-
</div>
|
| 375 |
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
X-Content-Type-Options set to nosniff to prevent MIME type sniffing attacks.
|
| 386 |
-
</p>
|
| 387 |
-
</div>
|
| 388 |
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
</div>
|
| 393 |
-
<h3 class="feature-title">
|
| 394 |
-
Secure Referrer Policy
|
| 395 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 396 |
-
</h3>
|
| 397 |
-
<p class="feature-description">
|
| 398 |
-
Referrer-Policy set to strict-origin-when-cross-origin to control referrer information.
|
| 399 |
-
</p>
|
| 400 |
-
</div>
|
| 401 |
-
</div>
|
| 402 |
|
| 403 |
-
|
| 404 |
-
|
| 405 |
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
</p>
|
| 418 |
-
</div>
|
| 419 |
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 423 |
</div>
|
| 424 |
-
<h3 class="feature-title">
|
| 425 |
-
Feature Policy Restrictions
|
| 426 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 427 |
-
</h3>
|
| 428 |
-
<p class="feature-description">
|
| 429 |
-
Disabled autoplay, document.write, and synchronous XHR for enhanced security.
|
| 430 |
-
</p>
|
| 431 |
</div>
|
| 432 |
|
| 433 |
-
<div class="
|
| 434 |
-
<
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
<
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
|
|
|
|
|
|
|
|
|
| 444 |
</div>
|
| 445 |
|
| 446 |
-
<div class="
|
| 447 |
-
<
|
| 448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
</div>
|
| 450 |
-
<h3 class="feature-title">
|
| 451 |
-
Input Validation & Sanitization
|
| 452 |
-
<span class="security-status status-active">ACTIVE</span>
|
| 453 |
-
</h3>
|
| 454 |
-
<p class="feature-description">
|
| 455 |
-
All user inputs are validated and sanitized before processing to prevent injection attacks.
|
| 456 |
-
</p>
|
| 457 |
</div>
|
| 458 |
-
</div>
|
| 459 |
-
</main>
|
| 460 |
-
|
| 461 |
-
<footer>
|
| 462 |
-
<p class="footer-text">
|
| 463 |
-
© <span id="current-year"></span> Ultra-Secure IP Workstation. All rights reserved.
|
| 464 |
-
<span class="security-badge">MAX SECURITY</span>
|
| 465 |
-
</p>
|
| 466 |
-
</footer>
|
| 467 |
-
|
| 468 |
-
<script nonce="EDNnf03nceIOfn39fn3e9h3sdfa">
|
| 469 |
-
'use strict';
|
| 470 |
-
|
| 471 |
-
// Security-conscious JavaScript practices
|
| 472 |
-
(function() {
|
| 473 |
-
// Set current year in footer
|
| 474 |
-
document.getElementById('current-year').textContent = new Date().getFullYear();
|
| 475 |
-
|
| 476 |
-
// Mobile menu toggle with security considerations
|
| 477 |
-
const hamburger = document.querySelector('.hamburger');
|
| 478 |
-
const navLinks = document.querySelector('.nav-links');
|
| 479 |
-
|
| 480 |
-
hamburger.addEventListener('click', function() {
|
| 481 |
-
// Using classList.toggle is safe as it doesn't allow arbitrary HTML injection
|
| 482 |
-
navLinks.classList.toggle('active');
|
| 483 |
-
|
| 484 |
-
// Update ARIA attributes for accessibility
|
| 485 |
-
const isExpanded = navLinks.classList.contains('active');
|
| 486 |
-
hamburger.setAttribute('aria-expanded', isExpanded);
|
| 487 |
-
hamburger.setAttribute('aria-label', isExpanded ? 'Close menu' : 'Open menu');
|
| 488 |
-
});
|
| 489 |
-
|
| 490 |
-
// Secure event listener for navigation links
|
| 491 |
-
document.querySelectorAll('.nav-link').forEach(function(link) {
|
| 492 |
-
link.addEventListener('click', function(e) {
|
| 493 |
-
// Remove active class from all links
|
| 494 |
-
document.querySelectorAll('.nav-link').forEach(function(l) {
|
| 495 |
-
l.classList.remove('active');
|
| 496 |
-
});
|
| 497 |
-
|
| 498 |
-
// Add active class to clicked link
|
| 499 |
-
this.classList.add('active');
|
| 500 |
-
});
|
| 501 |
-
});
|
| 502 |
-
|
| 503 |
-
// Secure external link handling
|
| 504 |
-
document.querySelectorAll('a[target="_blank"]').forEach(function(link) {
|
| 505 |
-
// Ensure rel="noopener noreferrer" for security
|
| 506 |
-
link.rel = 'noopener noreferrer';
|
| 507 |
-
});
|
| 508 |
-
|
| 509 |
-
// Security monitoring (example)
|
| 510 |
-
console.log('Security audit: All protection measures initialized');
|
| 511 |
-
|
| 512 |
-
// Additional security measures
|
| 513 |
-
if (window.location.protocol !== 'https:') {
|
| 514 |
-
console.warn('Security warning: Application should be served over HTTPS');
|
| 515 |
-
}
|
| 516 |
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
// Use textContent instead of innerHTML to prevent XSS
|
| 544 |
-
element.textContent = text;
|
| 545 |
-
if (className) {
|
| 546 |
-
element.className = className;
|
| 547 |
-
}
|
| 548 |
-
return element;
|
| 549 |
-
}
|
| 550 |
-
|
| 551 |
-
// Example of secure data handling
|
| 552 |
-
function sanitizeInput(input) {
|
| 553 |
-
return input
|
| 554 |
-
.replace(/</g, '<')
|
| 555 |
-
.replace(/>/g, '>')
|
| 556 |
-
.replace(/"/g, '"')
|
| 557 |
-
.replace(/'/g, ''')
|
| 558 |
-
.replace(/&/g, '&')
|
| 559 |
-
.replace(/\//g, '/');
|
| 560 |
-
}
|
| 561 |
-
|
| 562 |
-
// Security audit function
|
| 563 |
-
function performSecurityAudit() {
|
| 564 |
-
const auditResults = {
|
| 565 |
-
csp: document.querySelector('meta[http-equiv="Content-Security-Policy"]') ? 'PASS' : 'FAIL',
|
| 566 |
-
hsts: document.querySelector('meta[http-equiv="Strict-Transport-Security"]') ? 'PASS' : 'FAIL',
|
| 567 |
-
xssProtection: document.querySelector('meta[http-equiv="X-XSS-Protection"]') ? 'PASS' : 'FAIL',
|
| 568 |
-
frameOptions: document.querySelector('meta[http-equiv="X-Frame-Options"]') ? 'PASS' : 'FAIL',
|
| 569 |
-
contentTypeOptions: document.querySelector('meta[http-equiv="X-Content-Type-Options"]') ? 'PASS' : 'FAIL'
|
| 570 |
-
};
|
| 571 |
-
|
| 572 |
-
console.table(auditResults);
|
| 573 |
-
return auditResults;
|
| 574 |
-
}
|
| 575 |
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
try {
|
| 594 |
-
if (typeof localStorage !== 'undefined') {
|
| 595 |
-
// In a real application, you would encrypt data before storing
|
| 596 |
-
localStorage.setItem('securityAudit', JSON.stringify(performSecurityAudit()));
|
| 597 |
-
}
|
| 598 |
-
} catch (e) {
|
| 599 |
-
console.error('Secure storage error:', e);
|
| 600 |
-
}
|
| 601 |
-
}
|
| 602 |
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
|
|
|
| 607 |
</body>
|
| 608 |
-
|
| 609 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Hardened AI Workstation | Built with anycoder</title>
|
| 7 |
+
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
:root {
|
| 9 |
+
--primary: #1a1a2e;
|
| 10 |
+
--secondary: #16213e;
|
| 11 |
+
--accent: #0f3460;
|
| 12 |
+
--text: #e6e6e6;
|
| 13 |
+
--highlight: #00d4ff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
* {
|
|
|
|
| 20 |
}
|
| 21 |
|
| 22 |
body {
|
| 23 |
+
font-family: 'Courier New', monospace;
|
| 24 |
+
background-color: var(--primary);
|
| 25 |
+
color: var(--text);
|
| 26 |
line-height: 1.6;
|
| 27 |
+
padding: 2rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
+
.container {
|
| 31 |
+
max-width: 1200px;
|
| 32 |
+
margin: 0 auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
|
| 35 |
+
header {
|
| 36 |
display: flex;
|
| 37 |
justify-content: space-between;
|
| 38 |
align-items: center;
|
| 39 |
+
margin-bottom: 2rem;
|
| 40 |
+
padding-bottom: 1rem;
|
| 41 |
+
border-bottom: 1px solid var(--accent);
|
| 42 |
}
|
| 43 |
|
| 44 |
.logo {
|
| 45 |
font-size: 1.5rem;
|
| 46 |
+
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
.anycoder-link {
|
| 50 |
+
color: var(--highlight);
|
| 51 |
text-decoration: none;
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
|
| 54 |
.anycoder-link:hover {
|
|
|
|
| 55 |
text-decoration: underline;
|
| 56 |
}
|
| 57 |
|
| 58 |
+
.card {
|
| 59 |
+
background-color: var(--secondary);
|
| 60 |
+
border-radius: 8px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
padding: 2rem;
|
| 62 |
margin-bottom: 2rem;
|
| 63 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 64 |
}
|
| 65 |
|
| 66 |
+
h1, h2, h3 {
|
| 67 |
+
color: var(--highlight);
|
| 68 |
margin-bottom: 1rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
+
.code-block {
|
| 72 |
+
background-color: #0a0a1a;
|
| 73 |
+
border-radius: 4px;
|
| 74 |
+
padding: 1rem;
|
| 75 |
+
overflow-x: auto;
|
| 76 |
+
font-family: monospace;
|
| 77 |
+
font-size: 0.9rem;
|
| 78 |
+
margin: 1rem 0;
|
| 79 |
}
|
| 80 |
|
| 81 |
+
.security-badge {
|
| 82 |
display: inline-block;
|
| 83 |
+
background-color: var(--highlight);
|
| 84 |
+
color: var(--primary);
|
| 85 |
padding: 0.3rem 0.8rem;
|
| 86 |
+
border-radius: 4px;
|
| 87 |
font-size: 0.8rem;
|
| 88 |
+
font-weight: bold;
|
| 89 |
margin-left: 0.5rem;
|
| 90 |
}
|
| 91 |
|
| 92 |
+
.feature-list {
|
| 93 |
+
list-style-type: none;
|
| 94 |
+
margin: 1rem 0;
|
| 95 |
}
|
| 96 |
|
| 97 |
+
.feature-list li {
|
| 98 |
+
margin-bottom: 0.5rem;
|
| 99 |
+
padding-left: 1.5rem;
|
| 100 |
+
position: relative;
|
| 101 |
}
|
| 102 |
|
| 103 |
+
.feature-list li:before {
|
| 104 |
+
content: "✓";
|
| 105 |
+
color: var(--highlight);
|
| 106 |
+
position: absolute;
|
| 107 |
+
left: 0;
|
|
|
|
| 108 |
}
|
| 109 |
|
| 110 |
+
footer {
|
| 111 |
+
margin-top: 2rem;
|
| 112 |
+
padding-top: 1rem;
|
| 113 |
+
border-top: 1px solid var(--accent);
|
| 114 |
+
text-align: center;
|
| 115 |
font-size: 0.9rem;
|
| 116 |
}
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
@media (max-width: 768px) {
|
| 119 |
+
body {
|
| 120 |
+
padding: 1rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
}
|
| 122 |
|
| 123 |
+
.card {
|
| 124 |
+
padding: 1rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
}
|
| 126 |
}
|
| 127 |
</style>
|
| 128 |
</head>
|
|
|
|
| 129 |
<body>
|
| 130 |
+
<div class="container">
|
| 131 |
+
<header>
|
| 132 |
+
<div class="logo">
|
| 133 |
+
Hardened AI Workstation
|
|
|
|
| 134 |
<span class="security-badge">MAX SECURITY</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
</div>
|
| 136 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link" target="_blank" rel="noopener noreferrer">
|
| 137 |
+
Built with anycoder
|
| 138 |
+
</a>
|
| 139 |
+
</header>
|
| 140 |
|
| 141 |
+
<main>
|
| 142 |
+
<div class="card">
|
| 143 |
+
<h1>Hardened Qwen 3 Local AI Solution</h1>
|
| 144 |
+
<p>This implementation provides a completely local, hardened AI environment with read-only access to the model files.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
</div>
|
| 146 |
|
| 147 |
+
<div class="card">
|
| 148 |
+
<h2>Docker Implementation</h2>
|
| 149 |
+
<p>Here's the complete Docker setup for running Qwen 3 in an Alpine container with read-only access:</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
+
<div class="code-block">
|
| 152 |
+
# Dockerfile for Hardened Qwen 3<br>
|
| 153 |
+
FROM alpine:latest<br><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
+
# Install minimal dependencies<br>
|
| 156 |
+
RUN apk add --no-cache \<br>
|
| 157 |
+
python3 \<br>
|
| 158 |
+
py3-pip \<br>
|
| 159 |
+
&& pip3 install --no-cache-dir \<br>
|
| 160 |
+
torch \<br>
|
| 161 |
+
transformers \<br>
|
| 162 |
+
sentencepiece \<br>
|
| 163 |
+
&& rm -rf /var/cache/apk/*<br><br>
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
+
# Create read-only volume for model<br>
|
| 166 |
+
VOLUME /model<br>
|
| 167 |
+
RUN mkdir -p /model && chmod 400 /model<br><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
+
# Set working directory<br>
|
| 170 |
+
WORKDIR /app<br><br>
|
| 171 |
|
| 172 |
+
# Copy application files<br>
|
| 173 |
+
COPY app.py .<br>
|
| 174 |
+
COPY requirements.txt .<br><br>
|
| 175 |
+
|
| 176 |
+
# Install Python dependencies<br>
|
| 177 |
+
RUN pip3 install --no-cache-dir -r requirements.txt<br><br>
|
| 178 |
+
|
| 179 |
+
# Security hardening<br>
|
| 180 |
+
RUN chmod 500 /app && \<br>
|
| 181 |
+
chmod 400 /app/app.py && \<br>
|
| 182 |
+
chmod 400 /app/requirements.txt<br><br>
|
|
|
|
|
|
|
| 183 |
|
| 184 |
+
# Run as non-root user<br>
|
| 185 |
+
RUN adduser -D -s /bin/sh aiuser && \<br>
|
| 186 |
+
chown -R aiuser:aiuser /app<br><br>
|
| 187 |
+
|
| 188 |
+
USER aiuser<br><br>
|
| 189 |
+
|
| 190 |
+
# Read-only filesystem<br>
|
| 191 |
+
CMD ["sh", "-c", "mount -o remount,ro / && python3 /app/app.py"]
|
| 192 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
</div>
|
| 194 |
|
| 195 |
+
<div class="card">
|
| 196 |
+
<h2>Security Features</h2>
|
| 197 |
+
<ul class="feature-list">
|
| 198 |
+
<li>Alpine Linux base for minimal attack surface</li>
|
| 199 |
+
<li>Read-only filesystem after initialization</li>
|
| 200 |
+
<li>Non-root user execution</li>
|
| 201 |
+
<li>Minimal package installation</li>
|
| 202 |
+
<li>No internet access required</li>
|
| 203 |
+
<li>Model files mounted as read-only volume</li>
|
| 204 |
+
<li>Strict file permissions (400 for sensitive files)</li>
|
| 205 |
+
<li>No shell access in production</li>
|
| 206 |
+
<li>All dependencies pinned to specific versions</li>
|
| 207 |
+
<li>Automatic cleanup of cache files</li>
|
| 208 |
+
</ul>
|
| 209 |
</div>
|
| 210 |
|
| 211 |
+
<div class="card">
|
| 212 |
+
<h2>Python Application</h2>
|
| 213 |
+
<p>The main application file (app.py) for running the hardened Qwen 3 model:</p>
|
| 214 |
+
|
| 215 |
+
<div class="code-block">
|
| 216 |
+
import os<br>
|
| 217 |
+
import sys<br>
|
| 218 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer<br><br>
|
| 219 |
+
|
| 220 |
+
# Security checks<br>
|
| 221 |
+
def security_checks():<br>
|
| 222 |
+
# Verify read-only filesystem<br>
|
| 223 |
+
if not os.access('/', os.W_OK):<br>
|
| 224 |
+
print("✓ Filesystem is read-only")<br>
|
| 225 |
+
else:<br>
|
| 226 |
+
print("✗ Filesystem is writable - security risk!")<br>
|
| 227 |
+
sys.exit(1)<br><br>
|
| 228 |
+
# Verify model directory exists and is readable<br>
|
| 229 |
+
if os.path.exists('/model') and os.access('/model', os.R_OK):<br>
|
| 230 |
+
print("✓ Model directory accessible")<br>
|
| 231 |
+
else:<br>
|
| 232 |
+
print("✗ Model directory not accessible")<br>
|
| 233 |
+
sys.exit(1)<br><br>
|
| 234 |
+
|
| 235 |
+
# Initialize model<br>
|
| 236 |
+
def init_model():<br>
|
| 237 |
+
try:<br>
|
| 238 |
+
# Load model from read-only location<br>
|
| 239 |
+
model = AutoModelForCausalLM.from_pretrained(<br>
|
| 240 |
+
'/model/qwen3',<br>
|
| 241 |
+
trust_remote_code=False,<br>
|
| 242 |
+
local_files_only=True<br>
|
| 243 |
+
)<br><br>
|
| 244 |
+
tokenizer = AutoTokenizer.from_pretrained(<br>
|
| 245 |
+
'/model/qwen3',<br>
|
| 246 |
+
trust_remote_code=False,<br>
|
| 247 |
+
local_files_only=True<br>
|
| 248 |
+
)<br><br>
|
| 249 |
+
print("✓ Model loaded successfully")<br>
|
| 250 |
+
return model, tokenizer<br>
|
| 251 |
+
except Exception as e:<br>
|
| 252 |
+
print(f"✗ Model loading failed: {str(e)}")<br>
|
| 253 |
+
sys.exit(1)<br><br>
|
| 254 |
+
|
| 255 |
+
# Main execution<br>
|
| 256 |
+
if __name__ == "__main__":<br>
|
| 257 |
+
print("Starting Hardened Qwen 3 AI...")<br>
|
| 258 |
+
security_checks()<br>
|
| 259 |
+
model, tokenizer = init_model()<br><br>
|
| 260 |
+
# Your application logic here<br>
|
| 261 |
+
print("AI ready for local inference")<br>
|
| 262 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
+
<div class="card">
|
| 266 |
+
<h2>Deployment Instructions</h2>
|
| 267 |
+
<ol>
|
| 268 |
+
<li>Build the Docker image:
|
| 269 |
+
<div class="code-block">
|
| 270 |
+
docker build -t hardened-qwen3 .
|
| 271 |
+
</div>
|
| 272 |
+
</li>
|
| 273 |
+
<li>Run the container with model volume:
|
| 274 |
+
<div class="code-block">
|
| 275 |
+
docker run -d \<br>
|
| 276 |
+
--name qwen3-ai \<br>
|
| 277 |
+
-v /path/to/qwen3-model:/model:ro \<br>
|
| 278 |
+
--read-only \<br>
|
| 279 |
+
--network none \<br>
|
| 280 |
+
--cap-drop=ALL \<br>
|
| 281 |
+
hardened-qwen3
|
| 282 |
+
</div>
|
| 283 |
+
</li>
|
| 284 |
+
<li>Verify security:
|
| 285 |
+
<div class="code-block">
|
| 286 |
+
docker exec qwen3-ai sh -c "mount | grep 'on / ro'"
|
| 287 |
+
</div>
|
| 288 |
+
</li>
|
| 289 |
+
</ol>
|
| 290 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
+
<div class="card">
|
| 293 |
+
<h2>Additional Hardening</h2>
|
| 294 |
+
<p>For maximum security, consider these additional measures:</p>
|
| 295 |
+
<ul class="feature-list">
|
| 296 |
+
<li>Use Docker content trust for image verification</li>
|
| 297 |
+
<li>Sign your Docker images with cosign</li>
|
| 298 |
+
<li>Run in a dedicated user namespace</li>
|
| 299 |
+
<li>Use seccomp profiles to restrict syscalls</li>
|
| 300 |
+
<li>Enable AppArmor or SELinux policies</li>
|
| 301 |
+
<li>Regularly scan for vulnerabilities with trivy</li>
|
| 302 |
+
<li>Use immutable tags for production images</li>
|
| 303 |
+
<li>Implement runtime security monitoring</li>
|
| 304 |
+
<li>Store model files in encrypted volumes</li>
|
| 305 |
+
<li>Use hardware security modules for key management</li>
|
| 306 |
+
</ul>
|
| 307 |
+
</div>
|
| 308 |
+
</main>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
|
| 310 |
+
<footer>
|
| 311 |
+
<p>© 2023 Hardened AI Workstation. All rights reserved.</p>
|
| 312 |
+
<p>This implementation provides enterprise-grade security for local AI deployment.</p>
|
| 313 |
+
</footer>
|
| 314 |
+
</div>
|
| 315 |
</body>
|
|
|
|
| 316 |
</html>
|