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!

Luis, I know this is an older thread, but we’re in that update to 7 process. Just trying to get some understanding between our interceptors and those of the cbsecurity module.

How do I prevent the
datasource [] doesn't exist
error? I don’t NEED a datasource if I have all the rules in the moduleSettings coldbox config section, right?

The datasource in cbsecurity is for logging. If you don’t want logging, then turn it off.