mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-28 06:56:34 +00:00
Add extra info on app gateway
This commit is contained in:
@@ -28,13 +28,75 @@ Security:
|
|||||||
### Microsoft Azure Application Proxy
|
### Microsoft Azure Application Proxy
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
Server:
|
||||||
|
Authentication:
|
||||||
|
- header
|
||||||
|
Tls: disable # App Proxy handles TLS termination
|
||||||
|
|
||||||
Header:
|
Header:
|
||||||
UserHeader: "X-MS-CLIENT-PRINCIPAL-NAME"
|
UserHeader: "X-MS-CLIENT-PRINCIPAL-NAME"
|
||||||
UserIdHeader: "X-MS-CLIENT-PRINCIPAL-ID"
|
UserIdHeader: "X-MS-CLIENT-PRINCIPAL-ID"
|
||||||
EmailHeader: "X-MS-CLIENT-PRINCIPAL-EMAIL"
|
EmailHeader: "X-MS-CLIENT-PRINCIPAL-EMAIL"
|
||||||
|
|
||||||
|
Security:
|
||||||
|
VerifyClientIp: false # Required for App Proxy
|
||||||
|
|
||||||
|
Caps:
|
||||||
|
TokenAuth: true # Essential for RDP client connections
|
||||||
```
|
```
|
||||||
|
|
||||||
**Setup**: Configure App Proxy to publish RDPGW with pre-authentication enabled. Users authenticate via Azure AD before reaching RDPGW.
|
**Azure Configuration:**
|
||||||
|
|
||||||
|
1. **Create App Registration** in Azure AD:
|
||||||
|
```bash
|
||||||
|
# Note the Application ID for App Proxy configuration
|
||||||
|
az ad app create --display-name "RDPGW-AppProxy"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Configure Application Proxy**:
|
||||||
|
- **Internal URL**: `http://rdpgw-internal:80` (or your internal RDPGW address)
|
||||||
|
- **External URL**: `https://rdpgw.yourdomain.com`
|
||||||
|
- **Pre-authentication**: Azure Active Directory
|
||||||
|
- **Pass through**: Enabled for `/remoteDesktopGateway/`
|
||||||
|
|
||||||
|
3. **Configure Conditional Access Policies**:
|
||||||
|
- Target the RDPGW App Proxy application
|
||||||
|
- Set device compliance, location restrictions, MFA requirements
|
||||||
|
- Enable session controls as needed
|
||||||
|
|
||||||
|
**Important App Proxy Configuration:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "RDPGW",
|
||||||
|
"internalUrl": "http://rdpgw-internal",
|
||||||
|
"externalUrl": "https://rdpgw.yourdomain.com",
|
||||||
|
"preAuthenticatedApplication": {
|
||||||
|
"preAuthenticationType": "AzureActiveDirectory",
|
||||||
|
"passthroughPaths": [
|
||||||
|
"/remoteDesktopGateway/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Authentication Flow:**
|
||||||
|
|
||||||
|
1. **Web Authentication** (`/connect` endpoint):
|
||||||
|
```
|
||||||
|
User Browser → App Proxy (Azure AD auth) → RDPGW → Downloads RDP file
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **RDP Client Connection** (`/remoteDesktopGateway/` endpoint):
|
||||||
|
```
|
||||||
|
RDP Client → App Proxy (passthrough) → RDPGW (token validation) → RDP Host
|
||||||
|
```
|
||||||
|
|
||||||
|
**Key Requirements:**
|
||||||
|
- **Passthrough configuration** for `/remoteDesktopGateway/` path
|
||||||
|
- **Header authentication** only for `/connect` endpoint
|
||||||
|
- **Token-based auth** for actual RDP connections
|
||||||
|
- **Disable IP verification** due to App Proxy NAT
|
||||||
|
|
||||||
### Google Cloud Identity-Aware Proxy (IAP)
|
### Google Cloud Identity-Aware Proxy (IAP)
|
||||||
|
|
||||||
@@ -79,19 +141,67 @@ Header:
|
|||||||
|
|
||||||
**nginx config**:
|
**nginx config**:
|
||||||
```nginx
|
```nginx
|
||||||
location /auth {
|
upstream rdpgw {
|
||||||
internal;
|
server rdpgw:443;
|
||||||
proxy_pass http://auth-service;
|
|
||||||
proxy_set_header X-Original-URI $request_uri;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
upstream auth-service {
|
||||||
auth_request /auth;
|
server auth-service:80;
|
||||||
auth_request_set $user $upstream_http_x_auth_user;
|
}
|
||||||
auth_request_set $email $upstream_http_x_auth_email;
|
|
||||||
proxy_set_header X-Auth-User $user;
|
server {
|
||||||
proxy_set_header X-Auth-Email $email;
|
listen 443 ssl http2;
|
||||||
proxy_pass http://rdpgw;
|
server_name your-gateway.example.com;
|
||||||
|
|
||||||
|
# SSL configuration
|
||||||
|
ssl_certificate /path/to/cert.pem;
|
||||||
|
ssl_certificate_key /path/to/key.pem;
|
||||||
|
|
||||||
|
# Auth endpoint (internal)
|
||||||
|
location /auth {
|
||||||
|
internal;
|
||||||
|
proxy_pass http://auth-service;
|
||||||
|
proxy_pass_request_body off;
|
||||||
|
proxy_set_header Content-Length "";
|
||||||
|
proxy_set_header X-Original-URI $request_uri;
|
||||||
|
proxy_set_header X-Original-Method $request_method;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main location with auth and WebSocket support
|
||||||
|
location / {
|
||||||
|
# Authentication
|
||||||
|
auth_request /auth;
|
||||||
|
auth_request_set $user $upstream_http_x_auth_user;
|
||||||
|
auth_request_set $email $upstream_http_x_auth_email;
|
||||||
|
|
||||||
|
# Forward user headers to RDPGW
|
||||||
|
proxy_set_header X-Auth-User $user;
|
||||||
|
proxy_set_header X-Auth-Email $email;
|
||||||
|
|
||||||
|
# WebSocket and HTTP upgrade support
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
# Timeouts for long-lived connections
|
||||||
|
proxy_read_timeout 86400s;
|
||||||
|
proxy_send_timeout 86400s;
|
||||||
|
|
||||||
|
# Disable buffering for real-time protocols
|
||||||
|
proxy_buffering off;
|
||||||
|
|
||||||
|
proxy_pass https://rdpgw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# WebSocket upgrade mapping
|
||||||
|
map $http_upgrade $connection_upgrade {
|
||||||
|
default upgrade;
|
||||||
|
'' close;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user