Skip to content

Remove duplicates for ai generated pages, added generation pages to searchboar#200

Merged
BlessedRebuS merged 1 commit into
devfrom
feat/bulk-export-import-deception-pages
May 20, 2026
Merged

Remove duplicates for ai generated pages, added generation pages to searchboar#200
BlessedRebuS merged 1 commit into
devfrom
feat/bulk-export-import-deception-pages

Conversation

@BlessedRebuS
Copy link
Copy Markdown
Owner

No description provided.

@BlessedRebuS BlessedRebuS requested a review from Lore09 May 20, 2026 21:03
@BlessedRebuS BlessedRebuS self-assigned this May 20, 2026
@BlessedRebuS BlessedRebuS added bug Something isn't working enhancement New feature or request labels May 20, 2026
@github-actions
Copy link
Copy Markdown

Bandit — security issues

No HIGH severity issues found.

Code scanned:
	Total lines of code: 10120
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 50
		Medium: 2
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 3
		High: 49
Files skipped (0):
View full report
Run started:2026-05-20 21:04:17.510971+00:00

Test results:
>> Issue: [B105:hardcoded_password_string] Possible hardcoded password: ''
   Severity: Low   Confidence: Medium
   CWE: CWE-259 (https://cwe.mitre.org/data/definitions/259.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/plugins/b105_hardcoded_password_string.html
   Location: src/app.py:167:20
166	
167	    password_line = ""
168	    if config.dashboard_password_generated:

--------------------------------------------------
>> Issue: [B104:hardcoded_bind_all_interfaces] Possible binding to all interfaces.
   Severity: Medium   Confidence: Medium
   CWE: CWE-605 (https://cwe.mitre.org/data/definitions/605.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/plugins/b104_hardcoded_bind_all_interfaces.html
   Location: src/dependencies.py:81:11
80	
81	    return "0.0.0.0"
82	

--------------------------------------------------
>> Issue: [B110:try_except_pass] Try, Except, Pass detected.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/plugins/b110_try_except_pass.html
   Location: src/generative_ai.py:727:4
726	            return False
727	    except Exception:
728	        pass  # If config fails, continue with other checks
729	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:18:11
17	    wl = get_wordlists()
18	    return random.choice(wl.username_prefixes) + random.choice(wl.username_suffixes)
19	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:18:49
17	    wl = get_wordlists()
18	    return random.choice(wl.username_prefixes) + random.choice(wl.username_suffixes)
19	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:25:24
24	    templates = [
25	        lambda: "".join(random.choices(string.ascii_letters + string.digits, k=12)),
26	        lambda: f"{random.choice(wl.password_prefixes)}{random.randint(100, 999)}!",

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:26:19
25	        lambda: "".join(random.choices(string.ascii_letters + string.digits, k=12)),
26	        lambda: f"{random.choice(wl.password_prefixes)}{random.randint(100, 999)}!",
27	        lambda: f"{random.choice(wl.simple_passwords)}{random.randint(1000, 9999)}",

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:26:56
25	        lambda: "".join(random.choices(string.ascii_letters + string.digits, k=12)),
26	        lambda: f"{random.choice(wl.password_prefixes)}{random.randint(100, 999)}!",
27	        lambda: f"{random.choice(wl.simple_passwords)}{random.randint(1000, 9999)}",

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:27:19
26	        lambda: f"{random.choice(wl.password_prefixes)}{random.randint(100, 999)}!",
27	        lambda: f"{random.choice(wl.simple_passwords)}{random.randint(1000, 9999)}",
28	        lambda: "".join(random.choices(string.ascii_lowercase, k=8)),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:27:55
26	        lambda: f"{random.choice(wl.password_prefixes)}{random.randint(100, 999)}!",
27	        lambda: f"{random.choice(wl.simple_passwords)}{random.randint(1000, 9999)}",
28	        lambda: "".join(random.choices(string.ascii_lowercase, k=8)),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:28:24
27	        lambda: f"{random.choice(wl.simple_passwords)}{random.randint(1000, 9999)}",
28	        lambda: "".join(random.choices(string.ascii_lowercase, k=8)),
29	    ]

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:30:11
29	    ]
30	    return random.choice(templates)()
31	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:38:25
37	        username = random_username()
38	    return f"{username}@{random.choice(wl.email_domains)}"
39	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:47:11
46	    wl = get_wordlists()
47	    return random.choice(wl.server_headers)
48	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:53:18
52	    wl = get_wordlists()
53	    key = "".join(random.choices(string.ascii_letters + string.digits, k=32))
54	    return random.choice(wl.api_key_prefixes) + key

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:54:11
53	    key = "".join(random.choices(string.ascii_letters + string.digits, k=32))
54	    return random.choice(wl.api_key_prefixes) + key
55	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:60:11
59	    wl = get_wordlists()
60	    return random.choice(wl.database_names)
61	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:66:19
65	    content = "# Production Credentials\n\n"
66	    for i in range(random.randint(3, 7)):
67	        username = random_username()

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:80:19
79	    content += "User Passwords:\n"
80	    for i in range(random.randint(5, 10)):
81	        username = random_username()

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:91:19
90	    users = []
91	    for i in range(random.randint(3, 8)):
92	        username = random_username()

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:99:24
98	                "password": random_password(),
99	                "role": random.choice(wl.user_roles),
100	                "api_token": random_api_key(),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:111:22
110	            "public_key": "pk_live_"
111	            + "".join(random.choices(string.ascii_letters + string.digits, k=24)),
112	            "secret_key": random_api_key(),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:116:22
115	            "access_key_id": "AKIA"
116	            + "".join(random.choices(string.ascii_uppercase + string.digits, k=16)),
117	            "secret_access_key": "".join(

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:118:16
117	            "secret_access_key": "".join(
118	                random.choices(string.ascii_letters + string.digits + "+/", k=40)
119	            ),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:123:22
122	            "api_key": "SG."
123	            + "".join(random.choices(string.ascii_letters + string.digits, k=48))
124	        },

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:127:22
126	            "account_sid": "AC"
127	            + "".join(random.choices(string.ascii_lowercase + string.digits, k=32)),
128	            "auth_token": "".join(

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:129:16
128	            "auth_token": "".join(
129	                random.choices(string.ascii_lowercase + string.digits, k=32)
130	            ),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:149:28
148	                    "email": random_email(username),
149	                    "role": random.choice(wl.user_roles),
150	                }

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:157:38
156	            {
157	                "users": random_users(random.randint(2, 5)),
158	                "total": random.randint(50, 500),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:158:25
157	                "users": random_users(random.randint(2, 5)),
158	                "total": random.randint(50, 500),
159	            },

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:167:30
166	                    {
167	                        "id": random.randint(1, 100),
168	                        "name": random_username(),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:178:28
177	                "database": {
178	                    "host": random.choice(wl.database_hosts),
179	                    "username": random_username(),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:187:24
186	                    + "".join(
187	                        random.choices(string.ascii_uppercase + string.digits, k=16)
188	                    ),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:195:28
194	            {
195	                "app_name": random.choice(wl.application_names),
196	                "debug": random.choice([True, False]),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:196:25
195	                "app_name": random.choice(wl.application_names),
196	                "debug": random.choice([True, False]),
197	                "secret_key": random_api_key(),

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:202:31
201	        ),
202	        "/.env": f"""APP_NAME={random.choice(wl.application_names)}
203	DEBUG={random.choice(['true', 'false'])}

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:203:7
202	        "/.env": f"""APP_NAME={random.choice(wl.application_names)}
203	DEBUG={random.choice(['true', 'false'])}
204	APP_KEY=base64:{''.join(random.choices(string.ascii_letters + string.digits, k=32))}=

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:204:24
203	DEBUG={random.choice(['true', 'false'])}
204	APP_KEY=base64:{''.join(random.choices(string.ascii_letters + string.digits, k=32))}=
205	DB_CONNECTION=mysql

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:211:31
210	DB_PASSWORD={random_password()}
211	AWS_ACCESS_KEY_ID=AKIA{''.join(random.choices(string.ascii_uppercase + string.digits, k=16))}
212	AWS_SECRET_ACCESS_KEY={''.join(random.choices(string.ascii_letters + string.digits + '+/', k=40))}

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:212:31
211	AWS_ACCESS_KEY_ID=AKIA{''.join(random.choices(string.ascii_uppercase + string.digits, k=16))}
212	AWS_SECRET_ACCESS_KEY={''.join(random.choices(string.ascii_letters + string.digits + '+/', k=40))}
213	STRIPE_SECRET={random_api_key()}

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:227:12
226	    selected_files = [
227	        (f, random.randint(1024, 1024 * 1024))
228	        for f in random.sample(files, min(6, len(files)))

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/generators.py:228:17
227	        (f, random.randint(1024, 1024 * 1024))
228	        for f in random.sample(files, min(6, len(files)))
229	    ]

--------------------------------------------------
>> Issue: [B104:hardcoded_bind_all_interfaces] Possible binding to all interfaces.
   Severity: Medium   Confidence: Medium
   CWE: CWE-605 (https://cwe.mitre.org/data/definitions/605.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/plugins/b104_hardcoded_bind_all_interfaces.html
   Location: src/ip_utils.py:39:27
38	            or ip.is_link_local
39	            or str(ip) in ("0.0.0.0", "::1")
40	        )

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:109:11
108	        return False
109	    return random.randint(1, 100) <= config.probability_error_codes
110	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:117:11
116	        error_codes = [400, 401, 403, 404, 500, 502, 503]
117	    return random.choice(error_codes)
118	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:603:20
602	    """Generate random word salad to confuse AI training data scrapers."""
603	    return " ".join(random.choice(_TARPIT_WORDS) for _ in range(n_words))
604	

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:631:16
630	
631	    num_pages = random.randint(*config.links_per_page_range)
632	    content = ""

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:646:20
645	                [
646	                    random.choice(config.char_space)
647	                    for _ in range(random.randint(*config.links_length_range))

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:647:35
646	                    random.choice(config.char_space)
647	                    for _ in range(random.randint(*config.links_length_range))
648	                ]

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_calls.html#b311-random
   Location: src/routes/honeypot.py:657:22
656	        for _ in range(num_pages):
657	            address = random.choice(webpages)
658	            content += f"""

--------------------------------------------------
>> Issue: [B404:blacklist] Consider possible security implications associated with the subprocess module.
   Severity: Low   Confidence: High
   CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/blacklists/blacklist_imports.html#b404-import-subprocess
   Location: src/tasks/db_dump.py:6:0
5	import sqlite3
6	import subprocess
7	from logger import get_app_logger

--------------------------------------------------
>> Issue: [B603:subprocess_without_shell_equals_true] subprocess call - check for execution of untrusted input.
   Severity: Low   Confidence: High
   CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
   More Info: https://bandit.readthedocs.io/en/1.9.4/plugins/b603_subprocess_without_shell_equals_true.html
   Location: src/tasks/db_dump.py:90:17
89	    try:
90	        result = subprocess.run(
91	            cmd, env=env, capture_output=True, text=True, timeout=300
92	        )
93	        if result.returncode == 0:

--------------------------------------------------

Code scanned:
	Total lines of code: 10120
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 50
		Medium: 2
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 3
		High: 49
Files skipped (0):

@github-actions
Copy link
Copy Markdown

Ruff — lint & security issues

The following issues were found by Ruff (includes linting rules and security checks via S / Bandit rules).

View full report
src/app.py:
    8:1  I001 [*] Import block is un-sorted or un-formatted
    9:8  F401 [*] `sys` imported but unused
   41:29 F541 [*] f-string without any placeholders
  115:5  I001 [*] Import block is un-sorted or un-formatted
  147:38 UP015 [*] Unnecessary mode argument
  154:16 UP024 [*] Replace aliased errors with `OSError`
  274:5  I001 [*] Import block is un-sorted or un-formatted

src/config.py:
    3:1  I001 [*] Import block is un-sorted or un-formatted
    7:1  UP035 `typing.Tuple` is deprecated, use `tuple` instead
    8:22 F401 [*] `zoneinfo.ZoneInfo` imported but unused
   11:8  F401 [*] `socket` imported but unused
   12:8  F811 [*] Redefinition of unused `time` from line 9: `time` redefined here
   12:8  F401 [*] `time` imported but unused
   28:30 S105 Possible hardcoded password assigned to: "postgres_password"
   35:21 UP045 [*] Use `X | None` for type annotations
   43:25 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
   44:27 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
   47:23 UP045 [*] Use `X | None` for type annotations
   50:25 UP045 [*] Use `X | None` for type annotations
   91:25 UP045 [*] Use `X | None` for type annotations
   92:17 UP045 [*] Use `X | None` for type annotations
  104:17 UP045 [*] Use `X | None` for type annotations
  146:32 UP045 [*] Use `X | None` for type annotations
  157:36 UP015 [*] Unnecessary mode argument
  164:17 F541 [*] f-string without any placeholders
  186:9  F841 Local variable `api` is assigned to but never used
  345:20 E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
  347:22 E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
  349:22 E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
  352:36 UP006 [*] Use `tuple` instead of `Tuple` for type annotation

src/dashboard_cache.py:
   87:29 UP045 [*] Use `X | None` for type annotations
  117:35 UP045 [*] Use `X | None` for type annotations
  160:35 UP045 [*] Use `X | None` for type annotations

src/database.py:
     8:1  I001 [*] Import block is un-sorted or un-formatted
    11:1  UP035 `typing.List` is deprecated, use `list` instead
    11:1  UP035 `typing.Dict` is deprecated, use `dict` instead
    12:22 F401 [*] `zoneinfo.ZoneInfo` imported but unused
    16:31 F401 [*] `sqlalchemy.engine.Engine` imported but unused
    18:22 F401 [*] `ip_utils.is_local_or_private_ip` imported but unused
    18:46 F401 [*] `ip_utils.is_valid_public_ip` imported but unused
    46:1  E402 Module level import not at top of file
    47:1  E402 Module level import not at top of file
   273:23 UP045 [*] Use `X | None` for type annotations
   273:32 UP006 [*] Use `list` instead of `List` for type annotation
   274:27 UP045 [*] Use `X | None` for type annotations
   274:36 UP006 [*] Use `dict` instead of `Dict` for type annotation
   275:22 UP045 [*] Use `X | None` for type annotations
   432:19 UP045 [*] Use `X | None` for type annotations
   433:19 UP045 [*] Use `X | None` for type annotations
   434:10 UP045 [*] Use `X | None` for type annotations
   740:27 UP006 [*] Use `dict` instead of `Dict` for type annotation
   742:26 UP006 [*] Use `dict` instead of `Dict` for type annotation
   835:23 UP045 [*] Use `X | None` for type annotations
   858:48 UP006 [*] Use `list` instead of `List` for type annotation
   858:53 UP006 [*] Use `dict` instead of `Dict` for type annotation
   895:18 UP006 [*] Use `dict` instead of `Dict` for type annotation
   896:15 UP045 [*] Use `X | None` for type annotations
   897:19 UP045 [*] Use `X | None` for type annotations
   898:20 UP045 [*] Use `X | None` for type annotations
   899:18 UP045 [*] Use `X | None` for type annotations
   900:17 UP045 [*] Use `X | None` for type annotations
   901:22 UP045 [*] Use `X | None` for type annotations
   902:19 UP045 [*] Use `X | None` for type annotations
   903:14 UP045 [*] Use `X | None` for type annotations
   904:18 UP045 [*] Use `X | None` for type annotations
   905:19 UP045 [*] Use `X | None` for type annotations
   906:21 UP045 [*] Use `X | None` for type annotations
   962:29 F841 [*] Local variable `e` is assigned to but never used
   968:55 UP006 [*] Use `list` instead of `List` for type annotation
  1017:47 UP006 [*] Use `list` instead of `List` for type annotation
  1031:25 E712 Avoid equality comparisons to `True`; use `IpStats.need_reevaluation:` for truth checks
  1064:21 E712 Avoid equality comparisons to `False`; use `not IpStats.need_reevaluation:` for false checks
  1065:21 E712 Avoid equality comparisons to `False`; use `not IpStats.manual_category:` for false checks
  1074:29 F841 [*] Local variable `e` is assigned to but never used
  1093:21 E712 Avoid equality comparisons to `False`; use `not IpStats.need_reevaluation:` for false checks
  1094:21 E712 Avoid equality comparisons to `False`; use `not IpStats.manual_category:` for false checks
  1103:29 F841 [*] Local variable `e` is assigned to but never used
  1113:20 UP045 [*] Use `X | None` for type annotations
  1115:24 UP045 [*] Use `X | None` for type annotations
  1117:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1149:38 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  1161:50 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  1196:20 UP045 [*] Use `X | None` for type annotations
  1198:24 UP045 [*] Use `X | None` for type annotations
  1199:10 UP006 [*] Use `list` instead of `List` for type annotation
  1199:15 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1224:38 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  1249:61 UP045 [*] Use `X | None` for type annotations
  1250:10 UP006 [*] Use `list` instead of `List` for type annotation
  1250:15 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1287:49 UP006 [*] Use `list` instead of `List` for type annotation
  1287:54 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1330:46 UP045 [*] Use `X | None` for type annotations
  1330:55 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1405:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1502:21 UP045 [*] Use `X | None` for type annotations
  1502:30 UP006 [*] Use `list` instead of `List` for type annotation
  1503:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1607:46 UP006 [*] Use `list` instead of `List` for type annotation
  1607:60 UP006 [*] Use `list` instead of `List` for type annotation
  1622:29 E712 Avoid equality comparisons to `True`; use `IpStats.ban_override:` for truth checks
  1625:21 E712 Avoid equality comparisons to `True`; use `IpStats.ban_override:` for truth checks
  1632:62 UP045 [*] Use `X | None` for type annotations
  1638:39 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1678:34 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  1682:27 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  1686:31 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  1711:47 UP006 [*] Use `list` instead of `List` for type annotation
  1736:69 UP006 [*] Use `list` instead of `List` for type annotation
  1763:75 UP006 [*] Use `list` instead of `List` for type annotation
  1791:57 UP006 [*] Use `list` instead of `List` for type annotation
  1791:62 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1810:25 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  1829:45 UP006 [*] Use `list` instead of `List` for type annotation
  1842:25 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  1848:23 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1848:33 UP006 [*] Use `list` instead of `List` for type annotation
  1858:54 UP006 [*] Use `list` instead of `List` for type annotation
  1858:59 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1899:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1924:17 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  1931:17 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  1957:25 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  1963:27 UP006 [*] Use `dict` instead of `Dict` for type annotation
  1963:37 UP006 [*] Use `list` instead of `List` for type annotation
  1994:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2074:17 UP045 [*] Use `X | None` for type annotations
  2075:21 UP045 [*] Use `X | None` for type annotations
  2075:30 UP006 [*] Use `list` instead of `List` for type annotation
  2076:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2163:17 UP045 [*] Use `X | None` for type annotations
  2166:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2194:38 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks
  2246:17 UP045 [*] Use `X | None` for type annotations
  2248:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2328:20 UP045 [*] Use `X | None` for type annotations
  2329:29 UP045 [*] Use `X | None` for type annotations
  2330:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2430:53 UP045 [*] Use `X | None` for type annotations
  2451:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2494:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2551:40 F401 [*] `sqlalchemy.literal_column` imported but unused
  2651:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  2831:51 UP045 [*] Use `X | None` for type annotations
  2889:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  3001:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  3050:10 UP006 [*] Use `dict` instead of `Dict` for type annotation
  3151:9  I001 [*] Import block is un-sorted or un-formatted
  3211:9  I001 [*] Import block is un-sorted or un-formatted
  3232:13 B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
  3279:9  I001 [*] Import block is un-sorted or un-formatted
  3304:13 B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling

src/deception_responses.py:
    3:1  I001 [*] Import block is un-sorted or un-formatted
    7:1  UP035 `typing.Tuple` is deprecated, use `tuple` instead
    7:1  UP035 `typing.Dict` is deprecated, use `dict` instead
    7:37 F401 [*] `typing.Dict` imported but unused
   66:22 F541 [*] f-string without any placeholders
   69:18 F541 [*] f-string without any placeholders
  190:52 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  218:41 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  275:61 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  380:56 UP045 [*] Use `X | None` for type annotations
  409:6  UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  448:6  UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  448:12 UP045 [*] Use `X | None` for type annotations
  448:27 UP045 [*] Use `X | None` for type annotations
  448:42 UP045 [*] Use `X | None` for type annotations
  505:22 F541 [*] f-string without any placeholders
  566:32 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  624:19 F541 [*] f-string without any placeholders
  632:6  UP045 [*] Use `X | None` for type annotations
  632:15 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  647:21 F541 [*] f-string without any placeholders

src/dependencies.py:
   8:1  I001 [*] Import block is un-sorted or un-formatted
  18:20 F401 [*] `logger.get_app_logger` imported but unused
  18:36 F401 [*] `logger.get_access_logger` imported but unused
  18:55 F401 [*] `logger.get_credential_logger` imported but unused
  81:12 S104 Possible binding to all interfaces
  90:16 F541 [*] f-string without any placeholders

src/firewall/fwtype.py:
  2:1  UP035 `typing.Dict` is deprecated, use `dict` instead
  2:1  UP035 `typing.Type` is deprecated, use `type` instead
  9:16 UP006 [*] Use `dict` instead of `Dict` for type annotation
  9:26 UP006 [*] Use `type` instead of `Type` for type annotation

src/firewall/iptables.py:
  1:1 UP035 [*] Import from `typing` instead: `override`
  1:1 I001 [*] Import block is un-sorted or un-formatted

src/firewall/nftables.py:
  1:1 UP035 [*] Import from `typing` instead: `override`
  1:1 I001 [*] Import block is un-sorted or un-formatted

src/firewall/raw.py:
  1:1 UP035 [*] Import from `typing` instead: `override`
  1:1 I001 [*] Import block is un-sorted or un-formatted

src/generative_ai.py:
    9:1  I001 [*] Import block is un-sorted or un-formatted
    9:8  F401 [*] `json` imported but unused
   14:8  F401 [*] `re` imported but unused
   15:1  UP035 `typing.Tuple` is deprecated, use `tuple` instead
   15:1  UP035 `typing.List` is deprecated, use `list` instead
   24:27 UP045 [*] Use `X | None` for type annotations
   24:36 UP006 [*] Use `list` instead of `List` for type annotation
   27:19 UP045 [*] Use `X | None` for type annotations
  113:42 UP015 [*] Unnecessary mode argument
  118:46 UP015 [*] Unnecessary mode argument
  148:22 UP045 [*] Use `X | None` for type annotations
  229:5  I001 [*] Import block is un-sorted or un-formatted
  237:5  F841 Local variable `today` is assigned to but never used
  251:33 UP006 [*] Use `list` instead of `List` for type annotation
  274:40 UP015 [*] Unnecessary mode argument
  326:46 UP045 [*] Use `X | None` for type annotations
  560:12 UP041 [*] Replace aliased errors with `TimeoutError`
  573:6  UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  607:28 F541 [*] f-string without any placeholders
  727:5  S110 `try`-`except`-`pass` detected, consider logging the exception

src/generators.py:
    7:1  I001 [*] Import block is un-sorted or un-formatted
   18:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   18:50 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   25:25 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   26:20 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   26:57 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   27:20 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   27:56 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   28:25 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   30:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   38:26 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   47:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   53:19 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   54:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   60:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   66:9  B007 Loop control variable `i` not used within loop body
   66:20 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   80:9  B007 Loop control variable `i` not used within loop body
   80:20 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   91:20 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
   99:25 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  111:23 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  116:23 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  118:17 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  123:23 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  127:23 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  129:17 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  149:29 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  157:39 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  158:26 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  167:31 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  178:29 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  187:25 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  195:29 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  196:26 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  202:32 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  203:8  S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  204:25 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  211:32 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  212:32 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  227:13 S311 Standard pseudo-random generators are not suitable for cryptographic purposes

src/geo_utils.py:
   6:1  I001 [*] Import block is un-sorted or un-formatted
   8:1  UP035 `typing.Dict` is deprecated, use `dict` instead
  14:46 UP045 [*] Use `X | None` for type annotations
  14:55 UP006 [*] Use `dict` instead of `Dict` for type annotation
  59:53 UP045 [*] Use `X | None` for type annotations
  59:62 UP006 [*] Use `dict` instead of `Dict` for type annotation
  90:46 UP045 [*] Use `X | None` for type annotations
  90:55 UP006 [*] Use `dict` instead of `Dict` for type annotation

src/ip_utils.py:
  39:28 S104 Possible binding to all interfaces
  46:44 UP045 [*] Use `X | None` for type annotations

src/logger.py:
  8:1 I001 [*] Import block is un-sorted or un-formatted

src/middleware/deception.py:
  8:1 I001 [*] Import block is un-sorted or un-formatted

src/migrations/add_category_history.py:
  13:1  I001 [*] Import block is un-sorted or un-formatted
  13:36 F401 [*] `database.DatabaseManager` imported but unused
  14:20 F401 [*] `models.Base` imported but unused

src/migrations/add_performance_indexes.py:
  8:1 I001 [*] Import block is un-sorted or un-formatted

src/migrations/add_raw_request_column.py:
   8:1  I001 [*] Import block is un-sorted or un-formatted
  11:21 F401 [*] `pathlib.Path` imported but unused

src/migrations/runner.py:
   16:1  UP035 `typing.List` is deprecated, use `list` instead
   58:51 UP006 [*] Use `list` instead of `List` for type annotation
   77:53 UP006 [*] Use `list` instead of `List` for type annotation
  105:50 UP006 [*] Use `list` instead of `List` for type annotation
  151:14 UP006 [*] Use `list` instead of `List` for type annotation

src/models.py:
    8:1  I001 [*] Import block is un-sorted or un-formatted
    9:1  UP035 `typing.List` is deprecated, use `list` instead
    9:1  UP035 `typing.Dict` is deprecated, use `dict` instead
   56:24 UP045 [*] Use `X | None` for type annotations
   68:25 UP045 [*] Use `X | None` for type annotations
   71:31 UP006 [*] Use `list` instead of `List` for type annotation
  100:22 UP045 [*] Use `X | None` for type annotations
  103:22 UP045 [*] Use `X | None` for type annotations
  135:29 UP045 [*] Use `X | None` for type annotations
  173:26 UP045 [*] Use `X | None` for type annotations
  174:18 UP045 [*] Use `X | None` for type annotations
  175:21 UP045 [*] Use `X | None` for type annotations
  176:20 UP045 [*] Use `X | None` for type annotations
  177:25 UP045 [*] Use `X | None` for type annotations
  178:22 UP045 [*] Use `X | None` for type annotations
  179:17 UP045 [*] Use `X | None` for type annotations
  180:21 UP045 [*] Use `X | None` for type annotations
  181:22 UP045 [*] Use `X | None` for type annotations
  182:23 UP045 [*] Use `X | None` for type annotations
  183:17 UP045 [*] Use `X | None` for type annotations
  184:21 UP045 [*] Use `X | None` for type annotations
  187:22 UP045 [*] Use `X | None` for type annotations
  188:24 UP045 [*] Use `X | None` for type annotations
  189:21 UP045 [*] Use `X | None` for type annotations
  189:30 UP006 [*] Use `dict` instead of `Dict` for type annotation
  192:30 UP045 [*] Use `X | None` for type annotations
  193:31 UP045 [*] Use `X | None` for type annotations
  196:32 UP045 [*] Use `X | None` for type annotations
  201:30 UP006 [*] Use `dict` instead of `Dict` for type annotation
  203:29 UP006 [*] Use `dict` instead of `Dict` for type annotation
  212:27 UP045 [*] Use `X | None` for type annotations
  217:26 UP045 [*] Use `X | None` for type annotations
  243:26 UP045 [*] Use `X | None` for type annotations
  272:22 UP045 [*] Use `X | None` for type annotations
  274:26 UP045 [*] Use `X | None` for type annotations
  275:18 UP045 [*] Use `X | None` for type annotations
  276:23 UP045 [*] Use `X | None` for type annotations

src/routes/api.py:
    9:1  I001 [*] Import block is un-sorted or un-formatted
   17:58 F401 [*] `fastapi.Cookie` imported but unused
  716:5  I001 [*] Import block is un-sorted or un-formatted
  851:5  I001 [*] Import block is un-sorted or un-formatted
  917:5  I001 [*] Import block is un-sorted or un-formatted

src/routes/dashboard.py:
  8:1 I001 [*] Import block is un-sorted or un-formatted

src/routes/honeypot.py:
    8:1  I001 [*] Import block is un-sorted or un-formatted
   10:8  F401 [*] `time` imported but unused
   12:26 F401 [*] `urllib.parse.urlparse` imported but unused
   12:46 F401 [*] `urllib.parse.unquote_plus` imported but unused
   18:5  F401 [*] `dependencies.get_tracker` imported but unused
   19:5  F401 [*] `dependencies.get_app_config` imported but unused
   24:21 F401 [*] `tracker.AccessTracker` imported but unused
  109:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  117:12 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  164:5  F841 Local variable `user_agent` is assigned to but never used
  165:5  F841 Local variable `tracker` is assigned to but never used
  167:5  F841 Local variable `app_logger` is assigned to but never used
  360:5  F841 Local variable `app_logger` is assigned to but never used
  603:21 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  631:17 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  646:21 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  647:36 S311 Standard pseudo-random generators are not suitable for cryptographic purposes
  657:23 S311 Standard pseudo-random generators are not suitable for cryptographic purposes

src/routes/htmx.py:
  8:1 I001 [*] Import block is un-sorted or un-formatted

src/sanitizer.py:
    8:1  I001 [*] Import block is un-sorted or un-formatted
   10:1  UP035 `typing.Dict` is deprecated, use `dict` instead
   23:33 UP045 [*] Use `X | None` for type annotations
   51:24 UP045 [*] Use `X | None` for type annotations
   56:26 UP045 [*] Use `X | None` for type annotations
   61:32 UP045 [*] Use `X | None` for type annotations
   66:32 UP045 [*] Use `X | None` for type annotations
   71:36 UP045 [*] Use `X | None` for type annotations
   76:24 UP045 [*] Use `X | None` for type annotations
   94:34 UP045 [*] Use `X | None` for type annotations
  115:26 UP045 [*] Use `X | None` for type annotations
  115:35 UP006 [*] Use `dict` instead of `Dict` for type annotation

src/tasks/analyze_ips.py:
    1:1  I001 [*] Import block is un-sorted or un-formatted
  102:28 UP015 [*] Unnecessary mode argument

src/tasks/dashboard_warmup.py:
  8:1 I001 [*] Import block is un-sorted or un-formatted

src/tasks/db_dump.py:
   3:1  I001 [*] Import block is un-sorted or un-formatted
  90:18 S603 `subprocess` call: check for execution of untrusted input

src/tasks/db_retention.py:
   8:1  I001 [*] Import block is un-sorted or un-formatted
  37:9  I001 [*] Import block is un-sorted or un-formatted
  56:13 E712 Avoid equality comparisons to `False`; use `not AccessLog.is_suspicious:` for false checks
  57:13 E712 Avoid equality comparisons to `False`; use `not AccessLog.is_honeypot_trigger:` for false checks
  70:17 E712 Avoid equality comparisons to `False`; use `not AccessLog.is_suspicious:` for false checks
  71:17 E712 Avoid equality comparisons to `False`; use `not AccessLog.is_honeypot_trigger:` for false checks
  81:21 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  82:21 E712 Avoid equality comparisons to `True`; use `AccessLog.is_honeypot_trigger:` for truth checks

src/tasks/fetch_ip_rep.py:
  1:1 I001 [*] Import block is un-sorted or un-formatted

src/tasks/flush_access_logs.py:
  11:1 I001 [*] Import block is un-sorted or un-formatted

src/tasks/pre_retention_cleanup.py:
   11:1  I001 [*] Import block is un-sorted or un-formatted
  165:21 E712 Avoid equality comparisons to `True`; use `AccessLog.is_suspicious:` for truth checks
  166:21 E712 Avoid equality comparisons to `False`; use `not AccessLog.is_honeypot_trigger:` for false checks

src/tasks_master.py:
   1:1 I001 [*] Import block is un-sorted or un-formatted
  10:5 F401 [*] `logger.initialize_logging` imported but unused
  12:5 F401 [*] `logger.get_access_logger` imported but unused
  13:5 F401 [*] `logger.get_credential_logger` imported but unused
  19:5 I001 [*] Import block is un-sorted or un-formatted

src/templates/__init__.py:
  7:1 I001 [*] Import block is un-sorted or un-formatted

src/templates/template_loader.py:
   9:1  UP035 `typing.Dict` is deprecated, use `dict` instead
  19:18 UP006 [*] Use `dict` instead of `Dict` for type annotation

src/tracker.py:
    3:1  UP035 `typing.Dict` is deprecated, use `dict` instead
    3:1  UP035 `typing.Tuple` is deprecated, use `tuple` instead
    3:1  I001 [*] Import block is un-sorted or un-formatted
   40:21 UP045 [*] Use `X | None` for type annotations
  100:21 UP045 [*] Use `X | None` for type annotations
  114:52 UP006 [*] Use `tuple` instead of `Tuple` for type annotation
  443:28 UP006 [*] Use `dict` instead of `Dict` for type annotation

src/wordlists.py:
  25:36 UP015 [*] Unnecessary mode argument

Found 381 errors.
[*] 272 fixable with the `--fix` option (35 hidden fixes can be enabled with the `--unsafe-fixes` option).

To fix auto-fixable issues locally:

ruff check --fix --unsafe-fixes src/

Then address any remaining S (security) findings manually.

@BlessedRebuS BlessedRebuS merged commit 47bd3a6 into dev May 20, 2026
4 of 5 checks passed
@BlessedRebuS BlessedRebuS deleted the feat/bulk-export-import-deception-pages branch May 20, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants