Skip to content

Commit 3818ef9

Browse files
authored
Merge pull request #88 from SentriusLLC/copilot/fix-87
Implement SSH Server proxy with dynamic HostSystem integration, comprehensive testing, and production roadmap
2 parents 4c01391 + 55da75b commit 3818ef9

File tree

50 files changed

+3735
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3735
-25
lines changed

.local.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
SENTRIUS_VERSION=1.1.341
1+
SENTRIUS_VERSION=1.1.345
22
SENTRIUS_SSH_VERSION=1.1.41
33
SENTRIUS_KEYCLOAK_VERSION=1.1.53
44
SENTRIUS_AGENT_VERSION=1.1.42
55
SENTRIUS_AI_AGENT_VERSION=1.1.263
66
LLMPROXY_VERSION=1.0.78
77
LAUNCHER_VERSION=1.0.82
8-
AGENTPROXY_VERSION=1.0.85
8+
AGENTPROXY_VERSION=1.0.85
9+
SSHPROXY_VERSION=1.0.40

.local.env.bak

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
SENTRIUS_VERSION=1.1.341
1+
SENTRIUS_VERSION=1.1.345
22
SENTRIUS_SSH_VERSION=1.1.41
33
SENTRIUS_KEYCLOAK_VERSION=1.1.53
44
SENTRIUS_AGENT_VERSION=1.1.42
55
SENTRIUS_AI_AGENT_VERSION=1.1.263
66
LLMPROXY_VERSION=1.0.78
77
LAUNCHER_VERSION=1.0.82
8-
AGENTPROXY_VERSION=1.0.85
8+
AGENTPROXY_VERSION=1.0.85
9+
SSHPROXY_VERSION=1.0.40

api/src/main/java/io/sentrius/sso/websocket/AuditSocketHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
import java.util.concurrent.ConcurrentHashMap;
99
import java.util.stream.Collectors;
1010
import java.util.stream.Stream;
11+
import io.sentrius.sso.core.integrations.ssh.DataWebSession;
1112
import io.sentrius.sso.core.services.security.CryptoService;
1213
import io.sentrius.sso.core.services.terminal.SessionTrackingService;
14+
import io.sentrius.sso.core.services.SshListenerService;
1315
import lombok.RequiredArgsConstructor;
1416
import lombok.extern.slf4j.Slf4j;
1517
import org.springframework.stereotype.Component;
@@ -43,7 +45,7 @@ public void afterConnectionEstablished(WebSocketSession session) throws Exceptio
4345
// Store the WebSocket session using the session ID from the query parameter
4446
sessions.put(sessionId, session);
4547
log.trace("*AUDITING New connection established, session ID: " + sessionId);
46-
sshListenerService.startAuditingSession(sessionId, session);
48+
sshListenerService.startAuditingSession(sessionId, new DataWebSession(session));
4749
} else {
4850
log.trace("Session ID not found in query parameters.");
4951
session.close(); // Close the session if no valid session ID is provided

api/src/main/java/io/sentrius/sso/websocket/ChatListenerService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io.sentrius.sso.core.services.security.IntegrationSecurityTokenService;
2020
import io.sentrius.sso.core.services.terminal.SessionTrackingService;
2121
import io.sentrius.sso.core.utils.JsonUtil;
22+
import io.sentrius.sso.core.services.SshListenerService;
2223
import io.sentrius.sso.genai.ChatConversation;
2324
import io.sentrius.sso.genai.GenerativeAPI;
2425
import io.sentrius.sso.genai.GeneratorConfiguration;

api/src/main/java/io/sentrius/sso/websocket/TerminalWSHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
import io.sentrius.sso.automation.auditing.Trigger;
55
import io.sentrius.sso.automation.auditing.TriggerAction;
6+
import io.sentrius.sso.core.integrations.ssh.DataWebSession;
67
import io.sentrius.sso.core.model.chat.ChatLog;
78
import io.sentrius.sso.core.services.ChatService;
89
import io.sentrius.sso.core.services.metadata.TerminalSessionMetadataService;
910
import io.sentrius.sso.core.services.security.CryptoService;
11+
import io.sentrius.sso.core.services.SshListenerService;
1012
import io.sentrius.sso.core.utils.StringUtils;
1113
import io.sentrius.sso.protobuf.Session;
1214
import io.sentrius.sso.core.services.terminal.SessionTrackingService;
@@ -57,7 +59,7 @@ public void afterConnectionEstablished(WebSocketSession session) throws Exceptio
5759
// Store the WebSocket session using the session ID from the query parameter
5860
sessions.put(sessionId, session);
5961
log.debug("New connection established, session ID: " + sessionId);
60-
sshListenerService.startListeningToSshServer(sessionId, session);
62+
sshListenerService.startListeningToSshServer(sessionId, new DataWebSession(session));
6163
} else {
6264
log.trace("Session ID not found in query parameters.");
6365
session.close(); // Close the session if no valid session ID is provided
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE host_systems
2+
ADD COLUMN proxied_ssh_server BOOLEAN DEFAULT FALSE,
3+
ADD COLUMN proxied_ssh_port INTEGER DEFAULT 0;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE host_groups
2+
ADD COLUMN proxied_ssh_port INTEGER DEFAULT 0;

core/src/main/java/io/sentrius/sso/core/dto/HostGroupDTO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class HostGroupDTO {
1818
private String displayName;
1919
private String description;
2020
private int hostCount = 0;
21+
@Builder.Default
22+
private int proxiedSSHPort = 0;
2123
private ProfileConfiguration configuration;
2224
List<UserDTO> users = new ArrayList<>();
2325

dataplane/src/main/java/io/sentrius/sso/automation/auditing/BaseAccessTokenAuditor.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
import io.sentrius.sso.core.model.users.User;
88

99
public abstract class BaseAccessTokenAuditor {
10-
/*
11-
protected final Long userId;
12-
protected final Long sessionId;
1310

14-
protected final Long systemId;*/
1511
protected final HostSystem system;
1612
protected final SessionLog session;
1713
protected final User user;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.sentrius.sso.core.integrations.ssh;
2+
3+
import java.io.IOException;
4+
import org.springframework.web.socket.WebSocketMessage;
5+
6+
public interface DataSession {
7+
8+
String getId();
9+
10+
boolean isOpen();
11+
12+
void sendMessage(WebSocketMessage<?> message) throws IOException;
13+
}

0 commit comments

Comments
 (0)