
Hi Daniel, That part is looking good for now but I gotta do fire drills validate the whole shebang. There's something almost blog worthy about this. mysqldump started as a handy import export utility and ended up being an exquisite point-in-time logical SQL snapshot tool. Now xtrabackup and mariabackup are so astonishingly fast at restoration/recovery they can't be ignored. But they are terrifying! They operate directly on the datadir. mysqldump is a nice friendly SQL client like any other. Does that make sense? An SQL client can ruin the DB as well as anything else if it has the right permissions (pun!). Hence subtracting permission to write datadir from the mariabackup process feels like a step to parity. Tom On 7/6/2023 6:52:17 PM, "Daniel Black" <daniel@mariadb.org> wrote:

On Fri, Jul 7, 2023 at 9:42 AM Tom Worster <fsb@thefsb.org> wrote:
For confidence look at strace -fe trace=openat mariabackup and you'll see the datadir files are opened O_RDONLY. https://www.freedesktop.org/software/systemd/man/systemd.exec.html#BindPaths... It's also possible to make the /var/lib/mysql readonly for this service without affecting mariadbd. Selinux rules can make a tighter constraint, though would impede the copyback functionality when a restore occurs. Though could be enforeced on the backup context - https://www.freedesktop.org/software/systemd/man/systemd.exec.html#SELinuxCo...

On 7/6/2023 11:31:53 PM, "Daniel Black via discuss" <discuss@lists.mariadb.org> wrote:
I'm not a C programmer but I guess that means the openat(2) calls we can see mariabackup make aren't reckless, which is good. In general I trust [Mm]aria* more than I trust myself, which points to the other problem: my script...
Interesting. bind mounts are handy trick in lxc too. systemd is full of nutritious goodness. I keep meaning to read the manual but it's so long.
Many years ago I promised myself a special reward in heaven if I can get to my grave without having engaged with Selinux. Thanks for your interest, Daniel Tom
participants (2)
-
Daniel Black
-
Tom Worster