vlan-probe 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: uv
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ assignees:
8
+ - hellqvio86
9
+ cooldown:
10
+ default-days: 3
11
+ - package-ecosystem: github-actions
12
+ directory: /
13
+ schedule:
14
+ interval: weekly
15
+ assignees:
16
+ - hellqvio86
17
+ cooldown:
18
+ default-days: 3
@@ -0,0 +1,169 @@
1
+ name: CI/CD
2
+
3
+ permissions:
4
+ contents: read
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ branches: [main]
11
+ release:
12
+ types: [published]
13
+ workflow_dispatch:
14
+ inputs:
15
+ job:
16
+ description: 'Select which job to run'
17
+ required: true
18
+ default: 'all'
19
+ type: choice
20
+ options:
21
+ - all
22
+ - lint
23
+ - test
24
+ - draft-release
25
+ - publish
26
+
27
+ jobs:
28
+ lint:
29
+ name: Lint
30
+ runs-on: ubuntu-latest
31
+ if: |
32
+ github.event_name != 'workflow_dispatch' ||
33
+ inputs.job == 'all' ||
34
+ inputs.job == 'lint'
35
+ steps:
36
+ - name: Checkout code
37
+ uses: actions/checkout@v7
38
+
39
+ - name: Install uv
40
+ uses: astral-sh/setup-uv@v7
41
+ with:
42
+ enable-cache: true
43
+
44
+ - name: Set up Python
45
+ uses: actions/setup-python@v7
46
+ with:
47
+ python-version: "3.12"
48
+
49
+ - name: Install dependencies
50
+ run: uv sync
51
+
52
+ - name: Run ruff check
53
+ run: uv run ruff check .
54
+
55
+ - name: Run ruff format check
56
+ run: uv run ruff format --check .
57
+
58
+ - name: Run mypy type check
59
+ run: uv run mypy src
60
+
61
+ test:
62
+ name: Test (Python ${{ matrix.python-version }})
63
+ runs-on: ubuntu-latest
64
+ permissions:
65
+ contents: write
66
+ if: |
67
+ github.event_name != 'workflow_dispatch' ||
68
+ inputs.job == 'all' ||
69
+ inputs.job == 'test'
70
+ strategy:
71
+ fail-fast: false
72
+ matrix:
73
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
74
+
75
+ steps:
76
+ - name: Checkout code
77
+ uses: actions/checkout@v7
78
+
79
+ - name: Install uv
80
+ uses: astral-sh/setup-uv@v7
81
+ with:
82
+ enable-cache: true
83
+
84
+ - name: Set up Python ${{ matrix.python-version }}
85
+ uses: actions/setup-python@v7
86
+ with:
87
+ python-version: ${{ matrix.python-version }}
88
+
89
+ - name: Install dependencies
90
+ run: uv sync
91
+
92
+ - name: Run tests
93
+ run: |
94
+ uv run pytest --cov=src/vlan_probe --cov-report=term-missing
95
+
96
+ draft-release:
97
+ name: Draft Release
98
+ runs-on: ubuntu-latest
99
+ needs: [lint, test]
100
+ if: github.event_name == 'workflow_dispatch' && (inputs.job == 'all' || inputs.job == 'draft-release')
101
+ permissions:
102
+ contents: write
103
+ steps:
104
+ - name: Checkout code
105
+ uses: actions/checkout@v7
106
+
107
+ - name: Install uv
108
+ uses: astral-sh/setup-uv@v7
109
+ with:
110
+ enable-cache: true
111
+
112
+ - name: Set up Python
113
+ uses: actions/setup-python@v7
114
+ with:
115
+ python-version: "3.12"
116
+
117
+ - name: Install dependencies
118
+ run: uv sync
119
+
120
+ - name: Build distribution
121
+ run: uv build
122
+
123
+ - name: Get package version
124
+ id: version
125
+ run: echo "version=$(grep -m1 '^version' pyproject.toml | cut -d' ' -f3 | tr -d '\"')" >> "$GITHUB_OUTPUT"
126
+
127
+ - name: Create draft release
128
+ id: release
129
+ uses: softprops/action-gh-release@v3
130
+ env:
131
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132
+ with:
133
+ tag_name: v${{ steps.version.outputs.version }}
134
+ name: Release v${{ steps.version.outputs.version }}
135
+ draft: true
136
+ prerelease: false
137
+ files: dist/*
138
+
139
+ publish:
140
+ name: Publish to PyPI
141
+ runs-on: ubuntu-latest
142
+ needs: [lint, test]
143
+ if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && (inputs.job == 'all' || inputs.job == 'publish'))
144
+ environment: pypi
145
+ permissions:
146
+ contents: read
147
+ id-token: write
148
+ steps:
149
+ - name: Checkout code
150
+ uses: actions/checkout@v7
151
+
152
+ - name: Install uv
153
+ uses: astral-sh/setup-uv@v7
154
+ with:
155
+ enable-cache: true
156
+
157
+ - name: Set up Python
158
+ uses: actions/setup-python@v7
159
+ with:
160
+ python-version: "3.12"
161
+
162
+ - name: Install dependencies
163
+ run: uv sync
164
+
165
+ - name: Build distribution
166
+ run: uv build
167
+
168
+ - name: Publish to PyPI
169
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,4 @@
1
+ __pycache__/
2
+ *.pyc
3
+ vlan_probe.toml
4
+ .coverage
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hellqvio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,34 @@
1
+ .PHONY: venv lint test clean format build publish run install
2
+
3
+ .venv: pyproject.toml
4
+ if [ ! -d .venv ]; then uv venv; fi
5
+ uv pip install -e . --group dev
6
+
7
+ venv: .venv
8
+
9
+ lint: .venv
10
+ .venv/bin/ruff check .
11
+ .venv/bin/ruff format --check .
12
+
13
+ format: .venv
14
+ .venv/bin/ruff format .
15
+
16
+ test: .venv
17
+ .venv/bin/mypy src
18
+ .venv/bin/pytest --cov=src/vlan_probe --cov-report=term-missing
19
+
20
+ run: .venv
21
+ .venv/bin/python3 -m vlan_probe $(ARGS)
22
+
23
+ install:
24
+ uv tool install --force .
25
+
26
+ build: .venv
27
+ uv build
28
+
29
+ publish: build
30
+ uv publish
31
+
32
+ clean:
33
+ rm -rf .venv __pycache__ .pytest_cache .ruff_cache dist
34
+
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.5
2
+ Name: vlan-probe
3
+ Version: 0.1.0
4
+ Summary: VLAN Isolation & Network Permission Probe Tool
5
+ Project-URL: Homepage, https://github.com/hellqvio86/vlan-probe
6
+ Project-URL: Repository, https://github.com/hellqvio86/vlan-probe
7
+ Author: hellqvio
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: tomli>=1.2.0; python_version < '3.11'
16
+ Description-Content-Type: text/markdown
17
+
18
+ # vlan-probe
19
+
20
+ VLAN Isolation & Network Permission Probe Tool — standalone project extracted
21
+ from the Ansible role in ansible-home-baseline.
22
+
23
+ `vlan-probe` is a command-line tool. Install it with [pipx](https://pipx.pypa.io/)
24
+ so it runs in an isolated environment and the `vlan-probe` command is available
25
+ on your `PATH`.
26
+
27
+ ## Requirements
28
+
29
+ - Python 3.10 or newer
30
+
31
+ ## Installation
32
+
33
+ ### Install with pipx (recommended)
34
+
35
+ ```bash
36
+ pipx install vlan-probe
37
+ ```
38
+
39
+ Upgrade to a newer release:
40
+
41
+ ```bash
42
+ pipx upgrade vlan-probe
43
+ ```
44
+
45
+ If you do not already have pipx, install it first (macOS/Homebrew, Debian/Ubuntu
46
+ or Arch examples; see the [pipx docs](https://pipx.pypa.io/) for other systems):
47
+
48
+ ```bash
49
+ brew install pipx && pipx ensurepath
50
+ # or
51
+ apt install pipx && pipx ensurepath
52
+ # or
53
+ pacman -S python-pipx && pipx ensurepath
54
+ ```
55
+
56
+ ### Install from source
57
+
58
+ ```bash
59
+ # with pipx
60
+ pipx install .
61
+
62
+ # with uv (alternative)
63
+ uv tool install .
64
+
65
+ # or install directly into your environment
66
+ pip install .
67
+ ```
68
+
69
+ ## Usage
70
+
71
+ 1. Install or copy to a host.
72
+ 2. Create a TOML config at `/etc/vlan_probe.toml` or pass `-c` to point to a different file.
73
+ 3. Run `vlan-probe -f table` or `python -m vlan_probe -f table`.
74
+
75
+ ### Configuration
76
+
77
+ Configuration uses TOML format for easy human readability and simplicity:
78
+
79
+ ```toml
80
+ [[targets]]
81
+ name = "Internal - Device A SSH"
82
+ vlan = "Internal"
83
+ ip = "192.168.1.10"
84
+ port = 22
85
+ protocol = "tcp"
86
+ expected_blocked = true
87
+
88
+ [[targets]]
89
+ name = "Internal - Gateway HTTP"
90
+ vlan = "Internal"
91
+ ip = "192.168.2.1"
92
+ port = 80
93
+ protocol = "tcp"
94
+ expected_blocked = true
95
+
96
+ [[targets]]
97
+ name = "External - Public DNS"
98
+ vlan = "External"
99
+ ip = "8.8.8.8"
100
+ port = 53
101
+ protocol = "udp"
102
+ expected_blocked = false
103
+ ```
104
+
105
+ ### Options
106
+
107
+ ```
108
+ -c, --config PATH Path to config TOML file (default: /etc/vlan_probe.toml)
109
+ -f, --format FORMAT Output format: ndjson, json, or table (default: ndjson)
110
+ -t, --timeout SECONDS Socket connection timeout (default: 2.0)
111
+ -s, --strict Exit with code 1 if any violations occur
112
+ --color [auto|always|never] Colorize output (default: auto)
113
+ ```
114
+
115
+ ### Examples
116
+
117
+ ```bash
118
+ # Display as table
119
+ vlan-probe -c ./vlan_probe.toml -f table
120
+
121
+ # Output JSON
122
+ vlan-probe -f json
123
+
124
+ # Strict mode with custom timeout
125
+ vlan-probe -s -t 5.0
126
+
127
+ # No color output
128
+ vlan-probe -f table --color never
129
+ ```
130
+
131
+ ## Development
132
+
133
+ ```bash
134
+ uv sync # install dev dependencies
135
+ uv run pytest # run tests
136
+ uv run ruff check . && uv run ruff format --check . # lint
137
+ uv run mypy src # type check
138
+ ```
139
+
140
+ ## License
141
+
142
+ MIT (see LICENSE)
@@ -0,0 +1,125 @@
1
+ # vlan-probe
2
+
3
+ VLAN Isolation & Network Permission Probe Tool — standalone project extracted
4
+ from the Ansible role in ansible-home-baseline.
5
+
6
+ `vlan-probe` is a command-line tool. Install it with [pipx](https://pipx.pypa.io/)
7
+ so it runs in an isolated environment and the `vlan-probe` command is available
8
+ on your `PATH`.
9
+
10
+ ## Requirements
11
+
12
+ - Python 3.10 or newer
13
+
14
+ ## Installation
15
+
16
+ ### Install with pipx (recommended)
17
+
18
+ ```bash
19
+ pipx install vlan-probe
20
+ ```
21
+
22
+ Upgrade to a newer release:
23
+
24
+ ```bash
25
+ pipx upgrade vlan-probe
26
+ ```
27
+
28
+ If you do not already have pipx, install it first (macOS/Homebrew, Debian/Ubuntu
29
+ or Arch examples; see the [pipx docs](https://pipx.pypa.io/) for other systems):
30
+
31
+ ```bash
32
+ brew install pipx && pipx ensurepath
33
+ # or
34
+ apt install pipx && pipx ensurepath
35
+ # or
36
+ pacman -S python-pipx && pipx ensurepath
37
+ ```
38
+
39
+ ### Install from source
40
+
41
+ ```bash
42
+ # with pipx
43
+ pipx install .
44
+
45
+ # with uv (alternative)
46
+ uv tool install .
47
+
48
+ # or install directly into your environment
49
+ pip install .
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ 1. Install or copy to a host.
55
+ 2. Create a TOML config at `/etc/vlan_probe.toml` or pass `-c` to point to a different file.
56
+ 3. Run `vlan-probe -f table` or `python -m vlan_probe -f table`.
57
+
58
+ ### Configuration
59
+
60
+ Configuration uses TOML format for easy human readability and simplicity:
61
+
62
+ ```toml
63
+ [[targets]]
64
+ name = "Internal - Device A SSH"
65
+ vlan = "Internal"
66
+ ip = "192.168.1.10"
67
+ port = 22
68
+ protocol = "tcp"
69
+ expected_blocked = true
70
+
71
+ [[targets]]
72
+ name = "Internal - Gateway HTTP"
73
+ vlan = "Internal"
74
+ ip = "192.168.2.1"
75
+ port = 80
76
+ protocol = "tcp"
77
+ expected_blocked = true
78
+
79
+ [[targets]]
80
+ name = "External - Public DNS"
81
+ vlan = "External"
82
+ ip = "8.8.8.8"
83
+ port = 53
84
+ protocol = "udp"
85
+ expected_blocked = false
86
+ ```
87
+
88
+ ### Options
89
+
90
+ ```
91
+ -c, --config PATH Path to config TOML file (default: /etc/vlan_probe.toml)
92
+ -f, --format FORMAT Output format: ndjson, json, or table (default: ndjson)
93
+ -t, --timeout SECONDS Socket connection timeout (default: 2.0)
94
+ -s, --strict Exit with code 1 if any violations occur
95
+ --color [auto|always|never] Colorize output (default: auto)
96
+ ```
97
+
98
+ ### Examples
99
+
100
+ ```bash
101
+ # Display as table
102
+ vlan-probe -c ./vlan_probe.toml -f table
103
+
104
+ # Output JSON
105
+ vlan-probe -f json
106
+
107
+ # Strict mode with custom timeout
108
+ vlan-probe -s -t 5.0
109
+
110
+ # No color output
111
+ vlan-probe -f table --color never
112
+ ```
113
+
114
+ ## Development
115
+
116
+ ```bash
117
+ uv sync # install dev dependencies
118
+ uv run pytest # run tests
119
+ uv run ruff check . && uv run ruff format --check . # lint
120
+ uv run mypy src # type check
121
+ ```
122
+
123
+ ## License
124
+
125
+ MIT (see LICENSE)
@@ -0,0 +1,61 @@
1
+ [project]
2
+ name = "vlan-probe"
3
+ version = "0.1.0"
4
+ description = "VLAN Isolation & Network Permission Probe Tool"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ license = "MIT"
8
+ authors = [
9
+ {name = "hellqvio"}
10
+ ]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Programming Language :: Python :: 3",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ ]
17
+ dependencies = [
18
+ 'tomli>=1.2.0;python_version<"3.11"',
19
+ ]
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/hellqvio86/vlan-probe"
23
+ Repository = "https://github.com/hellqvio86/vlan-probe"
24
+
25
+ [project.scripts]
26
+ vlan-probe = "vlan_probe.cli:main"
27
+
28
+ [build-system]
29
+ requires = ["hatchling"]
30
+ build-backend = "hatchling.build"
31
+
32
+ [tool.hatch.build.targets.wheel]
33
+ packages = ["src/vlan_probe"]
34
+
35
+ [dependency-groups]
36
+ dev = [
37
+ "pytest>=7.0.0",
38
+ "ruff>=0.3.0",
39
+ "pytest-cov>=4.0.0",
40
+ "mypy>=2.3.0",
41
+ ]
42
+
43
+ [tool.ruff]
44
+ line-length = 120
45
+ target-version = "py310"
46
+
47
+ [tool.ruff.lint]
48
+ select = ["E", "F", "W", "I"]
49
+ ignore = []
50
+
51
+ [tool.mypy]
52
+ python_version = "3.10"
53
+ warn_return_any = true
54
+ warn_unused_configs = true
55
+ disallow_untyped_defs = false
56
+ ignore_missing_imports = true
57
+
58
+ [tool.pytest.ini_options]
59
+ testpaths = ["test"]
60
+ python_files = "test_*.py"
61
+ addopts = "-v --tb=short"
@@ -0,0 +1,11 @@
1
+ """
2
+ VLAN Isolation & Network Permission Probe Tool.
3
+
4
+ Probes target VLAN subnets, IPs, and ports from the host environment to verify
5
+ isolation policies and detect unauthorized inter-VLAN access violations.
6
+ """
7
+
8
+ __version__ = "0.1.0"
9
+ __all__ = ["probe_target", "get_local_ips"]
10
+
11
+ from .probe import get_local_ips, probe_target
@@ -0,0 +1,6 @@
1
+ """Module entrypoint for vlan_probe package."""
2
+
3
+ from .cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()