tinyMan":27al35y1 said:
You just can not have this mindset. Security is the result of a process, one that takes the decision about storing a password in a config file away from the developer. I have also bolded part of your quote that is very problematic for me (and also familiar as I used to think the same way). The professional, and correct thing to do is to plan for a regularly changing password, because that is a requirement in professional environment. On the plus side, once you have a process its really easy.
I'm still not understanding the actual risks of storing it there versus not storing it there? The explanation I'm seeing here is more along the lines of "that's just the way it's done, so do it this way". Security is my first thought when developing the application, however my mindset is that if the server is compromised in any way and the password is stored _somewhere_ on the server (regardless of whether it is within the config file, or an 'external' storage) won't it be vulnerable any way? To give some background on my server and application back end: FreeBSD 8.1 server, PostgreSQL database, lighttpd, PHP and Perl. The application is accessed via the web via LAN, but also has jobs that run via cron. The database and application are housed on the same server (cost) for the time being, though eventually I hope to have a separate database and application server. If the server is compromised, the database password is almost the least of my worries. Finally, the application is exclusively internal and will not be accessible outside of the company intranet.
I'm not being sarcastic - I truly want to understand the point of these extra layers of security. "Just because" isn't a valid explanation for doing one thing over another, even in the case of security. However, I'm definitely open to learning a new practice that might have benefits in future applications; while this one is internal only the next could be customer facing for all I know.
tinyMan":27al35y1 said:
Yeah, one example from my environment was this goddamn 'imgSrcDir' that was spread across literally hundreds of config files. Basically they all ended up containing the equivalent of 'img/'. We standardized our file tree, every Javascript in a 'js' folder, every css in a 'css' folder and every image in an 'img' folder. Make that a standard and code to it, and dropped the config options. Lots of stuff for paths is like that.
For stuff like 'where is the tar on this system' well, that is what the .profile and path configs are for. That was the SAs can do their jobs, and the developers can do theirs and the dependencies between the two are minimized.
Agreed. Thinking through the decision to include some of the paths it really boils down to trying to force myself to write to those directories and only those directories. I don't plan to change them, I don't plan to update them, I just want standardization.
tinyMan":27al35y1 said:
Just another anecdote from my experiences. We very recently completed a project to make the 'debug' attribute dynamic on a per-request basis. For the persona-enabled systems where we can associate a request with a particular user, we make 'debug' an attribute of that user. For stateless/user-less requests, the debug flag gets passed to the call as a parameter. This way, in development I can run debug all I want and then in production skip it most of the time, but if something crops up that needs some introspection, its easy to conjure up the correct user/call parameter to spit back debug output. Our debug code also includes detailed timing/performance metrics so the automated monitoring requests we run can get and track hyper-detailed performance statistics instead of just a total request time, which was another side bonus.
This approach sounds very nice (and helpful) for accessing debug information in the production environment. My biggest fear of exposing this functionality (in any form) to production is that, should a 'privileged' account be compromised (via any means) not only do I have a user account out there that an attacker has access to, the attacker can also see some of the behind the scenes mechanics of the application through the debug information; possibly leading to more attack vectors. Security through obscurity is the first thing that comes to mind; my application should obviously be secure even if an attacker knows some of the behind the scenes logic - but why risk making it easier?
My current debug process for production problems is to attempt to replicate it on the QA build. QA runs a copy of production code (albeit with a usually outdated database, but that can be easily remedied) and is limited in access - thus I feel I can safely enable any sort of debugging functionality there.
tinyMan":27al35y1 said:
In my opinion, that is something that that web-host or container should be controlling and the application would be completely agnostic to it. For example, perhaps your load-balancers or proxies do the re-writing for you, or an IIS module uses the sites definition to figure out what the presented URL should be. Pushing these types of decisions so low into the stack makes it very hard to be agile.
This makes sense with the web-facing portion of the application - but the behind the scenes stuff (cron, emails) won't know much aside from the hostname of the machine that executes the job. A script run via cron controls many functions (including sending emails) and runs strictly though invocation of the script it self. How then can I know the hostname (besides pulling that info from the application process that is generating the email, storing that in the database and referencing it that way?).