Skip to content

Commit 9c4e02f

Browse files
committed
Add 403 message which describes the problem
1 parent 3510afe commit 9c4e02f

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

front/403_internal.html

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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>Access Restricted - NetAlertX</title>
7+
<style>
8+
body {
9+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
10+
background-color: #f8f9fa;
11+
color: #212529;
12+
display: flex;
13+
align-items: center;
14+
justify-content: center;
15+
height: 100vh;
16+
margin: 0;
17+
}
18+
.container {
19+
text-align: center;
20+
padding: 2rem;
21+
background: white;
22+
border-radius: 8px;
23+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
24+
max-width: 600px;
25+
}
26+
h1 {
27+
color: #dc3545;
28+
font-size: 2rem;
29+
margin-bottom: 1rem;
30+
}
31+
p {
32+
margin-bottom: 1rem;
33+
line-height: 1.5;
34+
}
35+
.code-snippet {
36+
background-color: #e9ecef;
37+
padding: 0.2rem 0.4rem;
38+
border-radius: 4px;
39+
font-family: monospace;
40+
font-weight: bold;
41+
}
42+
.footer {
43+
margin-top: 2rem;
44+
font-size: 0.9rem;
45+
color: #6c757d;
46+
border-top: 1px solid #dee2e6;
47+
padding-top: 1rem;
48+
}
49+
</style>
50+
</head>
51+
<body>
52+
<div class="container">
53+
<h1>403 Forbidden</h1>
54+
<p>
55+
The <span class="code-snippet">/server</span> endpoint is for <strong>internal use only</strong> and cannot be accessed from external browsers or applications.
56+
</p>
57+
<p>
58+
This security measure protects the backend API. You will need to contact your system administrator in order to gain access to the API port (default: 20212), or use the application through the standard web interface.
59+
</p>
60+
<div class="footer">
61+
NetAlertX Security &bull; Trust Level: Untrusted Origin
62+
</div>
63+
</div>
64+
</body>
65+
</html>

install/production-filesystem/services/config/nginx/netalertx.conf.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ http {
117117

118118
location /server/ {
119119
# 1. Enforcement
120+
error_page 403 /403_internal.html;
120121
if ($is_trusted != "TRUSTED") {
121122
return 403;
122123
}

0 commit comments

Comments
 (0)