File: SECURITY

package info (click to toggle)
socat 2.0.0~beta9-1
  • links: PTS
  • area: main
  • in suites: experimental
  • size: 3,740 kB
  • sloc: ansic: 30,875; sh: 11,630; makefile: 149
file content (41 lines) | stat: -rw-r--r-- 1,849 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

Tips for using socat in secured environments:

* Configure socat to only enable the required features, e.g. to protect your
	filesystem from any accesses through socat: 
	make distclean
	./configure --disable-file --disable-creat --disable-gopen \
		 --disable-pipe	--disable-unix --disable-exec --disable-system
	use "socat -V" to see what features are still enabled; see 
	./configure --help  for more options to disable

* Do NOT install socat SUID root or so when you have untrusted users or
unprivileged daemons on your machine, because the full install of socat can
override arbitrary files and execute arbitrary programs!

* Set logging to "-d -d" (in special cases even higher)

* With files, protect against symlink attacks with nofollow (Linux), and
avoid accessing files in world-writable directories like /tmp

* When listening, use bind option (except UNIX domain sockets)

* When listening, use range option (currently only for IP4 sockets)

* When using socat with system, exec, or in a shell script, know what you do

* With system and exec, use absolute pathes or set the path option

* When starting programs with socat, consider using the chroot option (this
requires root, so use the substuser option too).

* Start socat as root only if required; if so, use substuser option
Note: starting a SUID program after applying substuser or setuid gives the
process the SUID owner, which might give root privileges again.

* Socat, like netcat, is what intruders like to have on their victims machine:
once they have gained a toehold they try to establish a versatile connection 
back to their attack base, and they want to attack other systems. For both
purposes, socat could be helpful. Therefore, it might be useful to install
socat with owner/permissions root:socatgrp/750, and to make all trusted users
members of group socatgrp.