From 909271718e73a5cb4db2eaa652e8a1116028b247 Mon Sep 17 00:00:00 2001 From: Leonardo Parente Date: Tue, 28 Jun 2022 18:32:55 -0400 Subject: [PATCH] Implement RFC Config #307 (#311) --- RFCs/2022-06-23-307-config.md | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 RFCs/2022-06-23-307-config.md diff --git a/RFCs/2022-06-23-307-config.md b/RFCs/2022-06-23-307-config.md new file mode 100644 index 000000000..cdbe62adc --- /dev/null +++ b/RFCs/2022-06-23-307-config.md @@ -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 +```