Security Visualiser

I finally managed to get the security visualiser working…

Coldbox App Create securityTest

install cbsecurity

Adjusted config/Coldbox.cfc

moduleSettings = {
cbauth = {
// This is the path to your user object that contains the credential
// validation methods
userServiceClass = “models.UserService”
},
cbSecurity : {
visualizer : {
“enabled” : true,
“secured” : false,
“securityRule” : {}
},
firewall : {
“logs” : {
“enabled” : true,
“table” : “cbsecurity_logs”,
“autoCreate” : true
}
}
}
}

Added models/UserDataLucee.cfc and UserService.cfc from cbsecurity_template

Made sure there was a database set up in .env and the datasource registered in Application.cfc.

This works, but the moment I put the firewall setting to

“enabled” : false,

there is an error from deep inside cbsecurity -

modules/cbsecurity/models/util/DBLogger.cfc:338

datasource [] doesn’t exist

Why would this be the error?

The DBLogger needs to know to which database to connect to and execute the SQL against. You have two choices

  1. Add a this.datasource to your Application.cfc
  2. Add a dsn setting to the `logs" firewall struct.

Thanks for updating the cbsecurity docs at github!