Skip to content

Commit 96161d0

Browse files
Merge pull request #14 from OpenSecFlow/feat/optimize-pool-lock
Optimize the pool lock to session key lock
2 parents dbf847b + 9d3725e commit 96161d0

File tree

9 files changed

+293
-150
lines changed

9 files changed

+293
-150
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: Create a report to help us improve netdriver
4+
title: '[Bug]: '
5+
labels: 'bug'
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps or code snippets to reproduce the behavior:
14+
1. Connection protocol used (e.g., SSH) '...'
15+
2. Device info (e.g., Cisco ASA 9.6.0)
16+
3. Code snippet executed '...'
17+
4. The resulting error '...'
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Logs/Traceback**
23+
If applicable, add full logs or tracebacks to help explain your problem. **(Note: Please mask any passwords, keys, public IP addresses, or sensitive configurations)**
24+
25+
```text
26+
# Paste code or logs here
27+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: 💡 Feature Request
3+
about: Suggest an idea or new device support for netdriver
4+
title: '[Feature]: '
5+
labels: 'enhancement'
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. "I'm always frustrated when I can't directly parse the configuration output of [Specific Vendor] devices..."
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen. Providing expected API usage or pseudocode is highly appreciated.
14+
15+
```python
16+
# Expected API design example
17+
device = netdriver.connect(...)
18+
result = device.do_something_new()
19+
```

.vscode/settings.json

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,13 @@
1010
"**/.pytest_cache": true,
1111
".venv": true,
1212
},
13+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
1314
"python.analysis.autoImportCompletions": true,
14-
"python.analysis.extraPaths": [
15-
"${workspaceFolder}/bases",
16-
"${workspaceFolder}/components",
17-
"${workspaceFolder}/development"
18-
],
1915
"python.autoComplete.extraPaths": [
20-
"${workspaceFolder}/bases",
21-
"${workspaceFolder}/components",
22-
"${workspaceFolder}/development"
23-
],
24-
"pylint.args": [
25-
"--disable=C0114",
26-
"--disable=C0115",
27-
"--disable=C0116",
28-
"--disable=C0209",
29-
"--disable=C0301",
30-
"--disable=C0415",
31-
"--disable=W0221",
32-
"--disable=W0613",
33-
"--disable=W0718",
34-
"--disable=W1203",
35-
"--disable=R0903",
36-
"--disable=E1101",
16+
"${workspaceFolder}/packages",
3717
],
18+
"python.testing.pytestEnabled": true,
19+
"python.testing.unittestEnabled": false,
3820
"python.testing.pytestArgs": [
3921
"-s",
4022
"-v",
@@ -43,7 +25,4 @@
4325
"packages/agent/tests",
4426
"packages/core/tests",
4527
],
46-
"python.testing.unittestEnabled": false,
47-
"python.testing.pytestEnabled": true,
48-
"python.defaultInterpreterPath": ".venv/bin/python3"
4928
}

SECURITY.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | --------- |
7+
| 0.4.x | Yes |
8+
| < 0.4 | No |
9+
10+
## Reporting a Vulnerability
11+
12+
If you discover a security vulnerability in NetDriver, **please do not open a public GitHub issue**.
13+
14+
Instead, report it via one of the following channels:
15+
16+
- **Email**: Send details to the maintainers at the addresses listed in `pyproject.toml`
17+
- **GitHub Private Advisory**: Use [GitHub Security Advisories](https://github.com/features/security-advisories) on this repository
18+
19+
Please include the following in your report:
20+
21+
- A description of the vulnerability and its potential impact
22+
- Steps to reproduce the issue
23+
- Affected versions
24+
- Any suggested mitigations or patches (if available)
25+
26+
We aim to acknowledge receipt within **3 business days** and provide an initial assessment within **7 business days**.
27+
28+
## Security Considerations
29+
30+
NetDriver interacts with network devices over SSH and exposes a REST API. When deploying this project, consider the following:
31+
32+
### Credentials and Secrets
33+
34+
- Device credentials (username/password) are passed via API requests. Use TLS/HTTPS in all deployments to prevent credential exposure in transit.
35+
- Do not log credentials. The agent configuration should be reviewed to ensure no sensitive fields appear in log output.
36+
- Rotate device credentials regularly and restrict API access to trusted clients.
37+
38+
### API Authentication
39+
40+
- The agent HTTP API does **not** include built-in authentication. Deploy it behind an API gateway, reverse proxy, or firewall that enforces authentication and authorization appropriate for your environment.
41+
- Restrict network access to the agent port (default: 8000) to trusted hosts only.
42+
43+
### SSH Host Verification
44+
45+
- By default, AsyncSSH may be configured to skip host key verification for convenience. In production, enable strict host key checking to prevent man-in-the-middle attacks.
46+
47+
### Plugin Code Execution
48+
49+
- Plugins are loaded dynamically from the `components/netdriver/plugins/` directory at startup. Ensure that only trusted code is present in the plugin directories and that the deployment environment has appropriate file system permissions.
50+
51+
### Simulated Devices (simunet)
52+
53+
- The `simunet` SSH server is intended for **testing purposes only**. Do not expose it on public networks or use it in production environments.
54+
55+
## Disclosure Policy
56+
57+
We follow a coordinated disclosure process. Once a fix is available, we will:
58+
59+
1. Release a patched version
60+
2. Publish a security advisory describing the vulnerability, its impact, and the fix
61+
3. Credit the reporter (unless they prefer to remain anonymous)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
from fastapi import APIRouter
4+
from netdriver_agent.api.rest import v1
45
from netdriver_agent.api.rest.v1 import router as _router
56

67

7-
router = APIRouter(prefix='/api')
8+
router = APIRouter(prefix="/api")
89
router.include_router(_router)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
from fastapi.routing import APIRouter
4+
from netdriver_agent.api.rest.v1 import api # noqa: F401
45
from netdriver_agent.api.rest.v1.api import router as cmd_router
56

6-
router = APIRouter(prefix='/v1', tags=['v1'])
7+
router = APIRouter(prefix="/v1", tags=["v1"])
78
router.include_router(cmd_router)

0 commit comments

Comments
 (0)