Skip to content

Commit

Permalink
Add support for targetd agent to acquire (DIS-2522).
Browse files Browse the repository at this point in the history
  • Loading branch information
cecinestpasunepipe committed Oct 20, 2023
1 parent 7d40982 commit 84da0fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,21 @@ def main() -> None:
except ValueError as err:
parser.exit(err)

if args.targetd:
from targetd.tools.targetd import start_client

Check warning on line 2170 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L2169-L2170

Added lines #L2169 - L2170 were not covered by tests

# Configure your targetd agent here
config = {

Check warning on line 2173 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L2173

Added line #L2173 was not covered by tests
"function": "agent",
"topics": ["/host/a", "/host/*"],
"link": "pipe-server://tmp/b",
"address": "10.0.2.3",
"port": 1884,
"cacert": Path("targetd.crt"),
}
start_client(args, presets=config)
parser.exit("Done")

Check warning on line 2182 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L2181-L2182

Added lines #L2181 - L2182 were not covered by tests

if args.log_to_dir:
# When args.upload files are specified, only these files are uploaded
# and no other action is done. Thus a log file specifically named
Expand Down
5 changes: 5 additions & 0 deletions acquire/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def create_argument_parser(profiles: dict, modules: dict) -> argparse.ArgumentPa
action="store_true",
help="compress output (if supported by the output type)",
)
parser.add_argument(
"--targetd",
action="store_true",
help="Setup and install targetd agent",
)
parser.add_argument(
"--encrypt",
action="store_true",
Expand Down

0 comments on commit 84da0fc

Please sign in to comment.