Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis config #370

Merged
merged 3 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ configure_file (doc/Doxyfile.in doc/Doxyfile @ONLY)
configure_file (doc/Doxyfile_full.in doc/Doxyfile_full @ONLY)
configure_file (doc/Doxyfile_xml.in doc/Doxyfile_xml @ONLY)
configure_file (doc/openvas.8.in doc/openvas.8 @ONLY)
configure_file (doc/redis_config_examples/redis_3_2.conf.in doc/redis_config_examples/redis_3_2.conf @ONLY)
configure_file (doc/redis_config_examples/redis_4_0.conf.in doc/redis_config_examples/redis_4_0.conf @ONLY)
configure_file (VERSION.in VERSION @ONLY)
configure_file (tools/greenbone-nvt-sync.in tools/greenbone-nvt-sync @ONLY)
configure_file (src/openvas_log_conf.cmake_in src/openvas_log.conf)
Expand Down
19 changes: 9 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,15 @@ Setting up an openvas requires the following steps:
gathered on the scanned hosts. Redis 3.2 and newer are supported.
See `doc/redis_config.txt` to see how to set up and run a Redis server.

Multiple examples for various Redis versions are installed which you may use
directly for a quick start:

redis-server <install-prefix>/share/doc/openvas/redis_config_examples/redis_3_2.conf

or

redis-server <install-prefix>/share/doc/openvas/redis_config_examples/redis_4_0.conf

or copy the example to another location, edit and use the copy instead.
The easiest and most reliable way to start redis under Ubuntu and Debian is
to use systemd.

```bash
sudo cp redis-openvas.conf /etc/redis/
sudo chown redis:redis /etc/redis/redis-openvas.conf
sudo echo "db_address = /run/redis-openvas/redis.sock" > /etc/openvas/openvas.conf
sudo systemctl start redis-server@openvas.service
```

4. The scanner module does not run as a service as before any more. `gvmd`
can act as a client and control the scanner through the `OSPD-OpenVAS`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Redis 3.2 configuration file example for OpenVAS.
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
Expand Down Expand Up @@ -98,8 +98,8 @@ tcp-backlog 511
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
unixsocket /tmp/redis.sock
unixsocketperm 700
unixsocket /run/redis-openvas/redis.sock
unixsocketperm 770

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
Expand Down Expand Up @@ -147,7 +147,7 @@ supervised no
#
# Creating a pid file is best effort: if Redis is not able to create it
# nothing bad happens, the server will start and run normally.
pidfile @LOCALSTATEDIR@/run/openvas-redis.pid
pidfile /run/redis-openvas/redis-server.pid

# Specify the server verbosity level.
# This can be one of:
Expand Down Expand Up @@ -175,7 +175,7 @@ syslog-enabled yes
# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 513
databases 1025

################################ SNAPSHOTTING ################################
#
Expand Down
8 changes: 4 additions & 4 deletions doc/redis_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ OpenVAS can currently only access redis via a unix socket. This choice has been
made for the sake of speed and security. No authentication is supported yet, we
rely on filesystem permissions to protect the KBs.

The path to the unix socket is '/tmp/redis.sock' by default, and can be changed
using the 'db_address' parameter.
The path to the unix socket is '/run/redis-openvas/redis.sock' by default, and
can be changed using the 'db_address' parameter.

On the redis side, use the following directives:

port 0 # prevent redis from listening on a TCP socket
unixsocket /tmp/redis.sock
unixsocketperm 700
unixsocket /run/redis-openvas/redis.sock
unixsocketperm 770
timeout 0

== Database number ==
Expand Down
Loading