Skip to content

Commit 8133555

Browse files
authored
Merge pull request #7 from SubleXBle/Development---SecurityPatch---0.3.1
This update focuses on security, stability, and a cleaner codebase Direct access to raw .json files is now blocked (via .htaccess) Frontend data is now loaded via secure PHP proxies only some js refactored Displays today's bans, unbans, and total events Tested and working stable so far
2 parents 4daa0cd + 09a9226 commit 8133555

19 files changed

+446
-156
lines changed

.htaccess

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Options -Indexes
1616

1717
# Block direct access to sensitive file types
18-
<FilesMatch "\.(sh|ini|log)$">
18+
<FilesMatch "\.(sh|ini|log|json)$">
1919
Require all denied
2020
</FilesMatch>
2121

@@ -24,6 +24,10 @@ Options -Indexes
2424
Require all denied
2525
</Files>
2626

27+
<IfModule mod_rewrite.c>
28+
RewriteEngine On
29+
RewriteRule ^archive/ - [F,L]
30+
</IfModule>
2731

2832
# ----------------------------------------------------
2933
# BASIC HTTPS HEADERS

README.md

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Fail2Ban-Report
2+
> Beta 3.1 | Version 0.3.1
23
34
A simple and clean web-based dashboard to turn your daily Fail2Ban logs into searchable and filterable JSON reports — with optional IP blocklist management for UFW.
45

@@ -20,25 +21,25 @@ Please read the [Installation Instructions](Setup-Instructions.md) carefully and
2021
---
2122

2223
## 📚 What It Does
24+
Fail2Ban-Report parses your fail2ban.log and generates JSON-based reports viewable via a web dashboard. It provides optional tools to:
2325

24-
Fail2Ban-Report parses your `fail2ban.log` and generates JSON-based reports viewable via a web dashboard. It adds optional tools to:
26+
- Visualize ban and unban events
27+
- Interact with IPs (e.g., manually block or unblock)
28+
- Maintain a persistent blocklist.json
29+
- Sync that list with your system firewall using ufw (support for other firewalls or direct communication with Fail2Ban jails is not yet implemented)
2530

26-
- Visualize ban/unban events
27-
- Interact with IPs (e.g. manually block/unblock)
28-
- Maintain a persistent `blocklist.json`
29-
- Sync that list with your system firewall (via `ufw` (other Firewalls than UFW or direct communication with fail2ban jails **not yet** supported))
31+
## 🧱 Architecture overview:
3032

31-
🧱 The architecture:
32-
- **Backend Shell Scripts**: Parse logs, write JSON, and update UFW accordingly to `blocklist.json`
33-
- **Frontend Web Interface**: Visualizes data and offers action buttons
34-
- **JSON Blocklist**: Stores manually blocked IPs (`active=true`)
33+
- Backend Shell Scripts: Parse logs, generate JSON files, and update UFW rules based on blocklist.json
34+
- Frontend Web Interface: Visualizes data and offers action controls
35+
- JSON Blocklist: Stores manually blocked IPs marked with active=true
3536

3637
---
3738

3839
## 📦 Features
3940

4041
- 🔍 **Searchable + filterable** log reports (date, jail, IP)
41-
- 🔧 **Integrated JSON blocklist** with action buttons
42+
- 🔧 **Integrated JSON blocklist** for persistent Block-Overview
4243
- 🧱 **Firewall sync** using UFW (planned: nftables, firewalld)
4344
-**Lightweight setup** — no DB, no frameworks
4445
- 🔐 **Compatible with hardened environments** (no external assets, strict headers)
@@ -57,16 +58,25 @@ Fail2Ban-Report parses your `fail2ban.log` and generates JSON-based reports view
5758
5859
---
5960

60-
## 🆕 What's New in V 0.2.3 (🔥 HotFix)
61-
- Hotfix for `includes/list-files.php`
62-
- Fix file date filtering to include today's JSON logs and ensure latest files are listed correctly.
63-
64-
### New in V 0.2.2
65-
- Default sorting changed to descending (newest first)
66-
- Sorting by date/time, action, and jail added in the main list
67-
- Reset & reload button to easily clear filters and sorting
68-
- Date filter and reset button added to the blocklist overlay
69-
- The number of days shown in "Select Date" can now be limited via the config file (default 7 days)
61+
## 🆕 What's New in V 0.3.1
62+
63+
- **Protected access to JSON files**
64+
- Direct access to `/archive/*.json` is now blocked via `.htaccess`
65+
- Frontend scripts no longer request raw `.json` files directly
66+
- **New secure PHP endpoints**
67+
- `includes/get-json.php` and `includes/get-blocklist.php` act as controlled proxies to serve JSON data
68+
- Only PHP scripts will now expose required JSON content
69+
- **Hardened frontend behavior**
70+
- JavaScript files (`jsonreader.js`, `blocklist-overlay.js`) fetch data only via the new PHP proxies
71+
- **New Ministats in Header**
72+
- Shows today's **ban/unban statistics** in the page header:
73+
- 🚫 Bans
74+
- 🟢 Unbans
75+
- 📊 Total events
76+
- Adds quick insight into current Fail2Ban activity
77+
- **Mobile-Friendly**
78+
- Site is now more mobile friendly
79+
- added favicon (🕵️) to make browsers happy
7080

7181

7282
🧪 [as promised there is an highly experimental feature for using fail2ban instead of UFW.](using-Fail2Ban-firewall-update.md) (⚠️ not recommended)
@@ -103,7 +113,8 @@ This is especially useful if you want to manually patch or update individual fil
103113

104114
### 🔐 Security
105115
- ✅ Hardened `.htaccess` with best practices
106-
- 🧩 add security layer between json and js to harden `includes/` and `archive/` better
116+
- ✅ add security layer between json and js
117+
- 🧩 moove `archive/` out of webdirectory
107118
- ⏳ Further improvements (ongoing goal)
108119

109120
### 🔥 Active Defense
@@ -119,13 +130,13 @@ This is especially useful if you want to manually patch or update individual fil
119130
- ⏳ Improve CSS and styling
120131

121132
## 👀 Outlook
122-
- 🔭 next version will focus on security and stability by establishing better seperation between frontend and backend.
133+
- 🔭 next major version will focus on security by mooving archive/ out of webdirectory.
123134

124135
---
125136

126137
## 🖼️ Screenshots
127138

128-
![Main interface with log overview](assets/images/Main-List.png)
139+
![Main interface with log overview](assets/images/Main-List-031.png)
129140
![Blocklist interface with unblock actions](assets/images/Blocklist-Overlay.png)
130141
![Result after banning an IP](assets/images/banip.png)
131142
![Result after "report" an IP](assets/images/reportip.png)

assets/css/faviconx32.png

1.92 KB
Loading

0 commit comments

Comments
 (0)