spidey121 commited on
Commit
9110548
Β·
1 Parent(s): 8cf7800

fix startup order

Browse files
Files changed (1) hide show
  1. README.md +146 -42
README.md CHANGED
@@ -7,73 +7,85 @@ sdk: docker
7
  app_port: 7860
8
  pinned: false
9
  ---
10
- # AI Cyber Deception OpenEnv
 
11
 
12
  ## Overview
13
 
14
- This project implements a real-world AI Cyber Deception environment where an AI agent learns to detect and mitigate cyber attacks such as brute force, port scanning, and credential stuffing.
 
 
 
 
15
 
16
- The environment follows the OpenEnv specification and supports step(), reset(), and state() APIs.
 
 
17
 
18
  ---
19
 
20
- ## Real-world Task
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 IPs
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
- - request logs
50
 
51
  ---
52
 
53
- ## Tasks
54
 
55
  ### Easy Task
56
  Detect brute force attack
57
 
58
  ### Medium Task
59
- Deploy honeypot after detecting attack
60
 
61
  ### Hard Task
62
- Block malicious attacker
63
 
64
  ---
65
 
66
- ## Reward Function
67
 
68
  | Action | Reward |
69
  |--------|--------|
70
- | detect_attack | 0.4 |
71
- | deploy_honeypot | 0.2 |
72
- | block_ip | 0.3 |
 
 
 
73
 
74
  ---
75
 
76
- ## APIs
 
 
77
 
78
  - `/reset`
79
  - `/step`
@@ -81,35 +93,127 @@ Block malicious attacker
81
  - `/logs`
82
  - `/status`
83
 
 
 
 
 
 
 
 
 
84
  ---
85
 
86
- ## Setup
87
 
88
- ### Run locally
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
- Hugging Face Deployment
 
 
 
 
 
 
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
- Example:
107
-
108
- [START]
109
- [STEP]
110
- [STEP]
111
- [STEP]
112
- [END]
113
- Architecture
114
-
115
- Attacker β†’ Fake Server β†’ AI Agent β†’ Defense Actions β†’ Reward
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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