Skip to content

Commit

Permalink
DOC+ENH: backend: save positions of bots
Browse files Browse the repository at this point in the history
needed for #117
  • Loading branch information
Sebastian Wagner committed Aug 22, 2017
1 parent 76dfe97 commit 890b1a3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ CHANGELOG
* drag&drop (#105, #41)
* fix #96
* save buttons starts blinking after changes (#41)
* Allow redrawing of botnet on demand
* Save/load position of bots in/from /opt/intelmq/etc/manager/positions.conf
File needs to be writeable

### Management
* Reload and restart have been added as actions on bots and the whole botnet (#114)
Expand Down
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ See the changelog for a full list of changes.

0.2.2 (unreleased)
------------------
No changes are required by administrators.
* The IntelMQ Manager is now capable of saving the positions of bots.
You need to create the file `/opt/intelmq/etc/manager/positions.conf` and
allow the webserver process to write to it, e.g.:
```bash
mkdir /opt/intelmq/etc/manager/
touch /opt/intelmq/etc/manager/positions.conf
chgrp www-data /opt/intelmq/etc/manager/positions.conf
chmod g+w /opt/intelmq/etc/manager/positions.conf
```
6 changes: 4 additions & 2 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ chown -R www-data.www-data /var/www/html/
Add the webserver user (www-data, wwwrun, apache or nginx) to the intelmq group and give write permissions for the configuration files:
```bash
usermod -a -G intelmq www-data
chgrp www-data /opt/intelmq/etc/*.conf
chmod g+w /opt/intelmq/etc/*.conf
mkdir /opt/intelmq/etc/manager/
touch /opt/intelmq/etc/manager/positions.conf
chgrp www-data /opt/intelmq/etc/*.conf /opt/intelmq/etc/manager/positions.conf
chmod g+w /opt/intelmq/etc/*.conf /opt/intelmq/etc/manager/positions.conf
```

Give webserver user (www-data, wwwrun, apache or nginx) permissions to execute intelmqctl as intelmq user. Edit the `/etc/sudoers` file and add the adapted following line:
Expand Down
3 changes: 2 additions & 1 deletion intelmq-manager/php/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
'harmonization' => '/opt/intelmq/etc/harmonization.conf',
'pipeline' => '/opt/intelmq/etc/pipeline.conf',
'runtime' => '/opt/intelmq/etc/runtime.conf',
'system' => '/opt/intelmq/etc/system.conf'
'system' => '/opt/intelmq/etc/system.conf',
'positions' => '/opt/intelmq/etc/manager/positions.conf',
);

$CONTROLLER = "sudo -u intelmq /usr/local/bin/intelmqctl --type json %s";
Expand Down
2 changes: 1 addition & 1 deletion intelmq-manager/php/save.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

$decoded_config = json_decode($post_contents);

if($_GET['file'] != 'defaults') {
if($_GET['file'] != 'defaults' && $_GET['file'] != 'positions') {
foreach ($decoded_config as $key => $value) {
if(preg_match($BOT_ID_REJECT_REGEX, $key) && (strcmp($key, "__default__") !== 0)) {
die('Invalid bot ID');
Expand Down

0 comments on commit 890b1a3

Please sign in to comment.