Page MenuHomeFreeBSD

Infrastructure for automatic jailing of rc.d-services
ClosedPublic

Authored by netchild on Jun 1 2023, 8:53 AM.
Referenced Files
Unknown Object (File)
Tue, Nov 19, 1:45 AM
Unknown Object (File)
Tue, Nov 19, 1:44 AM
Unknown Object (File)
Mon, Nov 11, 7:17 AM
Unknown Object (File)
Mon, Nov 11, 7:17 AM
Unknown Object (File)
Sat, Nov 2, 10:16 AM
Unknown Object (File)
Thu, Oct 24, 2:59 AM
Unknown Object (File)
Oct 17 2024, 10:12 PM
Unknown Object (File)
Oct 15 2024, 12:43 AM

Details

Summary

The man-page contains a reference to behavior of auto-jailing of sshd which requires a change which is not in this patch (but is in another review).

---This implementation depends upon a change for /usr/bin/service which is in https://reviews.freebsd.org/D40369--- committed

This takes a rc.d-service and starts it in a jail which shares the same root-path as the host (or parent jail) and may inherit the network from the host (or parent jail). Per service there is the possibility to specify some arguments which gives more permissions (e.g. netv4, netv6, sysvipc...).

See the included man page update for more info about the functionality.

Do we want to print "Starting svcj-name." instead of "Starting name." when starting services as a svcj, and similar for stop?

Test Plan

I did very light testing of hierarchic jails (auto-jailing inside a jail). For hierarchic jails you need to specify the children.max parameter for the non-automatic jails, as the default doesn't allow it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

netchild created this revision.
libexec/rc/rc.subr
1153

This is not indended correctly as I had this as some kind of debugging info initially. My question here would be if we want to have it as some kind of information (with some other wording, as the execution is not skipped, but done on the host and not inside the service-jail), or if I shall write in the man-page that non-standard commands (e.g. configtest for apache/nginx/postfic/...) will be executed outside of the service-jail and remove this information here?

libexec/rc/rc.subr
379

Note to myself: typo "svj-jail"

Two fixes for the man page.

share/man/man5/rc.conf.5
402

s/explicitely/explicitly/

4960

You need to do a line break after a sentence stop.

netchild set the repository for this revision to rG FreeBSD src repository.

Change what was noticed in comments. Add a feature to enable the execution of extra commands inside the service jail.

netchild edited the summary of this revision. (Show Details)

Add support for nfs. Sort the options.

OK for the man page change. Make sure to bump the .Dd when you commit it for this content change.
Thanks for working on this, it's appreciated!

This revision is now accepted and ready to land.Jan 11 2024, 1:20 PM
This revision was automatically updated to reflect the committed changes.