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

Implement RFC Config #307 #311

Merged
merged 2 commits into from
Jun 28, 2022
Merged
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
63 changes: 63 additions & 0 deletions RFCs/2022-06-23-307-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# pktvisor Config

## Status
**Experimental**: implemented and available for beta testing but the interface may still change

## Summary

Pktvisord binary allows multiple [command line arguments](https://github.com/ns1labs/pktvisor#agent-usage) on its start up. Almost all the parameters can be passed to pktvisord
via yaml configuration file. Config file can also be combined with command line arguments.

Moreover, the config file has a feature to allow setup of global configuration for specific handlers (`global_handler_config`).
The configuration set for a specific handler in this tag will be applied to every handler created in this agent which has the same specified type.


`config.yaml`

```yaml
version: "1.0"

visor:
# visor/config supports almost all pktvisord command line arguments
config:
verbose: true
daemon: false
no_track: true
max_deep_sample: 50
periods: 3
syslog: false
log_file: "/path/to/logfile"
prometheus: false
prom_instance: "prom-ID"
geo_city: "/path/to/geoCityDB"
geo_asn: "/path/to/geoASNDB"
admin_api: true
tls: false
port: 10853
host: localhost
tls_cert: "/path/to/tlsCert"
tls_key: "/path/to/tlsKey"
module_list: false
module_dir: "/path/to/moduleDir"
cp_disable: true
cp_token: "crashpadToken"
cp_url: "crashpadURL"
cp_path: "/path/to/crashpad/executable"
#configuration inserted here will be applied to every specified handler in the agent provisioned with this config file
global_handler_config:
#specifies a global configuration for DNS handlers
dns:
#if a policy with a DNS handler specifies different value for 'only_rcode', this global config will be overwritten
only_rcode: 2

```

## REST API

Config setup is only allowed at start up. Therefore, it is not supported on the REST API.

## Standalone Command Line Example

```shell
$ pktvisord --config config.yaml
```