Skip to content

Commit a18ec73

Browse files
committed
BOX-164 #resolve
Allow Visualizer to show settings when firewall.logging not enabled
1 parent fcf145f commit a18ec73

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Fixed
1717

18+
- BOX-164 Allow Visualizer to show settings when firewall.logging not enabled
1819
- JWT Handler improperly returns a value causing it to skip ColdBox's RestHandler's response formatting logic. This results in the entire response object being returned rather than just invoking getDataPacket()
1920

2021
## [3.5.0] - 2025-10-17

handlers/Visualizer.cfc

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@ component extends="coldbox.system.RestHandler" {
2020
}
2121
// Settings the visualizer will visualize :)
2222
prc.settings = variables.settings;
23-
prc.logCounts = dbLogger.count();
24-
prc.actionsReport = dbLogger.getActionsReport();
25-
prc.blockTypesReport = dbLogger.getBlockTypesReport();
26-
prc.topOffendingPaths = dbLogger.getTopOffending( "path" );
27-
prc.topOffendingIps = dbLogger.getTopOffending( "ip" );
28-
prc.topOffendingHosts = dbLogger.getTopOffending( "host" );
29-
prc.topOffendingUserAgents = dbLogger.getTopOffending( "userAgent" );
30-
prc.topOffendingMethods = dbLogger.getTopOffending( "httpMethod" );
31-
prc.topOffendingUsers = dbLogger.getTopOffending( "userId" );
32-
prc.logs = dbLogger.getLatest(
33-
top : 50,
34-
action : rc.action ?: "",
35-
blockType: rc.blockType ?: "",
36-
userId : rc.userId ?: ""
37-
);
23+
if( prc.settings.firewall.logs.enabled ){
24+
prc.logCounts = dbLogger.count();
25+
prc.actionsReport = dbLogger.getActionsReport();
26+
prc.blockTypesReport = dbLogger.getBlockTypesReport();
27+
prc.topOffendingPaths = dbLogger.getTopOffending( "path" );
28+
prc.topOffendingIps = dbLogger.getTopOffending( "ip" );
29+
prc.topOffendingHosts = dbLogger.getTopOffending( "host" );
30+
prc.topOffendingUserAgents = dbLogger.getTopOffending( "userAgent" );
31+
prc.topOffendingMethods = dbLogger.getTopOffending( "httpMethod" );
32+
prc.topOffendingUsers = dbLogger.getTopOffending( "userId" );
33+
prc.logs = dbLogger.getLatest(
34+
top : 50,
35+
action : rc.action ?: "",
36+
blockType: rc.blockType ?: "",
37+
userId : rc.userId ?: ""
38+
);
39+
}
3840
// Show the visualizer
3941
event.setView( "home/index" );
4042
}

test-harness/config/Coldbox.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
// Firewall Validator
9797
//"validator" : "BasicAuthValidator@cbsecurity",
9898
"logs" : {
99-
enabled : true
99+
enabled : false
100100
},
101101
// The global security rules
102102
"rules" : [

0 commit comments

Comments
 (0)