Commit Graph

50 Commits

Author SHA1 Message Date
4985b9af78 small fixes 2018-06-28 00:23:11 +04:00
aa86048bf2 Improve systemd support, fixing bad practises (#792)
This is now a huge patch but several things has get together or are part
of each other so let me try to explain why I made several changes.

INSTALL.md
==========

systemd
-------

This should work on systems with with systemd like Ubuntu 18.04 or
Debian 9. I did not tested it against anything else.

1. I removed authbind from the dependencies because we have now systemd
for running on ports < 1024.
2. We are running a daemon. That user is not supposed to have a homedir
or even worse to have a shell. For security reasons no /bin/bash.
3. cowrie can and should be installed into /opt. The place on linux
where you put software in when you have no clue where to put it.
4. The virtualenv should not be inside the cowrie directory. That's a
different part of running our service but is not shipped with the code.
So the new path should be /opt/cowrie-env.
5. We want to write as less as possible into /opt keep more the linux
way of writing files of a daemon. TTY logs and downloads should be
stored into /var/lib/cowrie/.
(TODO: the date directory contains still files which should be written
into /var/lib/cowrie instead of data/.)
6. The sweet stuff. Installing configurations for systemd, rsyslog and
logrotate (more details for this later in this commit message)
7. Installing a pre-configured cowrie config for systemd and better
linux integration (TODO: That file should move to /etc/cowrie/cowrie.cfg)
8. How to start cowrie with systemd now
9. How to catch live traffic. I removed the authbind section from it.
Not needed anymore. I also recommend to reconfigure your ssh and cowrie
service to listen on different ports. This is more easier and quicker
then involing iptables/nftables.

no systemd
----------

1. I removed here also the authbind package because it is mentioned
later in the install instructions and I think it should be installed
when the user is really using that feature.
2. The user here will now also be a system user but with a /bin/bash as
shell. Unfortunally the start/stop script needs a bash to work.
That's a security drawback which systemd doesn't have.
3. Changing the path to /opt
4. I didn't wanted to touch the bin/cowrie script so the virtualenv is
still installed below the cowrie directory. I don't really like this
because like above explained we do not ship the code so it should be a
different directory.
5 and 6 not touched
7. If we follow the instructions we are having now the code in
/opt/cowrie where only root can writes into. So some parts needs to have
other permissions to allow reading and writing by cowrie.
8. Start the cowrie daemon with the right user from the root shell.
9. The section port redirecting is IMHO not optional because otherwise
we would not get much traffic. I have seen people knocking on port 2222
but cowrie should get the traffic from the ssh port.
I also added a note for non experienced users when dealing with the
pre-routing iptables rules.

Configfiles
===========

systemd socket
--------------
Systemd handles now the sockets for port binding. No authbind or other
dirty hacks needed anymore.

systemd service
---------------
Systemd also handles now the service. It takes care that every
dependency is up before cowrie is started. No supervisord needed anymore

rsyslog
-------
Logfiles are now written into /var/log/cowrie. Also the json file can be
logged here into. Permissions are set that cowrie can also writes into
the directory.

logrotate
---------
Every week we rotate the logfiles in /var/log/cowrie and store 4
compressed log files of it before deleting them.
2018-06-28 00:14:12 +04:00
558bd2a6e0 document pre-post login banner 2018-06-23 17:06:51 +00:00
ab83da8978 add Py3 virtenv and other changes 2017-12-26 10:18:07 +04:00
43eb51beba Add updating instructions 2017-12-13 09:09:36 +00:00
5083bc4b24 Expanded MySQL Documentation (#605) (#637)
* Expanded MySQL Output Plugin Documentation

Per issue #605, I have updated the MySQL documentation for more clarity and updated requirements-output.txt.  I also added a small section in INSTALL.md to mention output plugins and where to find more information.

* Expanded MySQL Output Plugin Documentation

Per issue #605, I have updated the MySQL documentation for more clarity and updated requirements-output.txt.  I also added a small section in INSTALL.md to mention output plugins and where to find more information.

* Expanded MySQL Output Plugin Documentation

Per issue #605, I have updated the MySQL Installation README.md for more clarity and updated.  I also added a small section in INSTALL.md to mention output plugins and where to find more information.
2017-11-28 10:50:36 +04:00
c47613dcd9 need extra pip upgrade 2017-11-13 10:02:46 +04:00
499d41a64e Fix #618 add --upgrade flag to pip 2017-11-13 04:16:17 +04:00
f1e52cfd2d Remove libmpc / libmpfr no longer required with new Twisted 2017-07-25 10:33:24 +04:00
9ef5251d87 Latest version no longer use PyCrypto 2017-07-25 09:45:17 +04:00
e90c5f9024 Minor fix to INSTALL.md, fixed links (#526) 2017-06-02 10:08:37 +04:00
1158a1a55e now use both cowrie.cfg.dist and cowrie.cfg 2017-05-17 16:28:13 +04:00
55105582cb more changes to start/stop 2017-03-07 19:17:30 +00:00
8f34dd768f describe new start method 2017-03-07 19:12:02 +00:00
807f457829 virtualenv -> python-virtualenv 2017-03-05 20:24:25 +00:00
ce2b08bbae remove double #3, add authbind dependency 2017-03-05 20:21:32 +00:00
1cf7e02fe1 rename OSX references to MacOS 2017-02-14 22:16:29 +04:00
1a462eafe6 Documentation and start script changes to assist with supervisord usage (#346)
* * Updating start script to run in the foreground when using supervisord.
* Update install documentation to reference use of supervisord and install on OSX

* Updating index of INSTALL.md to with reference to supervisord

* Adding slack output and db

* Restoring start.sh back to default of AUTHBIND_ENABLED=no and DAEMONIZE=no

* Updating with pretty formatting of json dump
2016-12-20 11:15:28 +04:00
30d08f6347 Fix Setup Virtual Environment anchor in install doc (#377) 2016-12-15 12:05:29 +04:00
82e3b1fccd remove non-virtual environment from install doc 2016-12-11 15:40:00 +04:00
1f0e9a583f document authbind for telnet 2016-10-28 05:38:43 +00:00
3bd2069f85 Merge branch 'master' of https://github.com/micheloosterhof/cowrie 2016-10-25 18:47:39 +00:00
f2ee269a30 add python2.7-minimal to requirements 2016-10-25 18:47:15 +00:00
6289ae5b6f Tiny improvements for the documentation (fixing anchor links) (#317) 2016-10-25 22:43:49 +04:00
45022b7f0e add service_identity to debian package based install 2016-10-18 05:20:04 +00:00
c2b8090315 add RSA key workaround 2016-09-28 22:51:34 +04:00
87bc9237ee add note about raspberry pi installation (#236) 2016-09-05 01:12:32 +04:00
803f91e91e small tweaks 2016-09-05 01:00:00 +04:00
6fd4e43c59 formatting in README 2016-09-04 21:23:49 +04:00
d42ac579c4 rewrite of install instructions (#235)
* untested improvements to Install.md

* fixed missing pycrypto in requirements.txt

* table of contents

* removing citation

* beautification

* remove red hat instructions (they were wrong)

* PYTHONPATH might need to be set regardless

* bugfix

* reorganize, sweeping improvements

* finishing touches
2016-08-31 22:31:12 +04:00
645f4fe6e5 add configparser dependency 2016-08-20 08:22:23 +00:00
57bb3bc886 put pip reqs in requirements.txt 2016-07-28 15:10:04 +04:00
ccdc056d50 fix #214 2016-07-28 14:47:30 +04:00
89e1dc81f4 rename example venv to "cowrie-env" 2016-07-10 12:48:48 +04:00
99f55e449d move install instructions to INSTALL.md. Update preqreq 2016-06-19 13:39:09 +00:00
3d4e782aaa typo fix 2016-06-16 16:21:59 +04:00
fdfa04d7fb few fixes 2016-06-01 22:13:27 +04:00
83e7c6824f virtual env instructions 2016-06-01 22:09:44 +04:00
84930ca654 install.md reformat 2016-04-27 12:38:05 +04:00
4de3455bde explicitly set umask and document effect 2016-04-26 15:16:49 +00:00
c63339ba65 document python-mysqldb dependency 2016-04-14 13:37:36 +04:00
457603c59c updates 2016-02-04 05:45:17 +00:00
052293684d explicitly cover preqeqs 2016-02-04 05:40:28 +00:00
c45caf7f37 authbind docs 2016-01-17 10:32:35 +04:00
4af745d3fd remove unnecesary line 2015-11-19 13:17:29 +00:00
acac82020b document workaround for TypeError: must be long, not mpz 2015-09-12 09:47:21 +00:00
4d48992305 small fix 2015-06-23 08:20:12 +00:00
8a419c3e4f cosmetic changes on install.md 2015-05-12 15:22:15 +00:00
09187ed757 better install instructions 2015-05-12 15:20:51 +00:00
2037e71c08 install 2015-05-12 15:17:42 +00:00