Releases
Current version
Git/Latestdiff: 1.5.6
Latest Snapshots
Produced after each commit or rebase to new upstream version
GIT
RSBAC source code, can be unstable sometimes
Events
No events planned
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:experiences:igraltist:run-jail [2011/06/30 04:11] – (old revision restored) 127.0.0.1 | wiki:experiences:igraltist:run-jail [2012/07/21 20:01] (current) – (old revision restored) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | [[wiki: | + | [[wiki: |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| ====== run-jail ====== | ====== run-jail ====== | ||
| - | Visit the [[http://hg.kasten-edv.de/ | + | Iam using my own tool to manage |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| + | See the [[http:// | ||
| Line 40: | Line 24: | ||
| </ | </ | ||
| No more futher system modification are nessessary. | No more futher system modification are nessessary. | ||
| + | |||
| + | |||
| + | |||
| Line 50: | Line 37: | ||
| All jail configuration files are place in directory '/ | All jail configuration files are place in directory '/ | ||
| + | Now a python script offer to write a new empty jail definition.\\ | ||
| + | Maybe the name will change in future from this script to create-jail-config.\\ | ||
| + | Just call: | ||
| + | <code bash> | ||
| + | create-jail -c my_config | ||
| + | </ | ||
| + | |||
| + | Or the old way be copy paste:\\ | ||
| Probably the best way to develop a new jail definition file is to start with an empty file like: | Probably the best way to develop a new jail definition file is to start with an empty file like: | ||
| <code bash> | <code bash> | ||
| Line 72: | Line 67: | ||
| To learn how to interpret the log messages to develop a jail policy see [[wiki: | To learn how to interpret the log messages to develop a jail policy see [[wiki: | ||
| + | |||
| + | |||
| + | |||
| Line 151: | Line 149: | ||
| |virtual-user|Use virtual user set.|-V| | |virtual-user|Use virtual user set.|-V| | ||
| |verbose|Verbose output|-v| | |verbose|Verbose output|-v| | ||
| - | |debug|Optional to obtain only the output add debug. This is not a rsbac_jail parameter.|| | ||
| \\ | \\ | ||
| Line 244: | Line 241: | ||
| </ | </ | ||
| - | The above example does not run the application in a chroot. It is not restricted to any particular nework interface. And it allows reads and writes to devices, as well as other network protocols than IPv4. The program is allowed to perform setuid(), setgid(), open low network ports (net-bind-service capability) and to send signals to processes which owned by other users (kill capability). Furthermore it is allowed to read sysctl data and to modify (i.e. set) process resource limits. | + | The above example does not run the application in a chroot. It is not restricted to any particular nework interface. And it allows reads and writes to devices, as well as other network protocols than IPv4. The program is allowed to perform setuid(), setgid(), open low network ports (net-bind-service capability) and to send signals to processes which owned by other users (kill capability).Furthermore it is allowed to read sysctl data and to modify (i.e. set) process resource limits. |
| Line 282: | Line 280: | ||
| or in the init.d file. | or in the init.d file. | ||
| - | As example | + | As example use the postfix init script. Modify it like below: |
| <code bash> | <code bash> | ||
| run-jail pdnsd start-stop-daemon --start --quiet --exec / | run-jail pdnsd start-stop-daemon --start --quiet --exec / | ||
| Line 288: | Line 286: | ||
| Then stop and start the service again. | Then stop and start the service again. | ||
| + | |||
| + | Or just use ping on cmdline: | ||
| + | (the optional parameter --show display the full translated command) | ||
| + | <code bash> | ||
| + | run-jail ping ping heise.de -t 3 --show | ||
| + | </ | ||
| + | |||
| < | < | ||
| Line 293: | Line 298: | ||
| In rsbac-tools there is a tool ps-jail which display processes are in a jail. | In rsbac-tools there is a tool ps-jail which display processes are in a jail. | ||
| - | Or does a: | + | <code bash> |
| + | ps-jail -h | ||
| + | </ | ||
| + | |||
| + | Or do a: | ||
| <code bash> | <code bash> | ||
| cat / | cat / | ||
| Line 316: | Line 325: | ||
| - | ===== Jail-Configurations files ===== | ||
| - | This policies are tested and working so far. | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| Line 346: | Line 332: | ||
| + | |||
| + | |||
| + | ===== Jail-Configurations files ===== | ||
| + | This policies are tested and working so far. | ||
| + | |||
| + | * [[http:// | ||
| Line 364: | Line 356: | ||
| </ | </ | ||
| - | For example, if you want jailed ' | + | |
| + | |||
| + | ====== Jailed local programs for lazy people ===== | ||
| + | For example, if you want jailed ' | ||
| + | The idea behind is simple add a new path to the environ variable PATH and put it on first place. | ||
| + | |||
| + | For this do: | ||
| <code bash> | <code bash> | ||
| - | mkdir /jails | + | mkdir /usr/local/jails |
| </ | </ | ||
| - | The profile must will modified, so that ' | + | The profile must will modified, so that directory |
| - | Therefor I have inserted on begin in the PATH the new jails directory. | + | |
| For example it can looks like | For example it can looks like | ||
| Line 381: | Line 378: | ||
| </ | </ | ||
| - | For updating the path execute: | + | Updating profile: |
| <code bash> | <code bash> | ||
| source / | source / | ||
| </ | </ | ||
| - | Now the ' | + | Now the '/usr/local/jails' directory in the first place to search for an executable |
| Note: The directory | Note: The directory | ||
| Line 393: | Line 390: | ||
| <code bash> | <code bash> | ||
| - | ln -sf /bin/ping /usr/local/jails/ping | + | create-jail -p ping |
| + | </code> | ||
| + | |||
| + | Thats all.\\ | ||
| + | Test it with | ||
| + | |||
| + | <code bash> | ||
| + | ping heise.de --show | ||
| + | </ | ||
| + | |||
| + | Output should be similar like: | ||
| + | <code bash> | ||
| + | /usr/bin/rsbac_jail | ||
| </ | </ | ||
| - | Thats all. | ||
| - | The jail configuration file ' | + | The jail configuration file ' |
| - | When this wrapper | + | When this wrapper |
| [[wiki: | [[wiki: | ||