Skip to content

refactor(nmap): replace the use of jc (CLI) with the use of jc (python library) / lxml (python library) #273

@guzmud

Description

@guzmud

Use case

Currently the nmap injector relies on executing two subprocesses: calling nmap then calling jc (to parse the tool). jc happens to also be a Python library that could directly be called without going through subprocess (and managed through python packaging rather than linux packaging).

Plus, jc relies mainly on xmltodict and some YAML library that haven't been updatd in a while.
Plus², XML parsing can be quite dangerous in python (cf. defusedxml and lxml) so moving away from jc to have more control about the XML parsing could provided a safer code.

Current situation

Calling a Python tool as a CLI through subprocess

Proposed solution

Calling a Python library directly from the codebase (either keeping jc as the tool or replacing it with a more hands-on XML parser like lxml)

Metadata

Metadata

Assignees

Labels

tech foundationTechnical refactor or improvement is needed
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions