Spaces:
Runtime error
Runtime error
fix round 1
Browse files- env/env.py +14 -0
env/env.py
CHANGED
|
@@ -45,6 +45,20 @@ class DeceptionEnv:
|
|
| 45 |
reward += 0.2
|
| 46 |
break
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Deploy honeypot
|
| 49 |
elif action == "deploy_honeypot":
|
| 50 |
deploy_honeypot()
|
|
|
|
| 45 |
reward += 0.2
|
| 46 |
break
|
| 47 |
|
| 48 |
+
# Detect SQL injection
|
| 49 |
+
if action == "detect_attack":
|
| 50 |
+
for r in requests_log:
|
| 51 |
+
if isinstance(r, dict) and r.get("type") == "sql_injection":
|
| 52 |
+
reward += 0.2
|
| 53 |
+
break
|
| 54 |
+
|
| 55 |
+
# Detect directory traversal
|
| 56 |
+
if action == "detect_attack":
|
| 57 |
+
for r in requests_log:
|
| 58 |
+
if isinstance(r, dict) and r.get("type") == "directory_traversal":
|
| 59 |
+
reward += 0.2
|
| 60 |
+
break
|
| 61 |
+
|
| 62 |
# Deploy honeypot
|
| 63 |
elif action == "deploy_honeypot":
|
| 64 |
deploy_honeypot()
|