| Summary: | bind: upgrading from Mageia 2 to Mageia 3 results in completely broken configuration | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | David Walser <luigiwalser> |
| Component: | RPM Packages | Assignee: | Guillaume Rousse <guillomovitch> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | alien, mageia |
| Version: | Cauldron | ||
| Target Milestone: | --- | ||
| Hardware: | i586 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | bind-9.9.2.P2-1.mga3.src.rpm | CVE: | |
| Status comment: | |||
| Bug Depends on: | |||
| Bug Blocks: | 8016 | ||
|
Description
David Walser
2013-05-08 16:03:24 CEST
David Walser
2013-05-08 16:03:49 CEST
Blocks:
(none) =>
8016 I ran into similar issues. If the service fails to start then the ExecStop will not run and the bind mounts are not unbound. A (hacky) fix would be to also call the script in ExecStartPre with a - to ignore return and to make it unmount everything. That way even if you try and start it several times and it fails, it should make a clean state before trying again. It's not ideal tho' as it leaves the binds in place while you are trying to debug any problems.
Regarding the moving of the files I think we have to be careful here too to not accidentally overwrite things. AL13N says he just edits the files in place so this would confuse him.
Overall it's a bit messy and I think we should instead try to use the systemd isolation stuff instead and get rid of this complex structure.
e.g. from systemd.exec(5):
ReadWriteDirectories=, ReadOnlyDirectories=,
InaccessibleDirectories=
Sets up a new file-system name space for executed processes.
These options may be used to limit access a process might
have to the main file-system hierarchy. Each setting takes a
space-separated list of absolute directory paths. Directories
listed in ReadWriteDirectories= are accessible from within
the namespace with the same access rights as from outside.
Directories listed in ReadOnlyDirectories= are accessible for
reading only, writing will be refused even if the usual file
access controls would permit this. Directories listed in
InaccessibleDirectories= will be made inaccessible for
processes inside the namespace. Note that restricting access
with these options does not extend to submounts of a
directory. You must list submounts separately in these
settings to ensure the same limited access. These options may
be specified more than once in which case all directories
listed will have limited access from within the namespace.
If we can't fix this properly in time, couldn't we do the following as a short-term fix? BTW, I don't get your comment about being careful about moving and accidentally overwriting things. That shouldn't happen. Anyway, I don't know if %pre or %post would be the right place or if it has to be before %_post_service, but:
mv -f %{chroot_prefix}/var/named/* /var/named/
rm -rf %chroot_prefix}%{_libdir}/openssl-*
in mga2, i'm editing files and dnssec keys in %{chroot_prefix}/var/named/* . on upgrade it would be nice to to lose my stuff :-).
about using the isolation system, do you mean to use this without actually chrooting? if you do, i think you'll have some angry named sysadmins... :-) security is quite paramount for them... if the named is hacked, it must not get out of the chroot...CC:
(none) =>
alien btw: i'm unsure, but if the openssl-* file is a cnf file; then this could be used to have some settings for generating ssl certificates if one would need it for ssl on bind. not sure, but should check with someone who actually uses this... OK, the commands from Comment 2 are protected with an if [ "$1" -gt 1 ] and are in %post before everything else. Freeze push requested. This should fix this. (In reply to AL13N from comment #3) > about using the isolation system, do you mean to use this without actually > chrooting? if you do, i think you'll have some angry named sysadmins... :-) > security is quite paramount for them... if the named is hacked, it must not > get out of the chroot... Short answer: chroots aren't that great for security. We can do better, perhaps using file system namespaces. Long answer: http://0pointer.de/blog/projects/changing-roots.html Might not be the answer as it might still expose too much. (In reply to Colin Guthrie from comment #6) > Short answer: chroots aren't that great for security. We can do better, > perhaps using file system namespaces. > > Long answer: http://0pointer.de/blog/projects/changing-roots.html > > Might not be the answer as it might still expose too much. Or maybe containers...kinda like Solaris zones. well, i'm just saying that these bind admins are freakishly paranoid and don't like to deviate from their known practises (except for very good reason) and they've been chroot using them for a while now... iirc i've read something like this in the bind system administration manual Fixed in bind-9.9.2.P2-2.mga3. That startup/shutdown script it uses really need to be made more robust though. Status:
NEW =>
RESOLVED |