- Trusted proxy config option for proxy-aware IP extraction used by rate limiting and audit logs; validates proxy IP before trusting X-Forwarded-For / X-Real-IP headers - TOTP replay protection via counter-based validation to reject reused codes within the same time step (±30s) - RateLimit middleware updated to extract client IP from proxy headers without IP spoofing risk - New tests for ClientIP proxy logic (spoofed headers, fallback) and extended rate-limit proxy coverage - HTMX error banner script integrated into web UI base - .gitignore updated for mciasdb build artifact Security: resolves CRIT-01 (TOTP replay attack) and DEF-03 (proxy-unaware rate limiting); gRPC TOTP enrollment aligned with REST via StorePendingTOTP Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1.3 KiB
HTML
37 lines
1.3 KiB
HTML
{{define "base"}}<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>{{block "title" .}}MCIAS{{end}}</title>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body hx-headers='{"X-CSRF-Token": "{{.CSRFToken}}"}'>
|
|
<nav>
|
|
<div class="nav-inner">
|
|
<span class="nav-brand">MCIAS</span>
|
|
<ul class="nav-links">
|
|
<li><a href="/dashboard">Dashboard</a></li>
|
|
<li><a href="/accounts">Accounts</a></li>
|
|
<li><a href="/audit">Audit</a></li>
|
|
<li><a href="/policies">Policies</a></li>
|
|
<li><a href="/pgcreds">PG Creds</a></li>
|
|
{{if .ActorName}}<li><a href="/profile">{{.ActorName}}</a></li>{{end}}
|
|
<li><form method="POST" action="/logout" style="margin:0"><button class="btn btn-sm btn-secondary" type="submit">Logout</button></form></li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
<main>
|
|
<div class="container">
|
|
<div id="htmx-error-banner" role="alert" style="display:none"></div>
|
|
{{if .Error}}<div class="alert alert-error" role="alert">{{.Error}}</div>{{end}}
|
|
{{if .Flash}}<div class="alert alert-success" role="status">{{.Flash}}</div>{{end}}
|
|
{{block "content" .}}{{end}}
|
|
</div>
|
|
</main>
|
|
<script src="/static/htmx.min.js"></script>
|
|
<script src="/static/mcias.js"></script>
|
|
</body>
|
|
</html>
|
|
{{end}}
|