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

osquery: add osquery destination as an SCL plugin #1728

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

lbudai
Copy link
Collaborator

@lbudai lbudai commented Oct 20, 2017

Send log messages to osquery's syslog table.
The interface between osquery and syslog-ng is a named pipe (default path is
set in the SCL file, custom value can be set with the pipe() parameter.)

  • Run osqueryi:

osqueryi --enable_syslog --disable-events=false

  • if you want to store the db on disk:
    osqueryi --enable_syslog --disable-events=false --database_path=/tmp/osquery.db

You can check the messages by typing select * from syslog;

  • custom named pipe:
 osqueryi --enable_syslog
          --disable-events=false
          --database_path=/tmp/osquery.db
          --syslog_pipe_path=/tmp/osq.pipe
  • example config:
@version: 3.12
@include "scl.conf"

source s_net {
  network(port(5514));
};

destination d_osquery {
  # custom pipe path:
  #osquery(pipe("/tmp/osq.pipe"));

  # backup outgoing logs:
  #osquery(file("/var/log/osquery_inserts.log" template(t_osquery)));

  # defaults
  osquery();
};

log {
 source(s_net);
 destination(d_osquery);
 flags(flow-control);
};

For more details on osquery and syslog table:
https://osquery.readthedocs.io/en/stable/deployment/syslog/

Signed-off-by: Laszlo Budai laszlo.budai@balabit.com

Send log messages to osquery's syslog table.
The interface between osquery and syslog-ng is a named pipe (default path is
set in the SCL file, custom value can be set with the `pipe()` parameter.)

* Run osqueryi:

`osqueryi --enable_syslog --disable-events=false`

* if you want to store the db on disk:
`osqueryi --enable_syslog --disable-events=false --database_path=/tmp/osquery.db`

You can check the messages by typing `select * from syslog;`

* custom named pipe:
```
 osqueryi --enable_syslog
          --disable-events=false
          --database_path=/tmp/osquery.db
          --syslog_pipe_path=/tmp/osq.pipe
```

* example config:

```
@Version: 3.12
@include "scl.conf"

source s_net {
  network(port(5514));
};

destination d_osquery {
  # custom pipe path:
  #osquery(pipe("/tmp/osq.pipe"));

  # backup outgoing logs:
  #osquery(file("/var/log/osquery_inserts.log" template(t_osquery)));

  # defaults
  osquery();
};

log {
 source(s_net);
 destination(d_osquery);
 flags(flow-control);
};
```

For more details on osquery and syslog table:
https://osquery.readthedocs.io/en/stable/deployment/syslog/

Signed-off-by: Laszlo Budai <laszlo.budai@balabit.com>
@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

1 similar comment
@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

@Kokan Kokan merged commit f1b1bf4 into syslog-ng:master Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants