LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-07-2006, 12:52 PM   #1
uopjohnson
Member
 
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159

Rep: Reputation: 30
Running mysqld as normal user... bad?


I'm hoping to get some help with this because even though the context is OS X specific I believe that the question is fairly OS agnostic.

I'm setting up a mysql test development environment on my OS X laptop. The data that I'm working with is sensitive including SS#s and such so I want to be sure it is protected. I am using Apple's Filevault system to encrypt my entire home directory and I set up mysql to store all of its data inside the encrypted volume. In order for this to work I have to set up mysqld to run as my local user account because the apple filevault system will not allow any other user to write into the volume.

I say all that to ask this... is this bad? Is there something I'm leaving myself open to by allowing mysql to run in this way?

Thanks in advance,
 
Old 11-07-2006, 01:26 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Bad? Well, uh, yeah, it isn't "good practice" to do so (daemons should be started by the system during boot and appropriate permissions granted to individual users, particularly data base users).

If you've followed MySQL "post installation" instructions; i.e., root password, no public access, explicit grant to user accounts, good passwords at all levels, you're already pretty safe. If you take a look at section 12.9 of the MySQL manual (encryption and compression functions), the AES encryption functions (with 128-bit keys, secure enough for most applications).

It really is better to lock down your system with good passwords and restricted access; e.g., no telnet, ever, then doing the same with your data base application than encrypting an entire drive or parts of one -- if your system is configured properly, it's going to be extremely difficult to break into in the first place, let alone walking off with critical content. You probably already know that there is no such thing as 100% unbreakable encryption -- give me enough time and horsepower and I can break anything -- but if you put enough "good practice" barriers in the way, you make it extremely difficult for all but the most dedicated (who would have to have unrestricted access to begin with) and the kid that steals your laptop probably ain't in that class.

Better you spend some time getting your system safe, then getting your data base safe. When you do it right the likelihood of getting compromised gets really low -- and you benefit by being able to port your built-safe application to a similarly configured production environment without required third-party software. Design with safety in mind... encrypt what needs to be encrypted and make it really, really hard to get at it.
 
Old 11-07-2006, 01:51 PM   #3
uopjohnson
Member
 
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159

Original Poster
Rep: Reputation: 30
Thanks for the reply. We are at the end of a productions cycle and cannot make major DB changes (like encrypting critical info) until next spring. I'm not especially worried about a remote attack on this machine, what really scares me is someone walking off with the laptop. In California the reporting laws for the loss of identifying information are very strict, and I have no desire to make national news.
As far as I understand the reason for having a unique user for each daemon is to limit compromise if that daemon is compromised. Since the system itself is locked down from remote attack and the DB is properly secured I don't think this is much of a risk. I need to protect against the much greater risk of someone physically stealing the machine.
 
Old 11-07-2006, 03:14 PM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
You know, if I was that worried, I'd buy myself a real big memory stick, mount the thing to /var/lib/mysql and stick it a safe when I wasn't using it -- chances are you'd never make the front page of the LA Times...
 
Old 11-07-2006, 04:41 PM   #5
uopjohnson
Member
 
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159

Original Poster
Rep: Reputation: 30
What I ended up doing is creating a separate disk image and then writing a script that mounts the disk image and then starts mysql using that mount point as the data directory. Everything seems to work real well and it doesn't require me to mess around with the user or permissions on mysql.

I genuinely considered the memory stick idea, but I think I'm a lot more likely to lose that. The requirements in California are very unforgiving and require notification of all parties when there is even a chance that data has been compromised. Encryption, according to the law as I understand it, nullifies this. If encrypted data is lost then reporting is not mandated which keeps me out of the paper. My Mom will be disappointed, but I'm happy!

Thanks again for the input.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 07:25 PM
problem in running the command as a normal user junaid18183 Linux - General 2 06-25-2005 06:27 AM
problem running stormpkg as normal user drrnsk8ter4 Linux - Software 0 04-24-2004 01:15 AM
normal user running shutdown cblamer Slackware 6 12-21-2003 08:44 PM
running ethereal as a normal user tangle Linux - Software 1 02-04-2003 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration