|
3 | 3 | SPDX-License-Identifier: AGPL-3.0-or-later |
4 | 4 |
|
5 | 5 | ########### |
6 | | -Intelmq Api |
| 6 | +IntelMQ API |
7 | 7 | ########### |
8 | 8 |
|
9 | | -intelmq-api is a `hug <http://hug.rest>`_ based API for the `intelmq <https://github.com/certtools/intelmq/>`_ project. |
| 9 | +`intelmq-api` is a `hug <http://hug.rest>`_ based API for the `IntelMQ <https://github.com/certtools/intelmq/>`_ project. |
| 10 | + |
| 11 | +.. contents:: |
10 | 12 |
|
11 | 13 | ********************************** |
12 | 14 | Installing and running intelmq-api |
13 | 15 | ********************************** |
14 | 16 |
|
15 | | -``intelmq-api`` requires the IntelMQ package to be installed on the system (it uses ``intelmqctl`` to control the botnet). |
| 17 | +`intelmq-api` requires the IntelMQ package to be installed on the system (it uses ``intelmqctl`` to control the botnet). |
16 | 18 |
|
17 | 19 | You can install the ``intelmq-api`` package using your preferred system package installation mechanism or using the ``pip`` Python package installer. |
18 | | -We provide packages for the ``intelmq-api`` for the same operating systems as we do for the ``intelmq`` package itself. |
| 20 | +We provide packages for the `intelmq-api` for the same operating systems as we do for the `intelmq` package itself. |
| 21 | +For the list of supported distributions, please see the intelmq :doc:`installation` page. |
| 22 | + |
19 | 23 | Our repository page gives `installation instructions for various operating systems <https://software.opensuse.org/download.html?project=home:sebix:intelmq&package=intelmq-api>`_. |
| 24 | +No additional set-up steps are needed if you use these packages. |
20 | 25 |
|
21 | | -The ``intelmq-api`` packages ship a configuration file in ``${PREFIX}/etc/intelmq/api-config.json``, a virtualhost configuration file for Apache 2 in ``${PREFIX}/etc/intelmq/api-apache.conf`` and a sudoers configuration file in ``${PREFIX}/etc/intelmq/api-sudoers.conf``. |
22 | | -The value of ``${PREFIX}`` depends on your installation method- with distribution packages it is simply ``/``, when using pip (as root) it is ``/usr/local/lib/pythonX.Y/dist-packages/`` (where ``X.Y`` is your Python version. |
23 | | -Some distribution packages already create a symlink to the sudoers file in the sudoers.d configuration directory and a symlink in the relevant Apache configuration directory to the Apache configuration file, so it should be easy to enable that (i.e. by using ``a2ensite intelmq-api`` on Debian based systems). |
| 26 | +The `intelmq-api` provides the route ``/api`` for managing the IntelMQ installation. |
24 | 27 |
|
25 | | -But for development purposes and testing you can also run ``intelmq-api`` directly using ``hug``: |
| 28 | +For development purposes and testing you can also run `intelmq-api` directly using ``hug``: |
26 | 29 |
|
27 | 30 | .. code-block:: bash |
28 | 31 |
|
29 | 32 | hug -m intelmq_api.serve |
30 | 33 |
|
| 34 | +Installation using pip |
| 35 | +^^^^^^^^^^^^^^^^^^^^^^ |
| 36 | + |
| 37 | +The `intelmq-api` packages ship a configuration file in ``${PREFIX}/etc/intelmq/api-config.json``, a positions configuration for the manager in ``{PREFIX}/etc/intelmq/manager/positions.conf``, a virtualhost configuration file for Apache 2 in ``${PREFIX}/etc/intelmq/api-apache.conf`` and a sudoers configuration file in ``${PREFIX}/etc/intelmq/api-sudoers.conf``. |
| 38 | +The value of ``${PREFIX}`` depends on your environment and is something like ``/usr/local/lib/pythonX.Y/dist-packages/`` (where ``X.Y`` is your Python version). |
| 39 | + |
| 40 | +The file ``${PREFIX}/etc/intelmq/api-apache.conf`` needs to be placed in the correct place for your Apache 2 installation. |
| 41 | + - On Debian and Ubuntu, move the file to ``/etc/apache2/conf-available.d/manager-apache.conf`` and then execute ``a2enconf manager-apache``. |
| 42 | + - On CentOS, RHEL and Fedora, move the file to ``/etc/httpd/conf.d/``. |
| 43 | + - On openSUSE, move the file to ``/etc/apache2/conf.d/``. |
| 44 | +Don't forget to reload your webserver afterwards. |
| 45 | + |
| 46 | +- The file ``${PREFIX}/etc/intelmq/api-config.json`` needs to be moved to ``/etc/intelmq/api-config.json``. |
| 47 | +- The file ``${PREFIX}/etc/intelmq/manager/positions.conf`` needs to be moved to ``/etc/intelmq/manager/positions.conf``. |
| 48 | +- Last but not least move the file ``${PREFIX}/etc/intelmq/api-sudoers.conf`` to ``/etc/sudoers.d/01_intelmq-api`` and adapt the webserver user name in this file. Set the file permissions to ``0o440``. |
| 49 | + |
| 50 | +Afterwards continue with the section Permissions below. |
31 | 51 |
|
32 | | -The ``intelmq-api`` provides the route ``/api`` for managing the ``intelmq`` installation. |
| 52 | +IntelMQ 2.3.1 comes with a tool ``intelmqsetup`` which performs these set-up steps automatically. |
| 53 | +Please note that the tool is very new and may not detect all situations correctly. Please report us any bugs you are observing. |
| 54 | +The tools is idempotent, you can execute it multiple times. |
33 | 55 |
|
34 | 56 | *********************** |
35 | 57 | Configuring intelmq-api |
|
0 commit comments