Skip to content

Commit

Permalink
Implement RFC Config #307 (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Parente committed Jun 28, 2022
1 parent fbcfbb8 commit 9092717
Showing 1 changed file with 63 additions and 0 deletions.
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
```

0 comments on commit 9092717

Please sign in to comment.