Random things #7

Written on 2 December 2014, 10:55pm

Tagged with: , , ,

1. Custom templates for request debug output

Use case: you want to temporarily enable debug output in a production environment (ex – to determine the cause of a specific performance problem), but you obviously don’t want the users to see the debug information.
Solutions:
– restrict debug output to your IP only (if you know exactly who is behind your IP), but it will still introduce a performance problem (the IP has to be checked for every request)
– create a custom debug template (*) – example logging.cfm instead of classic.cfm and log all the details you need instead of outputting
– create an empty debug template (silent.cfm), then create a component with a main logging method based on the classic.cfm debug template. Call this main method onRequestEnd to log all the needed details.

(*) A custom debug template can be created and placed in the WEB-INF/debug ColdFusion folder. The classic.cfm template can be used as starting point.
More info: http://www.bennadel.com/blog/116-finding-template-execution-stack-in-coldfusion.htm

2. When a ColdFusion template cannot be found

Use onMissingTemplate and return a 404 HTTP error code. Let the web server handle the error:

<cffunction name="onMissingTemplate">
    <cfargument name="targetPage" type="string" required="true"/>
    <cfheader statuscode="404" statustext="Not Found">
</cffunction>

(more…)

Random things #6

Written on 28 November 2014, 11:27am

Tagged with: , , , , ,

1. A few things about yum:

– yum plugins
– yum update openssl package (heartbleed anyone?)

Info about yum and openssl packages:
yum info yum
yum info openssl

Run yum without plugins:
yum --noplugins

Update openssl package:
yum update openssl

To check that a certain CVE (common vulnerability and exposure) is fixed in the current installation:
rpm -q --changelog openssl | grep CVE-2014-0224

To check openssl version:
openssl version -a

2. vi quick commands:

– insert to start editing
– escape to stop editing
– :x to save and exit (in view mode)
– u to undo (in view mode)

3. SFTP Sublime Text plugin is awesome

And it’s only $20
editor_menu

Security concepts

Written on 24 November 2014, 11:08pm

Tagged with:

The CIA of security
Confidentiality + Integrity + Availability
+ (in time) – Authentication and Non-repudiation

Operational model of computer security
Protection = Prevention + (Detection + Response)

Other security concepts
– Least privilege
– Separation of duties
– Implicit deny
– Job rotation
– Layered security
– Diversity of defense
– Security through obscurity: pushing your favorite ice cream to the back of the freezer, or making your admin URL hard to guess 🙂

Identification vs Authentication vs Authorization
Identification – who are you? (typically an username)
Authentication – how can you prove who you are?
– something you know (a password)
– something you have (a physical token)
– something you are (fingerprint reader)
Authorization – what you can do once you are authenticated?

Access control
– DAC – discretionary access control
– MAC – mandatory access control
– RBAC – role based access control
– RBAC – rule based access control

iStock_000015705097Small
Image: istockphoto