Remote Access

Temporary RDP
Access Portal

A public-facing access request page for temporarily allowing an authorized source IP to reach a protected remote desktop service. Access should be authenticated, logged, automatically expire, and be enforced by the firewall.

Request Access

The eventual user experience should be simple: authenticate, select an access duration, submit the request, and receive a temporary access result. The user's public IP should be detected server-side rather than trusted from a form field.

Backend should enforce the maximum duration regardless of what the client submits.
Store this with the audit record if you want an access history.
Do not allow visitors to manually choose an arbitrary IP address.
Recommended authentication layer
Put authentication in front of this endpoint before it can modify firewall state. A future version could use an identity provider, passkey/MFA, or another authenticated mechanism.

How It Should Work

The public page should remain intentionally dumb. The backend performs the sensitive operations.

01User authenticatesVerify that the requester is authorized.
→
02Backend detects IPDetermine the source address from the actual request.
→
03Firewall updateAdd the IP to a dedicated temporary-access mechanism.
→
04ExpirationAutomatically remove the authorization.

Firewall Integration Boundary

This is the most important section to customize. Keep these values on the backend/server side. They should never be embedded in this public HTML.

★ CHANGE THESE VALUES WHEN INTEGRATING ★
// Example backend configuration — NOT for the public browser

FIREWALL_PROVIDER = "CHANGE_ME"
# Examples: "opnsense", "pfsense", "custom"

FIREWALL_API_BASE_URL = "CHANGE_ME"
# Private/internal API endpoint.
# Never expose this value to the browser.

FIREWALL_API_KEY = "CHANGE_ME_SECRET"
FIREWALL_API_SECRET = "CHANGE_ME_SECRET"

RDP_ACCESS_ALIAS = "CHANGE_ME"
# Recommended concept: a dedicated host/IP alias
# used ONLY by the RDP allow rule.

RDP_TARGET = "CHANGE_ME"
# Internal RDP destination.

RDP_PORT = CHANGE_ME
# Normally 3389 internally.

MAX_ACCESS_MINUTES = CHANGE_ME

AUTH_PROVIDER = "CHANGE_ME"
# Identity/MFA provider used to authorize requests.

AUDIT_LOG_DESTINATION = "CHANGE_ME"
# File, database, SIEM, etc.

Recommended Firewall Model

Use one dedicated source-IP object/alias for temporary RDP access instead of dynamically creating and deleting an entire firewall rule for every request. This keeps the permanent rule simple and makes the automation layer smaller.

ComponentConceptWhat you change later
Source Dedicated temporary-access IP alias RDP_ACCESS_ALIAS
Destination Specific internal RDP server RDP_TARGET
Service TCP RDP service RDP_PORT
Automation Add source IP, wait for expiry, remove source IP Firewall adapter/backend
Authorization Authenticated user + policy check AUTH_PROVIDER
Audit User, source IP, start, expiry, result AUDIT_LOG_DESTINATION
Why an alias?
Firewall platforms such as OPNsense and pfSense support aliases for grouping host/network addresses and referencing those groups from firewall rules. OPNsense also documents API operations for adding and removing entries from aliases. citeturn0search0turn0search1

Backend Contract

Keep the frontend independent from the actual firewall vendor. Your backend should expose a small API of its own and translate that request into the firewall-specific API calls.

POST

/api/rdp/request

Authenticate the requester, determine their source IP, validate the duration, and create the temporary authorization.

GET

/api/rdp/status

Return only safe status information such as whether the current authenticated session has active access.

POST

/api/rdp/revoke

Immediately remove the requester's temporary authorization when permitted.

Example Backend Request

★ BACKEND LOGIC — ADAPT TO YOUR SERVER LANGUAGE ★
// Pseudocode only — firewall credentials stay server-side

POST /api/rdp/request

1. Require authenticated session
2. Verify user is allowed to request RDP
3. Detect source IP from trusted request metadata
4. Validate requested duration
5. Generate request ID
6. Add source IP to RDP temporary-access alias
7. Record expiration timestamp
8. Schedule/remove authorization at expiration
9. Write audit record
10. Return request ID + expiration time

// Example response
{
  "status": "active",
  "request_id": "generated-server-side",
  "expires_at": "server-generated timestamp"
}

Firewall Adapter

The adapter is where vendor-specific code belongs. This lets the public portal remain unchanged if the firewall changes later.

★ IMPLEMENT THIS SERVER-SIDE ★
class FirewallAdapter:

    add_temporary_source(ip, expires_at):
        # CHANGE HERE
        # Call your firewall's API or automation interface.
        # Validate ip before sending it.
        pass

    remove_temporary_source(ip):
        # CHANGE HERE
        # Remove the source from the temporary access mechanism.
        pass

    check_source(ip):
        # CHANGE HERE
        # Return whether the source is currently authorized.
        pass

Security Requirements Before Going Live

Required

Authentication + MFA

Do not allow an anonymous internet visitor to modify firewall access.

Required

Server-Side Validation

Validate IP addresses, durations, authorization, and request state on the backend.

Required

Automatic Expiration

Never depend on the browser remaining open to revoke access.

Required

Rate Limiting

Limit repeated requests and authentication attempts from the public internet.

Required

Audit Logging

Record who requested access, what source was authorized, when it started, and when it expired.

Recommended

VPN Alternative

For long-term remote administration, consider VPN access instead of exposing RDP directly.

Do not put firewall credentials in this file.
This HTML is designed to live on a public website. API keys, firewall addresses, server addresses, RDP credentials, and privileged automation credentials belong exclusively on the protected backend.

Future Integration Checklist

☐ Choose firewall platform / API method

☐ Create dedicated temporary RDP source alias

☐ Create permanent firewall rule referencing that alias

☐ Build protected backend endpoint

☐ Add authentication + MFA

☐ Implement IP detection and validation

☐ Implement automatic expiration

☐ Add audit logging

☐ Add rate limiting

☐ Test revocation and failure recovery

☐ Only then enable the public request form