Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5118  / 2 Years ago, mon, august 8, 2022, 4:21:19

I have MySQL installed in my development machine, where I just don't need any additional security measure.



I want to move MySQL Data files to another partition, which implies a lot of change in AppAmor config, that I don't want to do since it's too much work for a simple development machine and I really don't need it.



My question is: is it safe to remove AppArmor without any side-effects to the system?



Like I said, security in this case is not really a concern.


More From » kernel

 Answers
7

It would not be safe to remove AppArmor in the sense of the word. You would be disabling a security system designed to be in place for protecting you. So it would indeed make you less safe. What you want to know is: yes you can remove it without side-effects but lessen that system's security with it.



But the changes to apparmor are quite minimal, if you just want to move the MySQL DataDir to another partition. In addition I would recommend moving it to /srv/mysql and mount your partition either to /srv or to /srv/mysql for that reason (depending if you have other services on that box you want to put into /srv).



Reason behind is, that ubuntu states the /srv mountpoint/directory the place for your own (custom) service data to be deployed (srv stands for service. Should contain server specific services related data. For example, /srv/cvs contains CVS related data.)



The changes to apparmor are quite minimalistic:



vi /etc/apparmor.d/usr.sbin.mysqld and search for /var/lib/mysql and insert:



  /var/lib/mysql/ r,
/var/lib/mysql/** rwk,
# new location of datadir
/srv/mysql/ r,
/srv/mysql/** rwk,


That is enough to satisfy apparmor and you can leave it in place without needing to fiddle around with uninstalling it.



Hope that helps!


[#31228] Tuesday, August 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lishrag

Total Points: 306
Total Questions: 109
Total Answers: 125

Location: Saint Lucia
Member since Wed, Feb 8, 2023
1 Year ago
;