Removing UID 0 check

Cowrie checked on startup if it was started with root privileges.
This conflicts with the option to let cowrie drop his privileges on
startup using the twisted option `--uid` and `--gid`.

I tested it a day ago without removing the code block and it run through
but now it is for some reasons blocking. My feeling is that the code for
droping privileges is also asynchron and sometimes the check is faster
then the dropping of the privileges. But I might be wrong here.

The solution is to remove the hole check.
Considering that the check is there for preventing new users to shoot
their feet we fixed this problem on different levels.
New users should the docker images which are far easier to control and
deploy then everything else because we take care.
If a user wants to deploy it from scratch onto their serves there is a
install instruction with detailed steps. This steps includes creating a
special system user for cowrie and starting it with this user.
This commit is contained in:
Florian Pelgrim
2018-07-24 11:25:20 +02:00
parent 1ef53c27f6
commit f76329cd79

View File

@ -115,10 +115,6 @@ Makes a Cowrie SSH/Telnet honeypot.
""")
sys.exit(1)
if os.name == 'posix' and os.getuid() == 0:
print('ERROR: You must not run cowrie as root!')
sys.exit(1)
log.msg("Python Version {}".format(str(sys.version).replace('\n', '')))
log.msg("Twisted Version {}.{}.{}".format(__version__.major, __version__.minor, __version__.micro))