lexmark-security-auditor 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.
Files changed (21) hide show
  1. lexmark_security_auditor-0.1.0/PKG-INFO +280 -0
  2. lexmark_security_auditor-0.1.0/README.md +272 -0
  3. lexmark_security_auditor-0.1.0/lexmark_security_auditor/__init__.py +2 -0
  4. lexmark_security_auditor-0.1.0/lexmark_security_auditor/cli.py +187 -0
  5. lexmark_security_auditor-0.1.0/lexmark_security_auditor/ews_client.py +80 -0
  6. lexmark_security_auditor-0.1.0/lexmark_security_auditor/models.py +34 -0
  7. lexmark_security_auditor-0.1.0/lexmark_security_auditor/reporting.py +28 -0
  8. lexmark_security_auditor-0.1.0/lexmark_security_auditor/runner.py +159 -0
  9. lexmark_security_auditor-0.1.0/lexmark_security_auditor/workflows/__init__.py +0 -0
  10. lexmark_security_auditor-0.1.0/lexmark_security_auditor/workflows/auth.py +95 -0
  11. lexmark_security_auditor-0.1.0/lexmark_security_auditor/workflows/basic_security.py +45 -0
  12. lexmark_security_auditor-0.1.0/lexmark_security_auditor/workflows/ports.py +90 -0
  13. lexmark_security_auditor-0.1.0/lexmark_security_auditor/workflows/probe.py +91 -0
  14. lexmark_security_auditor-0.1.0/lexmark_security_auditor.egg-info/PKG-INFO +280 -0
  15. lexmark_security_auditor-0.1.0/lexmark_security_auditor.egg-info/SOURCES.txt +19 -0
  16. lexmark_security_auditor-0.1.0/lexmark_security_auditor.egg-info/dependency_links.txt +1 -0
  17. lexmark_security_auditor-0.1.0/lexmark_security_auditor.egg-info/entry_points.txt +2 -0
  18. lexmark_security_auditor-0.1.0/lexmark_security_auditor.egg-info/requires.txt +1 -0
  19. lexmark_security_auditor-0.1.0/lexmark_security_auditor.egg-info/top_level.txt +1 -0
  20. lexmark_security_auditor-0.1.0/pyproject.toml +20 -0
  21. lexmark_security_auditor-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,280 @@
