Spaces:
Runtime error
Runtime error
fix startup order
Browse files
README.md
CHANGED
|
@@ -7,73 +7,85 @@ sdk: docker
|
|
| 7 |
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
## Overview
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
---
|
| 19 |
|
| 20 |
-
## Real-
|
| 21 |
|
| 22 |
Simulate cybersecurity defense in a production-like environment:
|
| 23 |
|
| 24 |
- Detect brute force attacks
|
| 25 |
- Detect port scanning
|
| 26 |
- Deploy deception mechanisms
|
| 27 |
-
- Block malicious
|
| 28 |
|
| 29 |
---
|
| 30 |
|
| 31 |
-
## Action Space
|
| 32 |
|
| 33 |
-
The agent can perform:
|
| 34 |
|
| 35 |
-
- detect_attack
|
| 36 |
-
- deploy_honeypot
|
| 37 |
-
- fake_database
|
| 38 |
-
- block_ip
|
| 39 |
|
| 40 |
---
|
| 41 |
|
| 42 |
-
## Observation Space
|
| 43 |
|
| 44 |
-
Environment returns:
|
| 45 |
|
| 46 |
-
- failed_logins
|
| 47 |
-
- port_scans
|
| 48 |
-
- suspicious_ips
|
| 49 |
-
-
|
| 50 |
|
| 51 |
---
|
| 52 |
|
| 53 |
-
## Tasks
|
| 54 |
|
| 55 |
### Easy Task
|
| 56 |
Detect brute force attack
|
| 57 |
|
| 58 |
### Medium Task
|
| 59 |
-
|
| 60 |
|
| 61 |
### Hard Task
|
| 62 |
-
|
| 63 |
|
| 64 |
---
|
| 65 |
|
| 66 |
-
## Reward Function
|
| 67 |
|
| 68 |
| Action | Reward |
|
| 69 |
|--------|--------|
|
| 70 |
-
| detect_attack | 0.
|
| 71 |
-
| deploy_honeypot | 0.
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
---
|
| 75 |
|
| 76 |
-
##
|
|
|
|
|
|
|
| 77 |
|
| 78 |
- `/reset`
|
| 79 |
- `/step`
|
|
@@ -81,35 +93,127 @@ Block malicious attacker
|
|
| 81 |
- `/logs`
|
| 82 |
- `/status`
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
---
|
| 85 |
|
| 86 |
-
##
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
```bash
|
| 91 |
pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
| 92 |
python inference.py
|
| 93 |
|
| 94 |
-
Docker
|
|
|
|
|
|
|
|
|
|
| 95 |
docker build -t ai-deception .
|
| 96 |
-
docker run ai-deception
|
| 97 |
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
https://bytecore1-ai-deception-openenv.hf.space/
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
https://bytecore1-ai-deception-openenv.hf.space/state
|
| 101 |
https://bytecore1-ai-deception-openenv.hf.space/status
|
| 102 |
https://bytecore1-ai-deception-openenv.hf.space/logs
|
| 103 |
|
| 104 |
-
Baseline Results
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
[
|
| 109 |
-
[STEP]
|
| 110 |
-
[STEP]
|
| 111 |
-
[
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
Attacker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
+
|
| 11 |
+
# π‘οΈ AI Cyber Deception OpenEnv
|
| 12 |
|
| 13 |
## Overview
|
| 14 |
|
| 15 |
+
AI Cyber Deception OpenEnv is a real-world cybersecurity simulation environment where an AI agent learns to detect, deceive, and mitigate cyber attacks.
|
| 16 |
+
|
| 17 |
+
This environment simulates production-like cybersecurity defense scenarios including brute force attacks, port scanning, and credential stuffing.
|
| 18 |
+
|
| 19 |
+
The environment follows the **OpenEnv specification** and supports:
|
| 20 |
|
| 21 |
+
- `reset()`
|
| 22 |
+
- `step()`
|
| 23 |
+
- `state()`
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
+
## π― Real-World Task
|
| 28 |
|
| 29 |
Simulate cybersecurity defense in a production-like environment:
|
| 30 |
|
| 31 |
- Detect brute force attacks
|
| 32 |
- Detect port scanning
|
| 33 |
- Deploy deception mechanisms
|
| 34 |
+
- Block malicious attackers
|
| 35 |
|
| 36 |
---
|
| 37 |
|
| 38 |
+
## βοΈ Action Space
|
| 39 |
|
| 40 |
+
The AI agent can perform the following actions:
|
| 41 |
|
| 42 |
+
- `detect_attack`
|
| 43 |
+
- `deploy_honeypot`
|
| 44 |
+
- `fake_database`
|
| 45 |
+
- `block_ip`
|
| 46 |
|
| 47 |
---
|
| 48 |
|
| 49 |
+
## ποΈ Observation Space
|
| 50 |
|
| 51 |
+
Environment returns structured observation:
|
| 52 |
|
| 53 |
+
- `failed_logins`
|
| 54 |
+
- `port_scans`
|
| 55 |
+
- `suspicious_ips`
|
| 56 |
+
- `request_logs`
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
+
## π§ Tasks
|
| 61 |
|
| 62 |
### Easy Task
|
| 63 |
Detect brute force attack
|
| 64 |
|
| 65 |
### Medium Task
|
| 66 |
+
Detect attack and deploy honeypot
|
| 67 |
|
| 68 |
### Hard Task
|
| 69 |
+
Detect, deceive, and block attacker
|
| 70 |
|
| 71 |
---
|
| 72 |
|
| 73 |
+
## π Reward Function
|
| 74 |
|
| 75 |
| Action | Reward |
|
| 76 |
|--------|--------|
|
| 77 |
+
| detect_attack | 0.20 |
|
| 78 |
+
| deploy_honeypot | 0.30 |
|
| 79 |
+
| fake_database | 0.20 |
|
| 80 |
+
| block_ip | 0.50 |
|
| 81 |
+
|
| 82 |
+
Reward range normalized between **0.0 β 1.0**
|
| 83 |
|
| 84 |
---
|
| 85 |
|
| 86 |
+
## π API Endpoints
|
| 87 |
+
|
| 88 |
+
Available endpoints:
|
| 89 |
|
| 90 |
- `/reset`
|
| 91 |
- `/step`
|
|
|
|
| 93 |
- `/logs`
|
| 94 |
- `/status`
|
| 95 |
|
| 96 |
+
Example:
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
POST /reset
|
| 100 |
+
POST /step
|
| 101 |
+
GET /state
|
| 102 |
+
|
| 103 |
+
|
| 104 |
---
|
| 105 |
|
| 106 |
+
## π Run Locally
|
| 107 |
|
| 108 |
+
Install dependencies:
|
| 109 |
|
| 110 |
```bash
|
| 111 |
pip install -r requirements.txt
|
| 112 |
+
|
| 113 |
+
Run inference:
|
| 114 |
+
|
| 115 |
python inference.py
|
| 116 |
|
| 117 |
+
π³ Docker
|
| 118 |
+
|
| 119 |
+
Build:
|
| 120 |
+
|
| 121 |
docker build -t ai-deception .
|
|
|
|
| 122 |
|
| 123 |
+
Run:
|
| 124 |
+
|
| 125 |
+
docker run -p 7860:7860 ai-deception
|
| 126 |
+
|
| 127 |
+
π€ Hugging Face Deployment
|
| 128 |
+
Live Space:
|
| 129 |
+
|
| 130 |
https://bytecore1-ai-deception-openenv.hf.space/
|
| 131 |
+
|
| 132 |
+
Endpoints:
|
| 133 |
+
|
| 134 |
+
https://bytecore1-ai-deception-openenv.hf.space/reset
|
| 135 |
https://bytecore1-ai-deception-openenv.hf.space/state
|
| 136 |
https://bytecore1-ai-deception-openenv.hf.space/status
|
| 137 |
https://bytecore1-ai-deception-openenv.hf.space/logs
|
| 138 |
|
| 139 |
+
π Baseline Results
|
| 140 |
+
Example run:
|
| 141 |
+
|
| 142 |
+
[START] task=ai-deception env=cyber-security model=Qwen
|
| 143 |
+
[STEP] step=1 action=detect_attack reward=0.20 done=false error=null
|
| 144 |
+
[STEP] step=2 action=deploy_honeypot reward=0.30 done=false error=null
|
| 145 |
+
[STEP] step=3 action=block_ip reward=0.50 done=true error=null
|
| 146 |
+
[END] success=true steps=3 score=1.00 rewards=0.20,0.30,0.50
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
ποΈ Architecture
|
| 150 |
+
Attacker
|
| 151 |
+
β
|
| 152 |
+
Fake Server
|
| 153 |
+
β
|
| 154 |
+
AI Agent (Inference)
|
| 155 |
+
β
|
| 156 |
+
Defense Actions
|
| 157 |
+
β
|
| 158 |
+
Reward
|
| 159 |
+
|
| 160 |
+
π¦ Project Structure
|
| 161 |
+
|
| 162 |
+
ai-deception-openenv/
|
| 163 |
+
β
|
| 164 |
+
βββ env/
|
| 165 |
+
β βββ __init__.py
|
| 166 |
+
β βββ attacker.py
|
| 167 |
+
β βββ deception.py
|
| 168 |
+
β βββ env.py
|
| 169 |
+
β βββ fake_server.py
|
| 170 |
+
β βββ test_env.py
|
| 171 |
+
β βββ test_server.py
|
| 172 |
+
β
|
| 173 |
+
βββ tasks/
|
| 174 |
+
β βββ __init__.py
|
| 175 |
+
β βββ easy.py
|
| 176 |
+
β βββ medium.py
|
| 177 |
+
β βββ hard.py
|
| 178 |
+
β βββ test_tasks.py
|
| 179 |
+
β
|
| 180 |
+
βββ inference.py
|
| 181 |
+
βββ app.py
|
| 182 |
+
βββ models.py
|
| 183 |
+
βββ openenv.yaml
|
| 184 |
+
βββ Dockerfile
|
| 185 |
+
βββ requirements.txt
|
| 186 |
+
βββ README.md
|
| 187 |
+
βββ .gitignore
|
| 188 |
+
βββ .gitattributes
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
β
OpenEnv Compliance
|
| 192 |
+
reset() implemented
|
| 193 |
+
step() implemented
|
| 194 |
+
state() implemented
|
| 195 |
+
Docker support
|
| 196 |
+
Structured logs
|
| 197 |
+
Multiple tasks
|
| 198 |
+
Reward normalization
|
| 199 |
+
|
| 200 |
+
π¨βπ» Use Case
|
| 201 |
+
This environment can be used for:
|
| 202 |
+
|
| 203 |
+
Cybersecurity research
|
| 204 |
+
Reinforcement learning
|
| 205 |
+
AI defense strategy training
|
| 206 |
+
Red team vs blue team simulations
|
| 207 |
+
|
| 208 |
+
π‘οΈ AI Cyber Deception
|
| 209 |
+
This project demonstrates how AI can:
|
| 210 |
+
|
| 211 |
+
Detect attackers
|
| 212 |
+
Deploy deception
|
| 213 |
+
Block malicious actors
|
| 214 |
+
Learn defensive strategies
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
License
|
| 218 |
+
|
| 219 |
+
MIT License
|