Skip to content

Commit 9a7d8c3

Browse files
authored
Merge pull request #111 from BitGo/WP-5556/test-awm-isolate
feat(mbe): Setup and test awm in an isolated network env
2 parents a72f2f8 + ccbb18a commit 9a7d8c3

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,56 @@ Notes:
263263
- The `:Z` option in volume mounts is specific to SELinux-enabled systems and ensures proper volume labeling
264264
- The logs directory will be created with appropriate permissions if it doesn't exist
265265

266+
## Docker Compose Deployment
267+
268+
The application includes a Docker Compose configuration that runs both Advanced Wallet Manager (AWM) and Master BitGo Express (MBE) services with proper network isolation for enhanced security.
269+
270+
### Architecture Overview
271+
272+
The Docker Compose setup creates two isolated services:
273+
274+
- **Advanced Wallet Manager (AWM)**: Runs in an isolated internal network with no external access for maximum security
275+
- **Master BitGo Express (MBE)**: Connected to both internal network (for AWM communication) and public network (for external API access)
276+
- **Network Isolation**: AWM is completely isolated from external networks and only accessible through MBE
277+
278+
### Network Configuration
279+
280+
The setup creates two distinct networks:
281+
282+
1. **my-internal-network**:
283+
- Internal bridge network with `internal: true`
284+
- Used for secure AWM isolation and MBE-to-AWM communication
285+
- No external internet access for security
286+
287+
2. **my-public-network**:
288+
- Public bridge network
289+
- Used for external access to MBE APIs
290+
- Connected to host networking
291+
292+
### Prerequisites
293+
294+
1. **Install Docker and Docker Compose**
295+
2. **Ensure KMS service is running** on your host machine (typically on port 3000)
296+
297+
### Quick Start
298+
299+
1. **Start the services:**
300+
301+
```bash
302+
# Navigate to project directory
303+
cd advanced-wallet
304+
305+
# Start both services in background
306+
docker-compose up -d
307+
```
308+
309+
2. **Stop the services:**
310+
311+
```bash
312+
# Stop and remove containers
313+
docker-compose down
314+
```
315+
266316
## API Endpoints
267317

268318
### Advanced Wallet Manager (Port 3080)

docker-compose.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: '3.8'
2+
3+
services:
4+
# Service for advanced-wallet-manager (AWM)
5+
advanced-wallet-manager:
6+
build: . # Build from the Dockerfile inside the repo
7+
container_name: advanced-wallet-manager
8+
networks:
9+
- my-internal-network # Only part of the internal network
10+
environment:
11+
- ADVANCED_WALLET_MANAGER_PORT=3081
12+
- TLS_MODE=disabled
13+
- ALLOW_SELF_SIGNED=true
14+
- MTLS_REQUEST_CERT=false
15+
- RECOVERY_MODE=true
16+
- APP_MODE=advanced-wallet-manager
17+
- KMS_URL=http://172.20.0.1:3000
18+
- BIND=0.0.0.0
19+
restart: always
20+
ports: [] # No public ports exposed
21+
22+
# Service for master-bitgo-express (MBE) - both internal and publicly accessible
23+
master-bitgo-express:
24+
build: . # Build from the Dockerfile inside the repo
25+
container_name: master-bitgo-express
26+
networks:
27+
- my-internal-network # Connect to the internal network for internal communication
28+
- my-public-network # Connect to the public network for external access
29+
environment:
30+
- APP_MODE=master-express
31+
- BITGO_ENV=test
32+
- TLS_KEY_PATH=test-ssl-key.pem
33+
- TLS_CERT_PATH=test-ssl-cert.pem
34+
- ADVANCED_WALLET_MANAGER_URL=http://advanced-wallet-manager:3081
35+
- ENCLAVED_EXPRESS_CERT=./test-ssl-cert.pem
36+
- MTLS_REQUEST_CERT=false
37+
- ALLOW_SELF_SIGNED=true
38+
- TLS_MODE=disabled
39+
- RECOVERY_MODE=true
40+
- MASTER_EXPRESS_PORT=3081
41+
- BIND=0.0.0.0
42+
restart: always
43+
ports:
44+
- "3081:3081" # Expose MBE publicly on port 3081
45+
46+
# Networks section
47+
networks:
48+
my-internal-network:
49+
driver: bridge # Internal communication network, no access to the internet
50+
internal: true # Ensures this network is not accessible from outside
51+
52+
my-public-network:
53+
driver: bridge # Public network, allowing external access to MBE

0 commit comments

Comments
 (0)