1
+ Metadata-Version: 2.4
2
+ Name: lexmark-security-auditor
3
+ Version: 0.1.0
4
+ Summary: Lexmark MX710 EWS security auditor & hardening automation (Basic Security + disable HTTP) via Playwright.
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: playwright>=1.40
8
+
9
+ # Lexmark Security Auditor (EWS)
10
+
11
+ <p align="center">
12
+ <a href="https://pypi.org/project/lexmark-security-auditor/">
13
+ <img src="https://img.shields.io/pypi/v/lexmark-security-auditor.svg" alt="PyPI Version">
14
+ </a>
15
+ <a href="https://pypi.org/project/Lexmark-security-auditor/">
16
+ <img src="https://img.shields.io/pypi/pyversions/lexmark-security-auditor.svg" alt="Python Versions">
17
+ </a>
18
+ <a href="https://github.com/hacktivism-github/netauto/blob/development/LICENSE">
19
+ <img src="https://img.shields.io/github/license/hacktivism-github/netauto.svg" alt="MIT License">
20
+ </a>
21
+ </p>
22
+
23
+
24
+
25
+ Enterprise-grade security auditing and hardening tool for Lexmark MX710 (and compatible models) via Embedded Web Server (EWS).
26
+
27
+ Built with Playwright + Python, this tool enables controlled, automated security enforcement at scale.
28
+
29
+ ## Overview
30
+
31
+ The __Lexmark Security Auditor__ was developed to:
32
+
33
+ - Audit administrative exposure on Lexmark printers
34
+
35
+ - Enforce Basic Security (username/password protection)
36
+
37
+ - Disable insecure services (e.g., TCP 80 – HTTP)
38
+
39
+ - Operate at scale across multiple devices
40
+
41
+ - Provide CSV/JSON reporting for governance & compliance
42
+
43
+ Designed with a __modular architecture__, the tool separates:
44
+
45
+ - Authentication logic
46
+
47
+ - Port configuration logic
48
+
49
+ - Security workflows
50
+
51
+ - Runner orchestration
52
+
53
+ - CLI interface
54
+
55
+ ## Key Features
56
+ ### Security Audit
57
+
58
+ - Detects if admin/security pages are:
59
+
60
+ - OPEN
61
+
62
+ - AUTH required
63
+
64
+ - UNKNOWN
65
+
66
+ - Identifies exposure via:
67
+
68
+ - /auth/manageusers.html
69
+
70
+ - login redirects
71
+
72
+ - HTTP status codes
73
+
74
+ ## Basic Security Enforcement
75
+
76
+ Automates:
77
+
78
+ 1. Navigate to:
79
+
80
+ ```
81
+ /cgi-bin/dynamic/config/config.html
82
+ ```
83
+ 2. Access
84
+ ```
85
+ Configurações → Segurança → Configuração de segurança
86
+ ```
87
+ 3. Configure:
88
+
89
+ - Authentication Type: ```UsernamePassword```
90
+
91
+ - Admin ID
92
+
93
+ - Password
94
+
95
+ 4. Apply configuration
96
+ ---
97
+ ## HTTP Hardening (TCP 80 Disable)
98
+
99
+ - Authenticates via form-based login
100
+
101
+ - Navigates to:
102
+ ```
103
+ /cgi-bin/dynamic/config/secure/ports.html
104
+ ```
105
+ - Unchecks
106
+ ```
107
+ TCP 80 (HTTP)
108
+ ```
109
+ - Submits configuration
110
+
111
+ - Verifies idempotently
112
+
113
+ - Performs logout
114
+
115
+ ✔ Idempotent (safe to run multiple times)
116
+
117
+ ✔ Safe retry logic
118
+
119
+ ✔ Session-aware
120
+
121
+ ---
122
+ ## Architecture
123
+ ```
124
+ lexmark_security_auditor/
125
+
126
+ ├── cli.py
127
+ ├── runner.py
128
+
129
+ ├── models.py
130
+ ├── ews_client.py
131
+
132
+ └── workflows/
133
+ ├── auth.py
134
+ ├── basic_security.py
135
+ ├── probe.py
136
+ └── ports.py
137
+ ```
138
+ ---
139
+ | Module | Responsibility |
140
+ | ------------------- | ------------------------------ |
141
+ | `runner.py` | Orchestration & decision logic |
142
+ | `auth.py` | Session handling & login |
143
+ | `ports.py` | TCP 80 disable logic |
144
+ | `basic_security.py` | Admin security enforcement |
145
+ | `probe.py` | Exposure detection |
146
+ | `ews_client.py` | EWS navigation abstraction |
147
+
148
+ ---
149
+
150
+ ![Lexmark Security Auditor architecture](docs/architecture.png)
151
+
152
+ ---
153
+
154
+ ## Installation (Development Mode)
155
+
156
+ From project root:
157
+ ```
158
+ pip install -e .
159
+ ```
160
+
161
+ This enables:
162
+ ```
163
+ lexmark-audit ...
164
+ ```
165
+
166
+ Or:
167
+
168
+ ```
169
+ python -m lexmark_security_auditor.cli ...
170
+ ```
171
+ ---
172
+
173
+ ## Usage Examples
174
+
175
+ __Note:__ If you're on Powershell replace the ``` \ ``` by ``` ` ```
176
+
177
+ ### Audit Only
178
+ ```
179
+ lexmark-audit \
180
+ --hosts printers.txt \
181
+ --https
182
+ ```
183
+ ### Apply Basic Security
184
+ ```
185
+ lexmark-audit \
186
+ --hosts printers.txt \
187
+ --https \
188
+ --apply-basic-security \
189
+ --new-admin-user <ID do usuário> \
190
+ --new-admin-pass "Senha"
191
+ ```
192
+
193
+ ### Disable HTTP (Authenticated)
194
+ ```
195
+ lexmark-audit \
196
+ --hosts printers.txt \
197
+ --https \
198
+ --disable-http \
199
+ --auth-user <ID do usuário> \
200
+ --auth-pass "Senha"
201
+ ```
202
+ ### With Reporting
203
+ ```
204
+ lexmark-audit \
205
+ --hosts printers.txt \
206
+ --https \
207
+ --disable-http \
208
+ --auth-user <ID do usuário> \
209
+ --auth-pass "Senha" \
210
+ --report-csv report.csv
211
+ ```
212
+ ---
213
+ ## Output Fields (CSV/JSON)
214
+
215
+ | Field | Description |
216
+ | ---------------------- | --------------------- |
217
+ | host | Printer IP |
218
+ | probe_result | OPEN / AUTH / UNKNOWN |
219
+ | evidence | Detection details |
220
+ | basic_security_applied | Boolean |
221
+ | http_disabled | Boolean |
222
+ | status | ok / timeout / error |
223
+ | error | Error message |
224
+
225
+ ---
226
+
227
+ ## Security Considerations
228
+
229
+ - Credentials are passed via CLI (consider secure vault integration)
230
+
231
+ - HTTPS recommended
232
+
233
+ - Designed for internal network use
234
+
235
+ - Session cookies handled via Playwright context
236
+
237
+ - Idempotent operations to avoid configuration drift
238
+
239
+ ## Design Principles
240
+
241
+ - Modular
242
+
243
+ - Idempotent
244
+
245
+ - Stateless between hosts
246
+
247
+ - Session-aware
248
+
249
+ - Explicit authentication
250
+
251
+ - Clear separation of concerns
252
+
253
+ - Enterprise reporting ready
254
+
255
+ ## Requirements
256
+
257
+ - Python 3.9+
258
+
259
+ - Playwright
260
+
261
+ - Chromium (installed via playwright install)
262
+
263
+ ## Roadmap (Future Enhancements)
264
+
265
+ - Vault integration (HashiCorp)
266
+
267
+ - SNMP configuration hardening
268
+
269
+ - Parallel host execution
270
+
271
+ - Compliance summary dashboard
272
+
273
+ - Unit test coverage
274
+
275
+ - Docker container image
276
+
277
+ ## License
278
+
279
+ Internal Enterprise Use
280
+ © 2026
@@ -0,0 +1,272 @@
1
+ # Lexmark Security Auditor (EWS)
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.org/project/lexmark-security-auditor/">
5
+ <img src="https://img.shields.io/pypi/v/lexmark-security-auditor.svg" alt="PyPI Version">
6
+ </a>
7
+ <a href="https://pypi.org/project/Lexmark-security-auditor/">
8
+ <img src="https://img.shields.io/pypi/pyversions/lexmark-security-auditor.svg" alt="Python Versions">
9
+ </a>
10
+ <a href="https://github.com/hacktivism-github/netauto/blob/development/LICENSE">
11
+ <img src="https://img.shields.io/github/license/hacktivism-github/netauto.svg" alt="MIT License">
12
+ </a>
13
+ </p>
14
+
15
+
16
+
17
+ Enterprise-grade security auditing and hardening tool for Lexmark MX710 (and compatible models) via Embedded Web Server (EWS).
18
+
19
+ Built with Playwright + Python, this tool enables controlled, automated security enforcement at scale.
20
+
21
+ ## Overview
22
+
23
+ The __Lexmark Security Auditor__ was developed to:
24
+
25
+ - Audit administrative exposure on Lexmark printers
26
+
27
+ - Enforce Basic Security (username/password protection)
28
+
29
+ - Disable insecure services (e.g., TCP 80 – HTTP)
30
+
31
+ - Operate at scale across multiple devices
32
+
33
+ - Provide CSV/JSON reporting for governance & compliance
34
+
35
+ Designed with a __modular architecture__, the tool separates:
36
+
37
+ - Authentication logic
38
+
39
+ - Port configuration logic
40
+
41
+ - Security workflows
42
+
43
+ - Runner orchestration
44
+
45
+ - CLI interface
46
+
47
+ ## Key Features
48
+ ### Security Audit
49
+
50
+ - Detects if admin/security pages are:
51
+
52
+ - OPEN
53
+
54
+ - AUTH required
55
+
56
+ - UNKNOWN
57
+
58
+ - Identifies exposure via:
59
+
60
+ - /auth/manageusers.html
61
+
62
+ - login redirects
63
+
64
+ - HTTP status codes
65
+
66
+ ## Basic Security Enforcement
67
+
68
+ Automates:
69
+
70
+ 1. Navigate to:
71
+
72
+ ```
73
+ /cgi-bin/dynamic/config/config.html
74
+ ```
75
+ 2. Access
76
+ ```
77
+ Configurações → Segurança → Configuração de segurança
78
+ ```
79
+ 3. Configure:
80
+
81
+ - Authentication Type: ```UsernamePassword```
82
+
83
+ - Admin ID
84
+
85
+ - Password
86
+
87
+ 4. Apply configuration
88
+ ---
89
+ ## HTTP Hardening (TCP 80 Disable)
90
+
91
+ - Authenticates via form-based login
92
+
93
+ - Navigates to:
94
+ ```
95
+ /cgi-bin/dynamic/config/secure/ports.html
96
+ ```
97
+ - Unchecks
98
+ ```
99
+ TCP 80 (HTTP)
100
+ ```
101
+ - Submits configuration
102
+
103
+ - Verifies idempotently
104
+
105
+ - Performs logout
106
+
107
+ ✔ Idempotent (safe to run multiple times)
108
+
109
+ ✔ Safe retry logic
110
+
111
+ ✔ Session-aware
112
+
113
+ ---
114
+ ## Architecture
115
+ ```
116
+ lexmark_security_auditor/
117
+
118
+ ├── cli.py
119
+ ├── runner.py
120
+
121
+ ├── models.py
122
+ ├── ews_client.py
123
+
124
+ └── workflows/
125
+ ├── auth.py
126
+ ├── basic_security.py
127
+ ├── probe.py
128
+ └── ports.py
129
+ ```
130
+ ---
131
+ | Module | Responsibility |
132
+ | ------------------- | ------------------------------ |
133
+ | `runner.py` | Orchestration & decision logic |
134
+ | `auth.py` | Session handling & login |
135
+ | `ports.py` | TCP 80 disable logic |
136
+ | `basic_security.py` | Admin security enforcement |
137
+ | `probe.py` | Exposure detection |
138
+ | `ews_client.py` | EWS navigation abstraction |
139
+
140
+ ---
141
+
142
+ ![Lexmark Security Auditor architecture](docs/architecture.png)
143
+
144
+ ---
145
+
146
+ ## Installation (Development Mode)
147
+
148
+ From project root:
149
+ ```
150
+ pip install -e .
151
+ ```
152
+
153
+ This enables:
154
+ ```
155
+ lexmark-audit ...
156
+ ```
157
+
158
+ Or:
159
+
160
+ ```
161
+ python -m lexmark_security_auditor.cli ...
162
+ ```
163
+ ---
164
+
165
+ ## Usage Examples
166
+
167
+ __Note:__ If you're on Powershell replace the ``` \ ``` by ``` ` ```
168
+
169
+ ### Audit Only
170
+ ```
171
+ lexmark-audit \
172
+ --hosts printers.txt \
173
+ --https
174
+ ```
175
+ ### Apply Basic Security
176
+ ```
177
+ lexmark-audit \
178
+ --hosts printers.txt \
179
+ --https \
180
+ --apply-basic-security \
181
+ --new-admin-user <ID do usuário> \
182
+ --new-admin-pass "Senha"
183
+ ```
184
+
185
+ ### Disable HTTP (Authenticated)
186
+ ```
187
+ lexmark-audit \
188
+ --hosts printers.txt \
189
+ --https \
190
+ --disable-http \
191
+ --auth-user <ID do usuário> \
192
+ --auth-pass "Senha"
193
+ ```
194
+ ### With Reporting
195
+ ```
196
+ lexmark-audit \
197
+ --hosts printers.txt \
198
+ --https \
199
+ --disable-http \
200
+ --auth-user <ID do usuário> \
201
+ --auth-pass "Senha" \
202
+ --report-csv report.csv
203
+ ```
204
+ ---
205
+ ## Output Fields (CSV/JSON)
206
+
207
+ | Field | Description |
208
+ | ---------------------- | --------------------- |
209
+ | host | Printer IP |
210
+ | probe_result | OPEN / AUTH / UNKNOWN |
211
+ | evidence | Detection details |
212
+ | basic_security_applied | Boolean |
213
+ | http_disabled | Boolean |
214
+ | status | ok / timeout / error |
215
+ | error | Error message |
216
+
217
+ ---
218
+
219
+ ## Security Considerations
220
+
221
+ - Credentials are passed via CLI (consider secure vault integration)
222
+
223
+ - HTTPS recommended
224
+
225
+ - Designed for internal network use
226
+
227
+ - Session cookies handled via Playwright context
228
+
229
+ - Idempotent operations to avoid configuration drift
230
+
231
+ ## Design Principles
232
+
233
+ - Modular
234
+
235
+ - Idempotent
236
+
237
+ - Stateless between hosts
238
+
239
+ - Session-aware
240
+
241
+ - Explicit authentication
242
+
243
+ - Clear separation of concerns
244
+
245
+ - Enterprise reporting ready
246
+
247
+ ## Requirements
248
+
249
+ - Python 3.9+
250
+
251
+ - Playwright
252
+
253
+ - Chromium (installed via playwright install)
254
+
255
+ ## Roadmap (Future Enhancements)
256
+
257
+ - Vault integration (HashiCorp)
258
+
259
+ - SNMP configuration hardening
260
+
261
+ - Parallel host execution
262
+
263
+ - Compliance summary dashboard
264
+
265
+ - Unit test coverage
266
+
267
+ - Docker container image
268
+
269
+ ## License
270
+
271
+ Internal Enterprise Use
272
+ © 2026
@@ -0,0 +1,2 @@
1
+ __all__ = ["cli", "runner", "ews_client", "models", "reporting"]
2
+ __version__ = "0.1.0"