Skip to content

Commit a447340

Browse files
Copilotphrocker
andauthored
Implement independent asymmetric key management for ZtatTokenService JWT signing with RDP proxy and Guacamole integration (#15)
* Initial plan * Add RDP proxy public key endpoint integration to ZtatTokenService Co-authored-by: phrocker <[email protected]> * Add unit tests for ZtatTokenService RDP proxy integration Co-authored-by: phrocker <[email protected]> * Add documentation for ZtatTokenService RDP proxy integration Co-authored-by: phrocker <[email protected]> * Refactor RestTemplate instantiation to match existing service patterns Co-authored-by: phrocker <[email protected]> * Fix endpoint path conflict between RdpProxyKeySyncController and RdpProxyKeyController Co-authored-by: phrocker <[email protected]> * fixup * Refactor to proper asymmetric model with independent key management per service Co-authored-by: phrocker <[email protected]> * Add RDP proxy support for validating JWTs from ZtatTokenService Co-authored-by: phrocker <[email protected]> * Update SecurityConfig to support both symmetric and asymmetric JWT tokens Co-authored-by: phrocker <[email protected]> * fixups * Fix guacd connection to use local instance with installation in Dockerfile Co-authored-by: phrocker <[email protected]> * Implement full Guacamole protocol support for real RDP screen streaming Co-authored-by: phrocker <[email protected]> * fixup --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: phrocker <[email protected]> Co-authored-by: Marc Parisi <[email protected]>
1 parent e7fe63b commit a447340

File tree

25 files changed

+1107
-287
lines changed

25 files changed

+1107
-287
lines changed

.local.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SENTRIUS_VERSION=1.1.450
1+
SENTRIUS_VERSION=1.1.460
22
SENTRIUS_SSH_VERSION=1.1.44
33
SENTRIUS_KEYCLOAK_VERSION=1.1.59
44
SENTRIUS_AGENT_VERSION=1.1.45
@@ -7,4 +7,4 @@ LLMPROXY_VERSION=1.0.86
77
LAUNCHER_VERSION=1.0.90
88
AGENTPROXY_VERSION=1.0.87
99
SSHPROXY_VERSION=1.0.90
10-
RDPPROXY_VERSION=1.0.15
10+
RDPPROXY_VERSION=1.0.32

.local.env.bak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SENTRIUS_VERSION=1.1.450
1+
SENTRIUS_VERSION=1.1.460
22
SENTRIUS_SSH_VERSION=1.1.44
33
SENTRIUS_KEYCLOAK_VERSION=1.1.59
44
SENTRIUS_AGENT_VERSION=1.1.45
@@ -7,4 +7,4 @@ LLMPROXY_VERSION=1.0.86
77
LAUNCHER_VERSION=1.0.90
88
AGENTPROXY_VERSION=1.0.87
99
SSHPROXY_VERSION=1.0.90
10-
RDPPROXY_VERSION=1.0.15
10+
RDPPROXY_VERSION=1.0.32

api/src/main/java/io/sentrius/sso/controllers/api/HostApiController.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ public ResponseEntity<List<HostSystemDTO>> listHostSystems(HttpServletRequest re
112112
continue;
113113
}
114114
break;
115+
case "ALL":
116+
break;
115117
default:
116118
// do nothing, return all
117119
}
@@ -336,7 +338,7 @@ public ResponseEntity<Map<String, Object>> initiateRdpSession(
336338
}
337339

338340
// Generate JWT token for this user and target
339-
String jwtToken = generateRdpJwtToken(user, hostSystem.getDisplayName());
341+
String jwtToken = generateRdpJwtToken(user, hostSystem.getId());
340342
if (jwtToken == null) {
341343
// log.error("Failed to generate JWT token for user {} and target {}", user.getUsername(), hostSystem.getDisplayName());
342344
return ResponseEntity.internalServerError().build();
@@ -348,7 +350,7 @@ public ResponseEntity<Map<String, Object>> initiateRdpSession(
348350
sessionData.put("port", hostSystem.getRdpPort() != null ? hostSystem.getRdpPort() : 3389);
349351
sessionData.put("username", user.getUsername());
350352
sessionData.put("jwtToken", jwtToken);
351-
sessionData.put("target", hostSystem.getDisplayName());
353+
sessionData.put("target", hostSystem.getId());
352354
sessionData.put("websocketHost", systemOptions.getRdpProxyDomain());
353355
sessionData.put("websocketUrl", "/guacamole/tunnel?token=" + jwtToken);
354356
sessionData.put("displayName", hostSystem.getDisplayName());
@@ -397,7 +399,7 @@ public ResponseEntity<String> downloadRdpFile(
397399
}
398400

399401
// Generate JWT token for this user and target
400-
String jwtToken = generateRdpJwtToken(user, hostSystem.getDisplayName());
402+
String jwtToken = generateRdpJwtToken(user, hostSystem.getId());
401403
if (jwtToken == null) {
402404
// log.error("Failed to generate JWT token for user {} and target {}", user.getUsername(), hostSystem.getDisplayName());
403405
return ResponseEntity.internalServerError().build();
@@ -426,11 +428,11 @@ public ResponseEntity<String> downloadRdpFile(
426428
/**
427429
* Generate a JWT token for RDP authentication
428430
*/
429-
private String generateRdpJwtToken(User user, String target) {
431+
private String generateRdpJwtToken(User user, Long target) {
430432
try {
431433
// log.info("Generating JWT token for user {} and target {}", user.getUsername(), target);
432434

433-
return ztatTokenService.issueServiceToken(user.getUsername(), "rdp-proxy", target, 60);
435+
return ztatTokenService.issueServiceToken(user.getUsername(), "rdp-proxy", target.toString(), 60);
434436

435437

436438
} catch (Exception e) {

api/src/main/resources/static/js/functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function countRules(){
3232
}
3333

3434
export function countAssignedSystems(){
35-
fetch('/api/v1/enclaves/hosts/list')
35+
fetch('/api/v1/enclaves/hosts/list?type=ALL')
3636
.then(response => response.json())
3737
.then(data => {
3838
if (null != data) {

0 commit comments

Comments
 (0)