- WS-Management answers are parsed with defusedxml (new dependency, defusedxml>=0.7) with DTDs forbidden. The check for "<!DOCTYPE" in the raw bytes it replaces missed a DTD in a UTF-16 answer, which expat reads too; on plain HTTP (16992) anyone in the path can send one. An answer with a DTD in any encoding is now refused as no WS-Management answer, as a UTF-8 one already was (B314, B405). - xml.sax.saxutils only escapes the request envelopes, nothing parses with SAX (nosec B406). - python -m napalm_amt.record fetches the landing page without certificate checks, as before: it sends no credentials and records what discovery sees, and AMT's certificate is self-signed unless one was provisioned (nosec B501). The driver itself still verifies by default (verify_ssl).
64 lines
1.4 KiB
TOML
64 lines
1.4 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=64"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "napalm-amt"
|
|
version = "0.1.1"
|
|
description = "NAPALM driver for Intel Active Management Technology (AMT) over WS-Management"
|
|
readme = "README.md"
|
|
license = { file = "LICENSE" }
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"napalm>=5.0",
|
|
# Not on PyPI: install from git before this package (see README).
|
|
"napalm-device-types>=4.16",
|
|
"requests>=2.31",
|
|
"defusedxml>=0.7",
|
|
]
|
|
classifiers = [
|
|
"License :: OSI Approved :: Apache Software License",
|
|
"Programming Language :: Python :: 3",
|
|
"Topic :: System :: Hardware",
|
|
"Topic :: System :: Networking",
|
|
]
|
|
|
|
[project.urls]
|
|
Repository = "https://git.netork.io/NAPALM/napalm-amt"
|
|
|
|
[project.optional-dependencies]
|
|
test = [
|
|
"pytest>=7",
|
|
"responses>=0.23",
|
|
]
|
|
|
|
[project.entry-points."napalm.drivers"]
|
|
amt = "napalm_amt:AmtDriver"
|
|
|
|
[tool.setuptools.packages.find]
|
|
include = ["napalm_amt*"]
|
|
|
|
[tool.setuptools.package-data]
|
|
napalm_amt = ["py.typed"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py310"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# Recorded device output keeps its lines.
|
|
"tests/**" = ["E501"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.10"
|
|
strict = true
|
|
ignore_missing_imports = true
|
|
# napalm itself is untyped, so every driver subclasses Any.
|
|
disallow_subclassing_any = false
|