dissect.target.plugins.apps.vpn.openvpn¶
Module Contents¶
Classes¶
Parse a configuration file specified by |
|
OpenVPN configuration parser. |
Attributes¶
- dissect.target.plugins.apps.vpn.openvpn.COMMON_ELEMENTS = [('string', 'name'), ('string', 'proto'), ('string', 'dev'), ('string', 'ca'), ('string',...¶
- dissect.target.plugins.apps.vpn.openvpn.OpenVPNServer¶
- dissect.target.plugins.apps.vpn.openvpn.OpenVPNClient¶
- class dissect.target.plugins.apps.vpn.openvpn.OpenVPNParser(*args, **kwargs)¶
Bases:
dissect.target.helpers.configutil.DefaultParse a configuration file specified by
separatorandcomment_prefixes.This parser splits only on the first
separatorit finds:key<separator>value -> {"key": "value"} key<separator>value continuation -> {"key": "value continuation"} # Unless we collapse values, we add them to a list to not overwrite any values. key<separator>value1 key<separator>value2 -> {key: [value1, value2]} <empty_space><comment> -> skip
- boolean_field_names¶
- parse_file(fh: io.TextIOBase) None¶
Parse the contents of
fhinto key/value pairs.This function should set
parsed_dataas a side_effect.- Parameters:
fh – The text to parse.
- class dissect.target.plugins.apps.vpn.openvpn.OpenVPNPlugin(target: dissect.target.target.Target)¶
Bases:
dissect.target.plugin.PluginOpenVPN configuration parser.
References
man (8) openvpn
- __namespace__ = 'openvpn'¶
Defines the plugin namespace.
- config_globs = ('/etc/openvpn/', 'sysvol/Program Files/OpenVPN/config/')¶
- user_config_paths: Final[dict[str, list[str]]]¶
- configs: list[dissect.target.helpers.fsutil.TargetPath] = []¶
- check_compatible() None¶
Perform a compatibility check with the target.
This function should return
Noneif the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise anUnsupportedPluginError.- Raises:
UnsupportedPluginError – If the plugin could not be loaded.
- config(export_key: bool = False) collections.abc.Iterator[OpenVPNServer | OpenVPNClient]¶
Parses config files from openvpn interfaces.