-
Notifications
You must be signed in to change notification settings - Fork 54
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
Update openvpn configuration parsing #556
Conversation
Miauwkeru
commented
Feb 27, 2024
- Process default dirs in IIS plugin (IIS plugin does not process logs in default dir without ApplicationHo… #549)
- Fix issues OpenVPN parsing
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #556 +/- ##
==========================================
+ Coverage 74.02% 74.03% +0.01%
==========================================
Files 285 285
Lines 23578 23600 +22
==========================================
+ Hits 17454 17473 +19
- Misses 6124 6127 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dissect/target/helpers/configutil.py
Outdated
@@ -228,6 +228,50 @@ def parse_file(self, fh: TextIO) -> None: | |||
self.parsed_data = information_dict | |||
|
|||
|
|||
class OpenVPN(Default): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an application specific parser, I'm not sure it belongs in this file. Is there no way to achieve something similar with this being in the openvpn.py
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just use that parser directly in that case. I will move it... as it is very specific
|
||
def check_compatible(self) -> None: | ||
if not self.configs: | ||
raise UnsupportedPluginError("No OpenVPN configuration files found") | ||
|
||
@export(record=[OpenVPNServer, OpenVPNClient]) | ||
def config(self) -> Iterator[Union[OpenVPNServer, OpenVPNClient]]: | ||
@arg("--export-key", action="store_true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm divided on whether this is necessary. Maybe poll this within the (FIR) team?
@@ -15,6 +18,7 @@ | |||
("string", "ca"), | |||
("string", "cert"), | |||
("string", "key"), | |||
("boolean", "redacted"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
("boolean", "redacted"), | |
("boolean", "key_redacted"), |
Maybe makes it a little bit clearer?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #556 +/- ##
==========================================
+ Coverage 74.02% 74.53% +0.50%
==========================================
Files 285 286 +1
Lines 23578 23673 +95
==========================================
+ Hits 17454 17644 +190
+ Misses 6124 6029 -95
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
from os.path import basename | ||
from typing import Iterator, Union | ||
from itertools import product | ||
from typing import Iterable, Iterator, Union |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Iterable, Iterator, Union | |
from typing import Iterable, Iterator, Optional, Union |
Added options for inline files Added specific ConfigurationParser for it Added options for both .conf and .ovpn
Co-authored-by: Erik Schamper <[email protected]>
1746a40
to
6b2d528
Compare
--------- Co-authored-by: Erik Schamper <[email protected]>