Skip to content

Commit e5080e6

Browse files
authored
Merge pull request #54 from SentriusLLC/copilot/fix-53
[WIP] Update docs
2 parents 08fd5d5 + 9de4b7a commit e5080e6

File tree

1 file changed

+305
-24
lines changed

1 file changed

+305
-24
lines changed

README.md

Lines changed: 305 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Sentrius is zero trust (and if you want AI assisted) management system. to prote
66
into several maven projects. Currently we only support SSH, but RDP is in the works. Agents can be leveraged to monitor and control SSH sessions, ensuring that all connections are secure and compliant with your organization's policies.
77
sub-projects:
88

9-
core – Handles the core functionalities (e.g., SSH session management, RDP, zero trust policy enforcement).
9+
core – Handles the core functionalities (e.g., SSH session management, zero trust policy enforcement).
1010
api – Provides a RESTful API layer to interface with the core module.
11-
dataplane -- offers dataplane functionality for secure data transfer and processing.
12-
llm-proxy -- A proxy service that integrates with large language models (LLMs) to enhance security and compliance in SSH sessions.
13-
llm-dataplane -- A data processing layer that leverages LLMs for advanced analysis and decision-making in SSH
14-
sessions.
15-
ops-scripts -- Contains operational scripts for deployment and management tasks.
16-
ai-agent -- java based agent to monitor and control the ssh sessions.
17-
python-agent -- python based agent to monitor and control the ssh sessions and act on behalf of user (TBD).
11+
dataplane – Offers dataplane functionality for secure data transfer and processing.
12+
llm-proxy A proxy service that integrates with large language models (LLMs) to enhance security and compliance in SSH sessions.
13+
llm-dataplane A data processing layer that leverages LLMs for advanced analysis and decision-making in SSH sessions.
14+
ops-scripts – Contains operational scripts for deployment and management tasks.
15+
ai-agent – Java-based intelligent agent framework for monitoring and controlling SSH sessions.
16+
agent-launcher – Service for dynamically launching and managing agents.
17+
python-agent – Python-based agent framework for SSH session monitoring and user assistance.
1818

1919
Internally, Sentrius may still be referenced by its former name, SSO (SecureShellOps), in certain scripts or configurations.
2020
Table of Contents
@@ -25,9 +25,11 @@ Table of Contents
2525
Installation
2626
Configuration
2727
Running Sentrius
28+
Helm Chart Deployment
29+
Testing
30+
Custom Agents
2831
Usage
2932
API Documentation
30-
Deployment to Google Kubernetes Engine (GKE)
3133
Contributing
3234
License
3335
Contact
@@ -210,29 +212,308 @@ SSH Settings
210212

211213
Feel free to structure your configs based on your environment (dev/test/prod). For large-scale deployments, we recommend using a secure secrets manager (HashiCorp Vault, AWS Secrets Manager, etc.) to avoid storing sensitive information in plain text.
212214

215+
## Helm Chart Deployment
213216

214-
Sentrius can be containerized and deployed to a Kubernetes cluster. You can use the provided Helm script in ops-scripts/gcp/deploy-helm.sh to manage the deployment.
217+
Sentrius provides comprehensive Helm charts for Kubernetes deployment across multiple environments. There are two main charts available:
218+
219+
### Available Charts
220+
221+
1. **sentrius-chart** - Complete Sentrius deployment with all services
222+
2. **sentrius-chart-launcher** - Lightweight chart focused on the launcher service
215223

216-
Build Docker Image (if needed)
217-
Make sure to build and tag your Docker image, then push it to a container registry accessible by GKE (e.g., Google Container Registry).
224+
### Quick Start
218225

219-
Configure GKE
220-
Ensure you are logged into your Google Cloud account and have set the correct context for your GKE cluster.
226+
#### Local Deployment
221227

222-
Run the Helm Deployment Script
223-
From the project root (or from ops-scripts/gcp), run:
228+
```bash
229+
# Build all images
230+
./build-images.sh --all --no-cache
224231

225-
./ops-scripts/gcp/deploy-helm.sh <helm-release-name> <gcp-project-id> <any-other-key-or-params>
232+
# Deploy to local Kubernetes cluster
233+
./ops-scripts/local/deploy-helm.sh
234+
235+
# Forward ports for local access
236+
kubectl port-forward -n dev service/sentrius-sentrius 8080:8080
237+
kubectl port-forward -n dev service/sentrius-keycloak 8081:8081
238+
```
239+
240+
Add to `/etc/hosts` for local development:
241+
```
242+
127.0.0.1 sentrius-sentrius
243+
127.0.0.1 sentrius-keycloak
244+
```
245+
246+
#### GCP/GKE Deployment
247+
248+
```bash
249+
# Deploy to GKE cluster
250+
./ops-scripts/gcp/deploy-helm.sh <helm-release-name> <gcp-project-id> <any-other-params>
251+
```
252+
253+
### Chart Configuration
254+
255+
#### Key Configuration Options
226256

227-
<helm-release-name> is the name you want to assign to the Helm release in your cluster.
228-
<gcp-project-id> is your Google Cloud Platform project ID.
229-
You may supply additional parameters (keys, environment variables, or overrides) as needed.
257+
**Environment Settings:**
258+
- `environment`: Set to "local", "gke", "aws", or "azure"
259+
- `tenant`: Your tenant identifier
260+
- `subdomain`: Domain for your deployment
230261

231-
This script will:
262+
**Core Services:**
263+
- `sentrius.image.repository`: Core Sentrius image repository
264+
- `llmproxy.image.repository`: LLM proxy image repository
265+
- `postgres.storageSize`: Database storage allocation
232266

233-
Deploy the required Kubernetes resources (Deployments, Services, etc.) for both core and api modules.
234-
Apply zero trust security rules configuration as specified.
235-
Expose the api service, typically via a LoadBalancer or an Ingress (depending on your Helm chart configuration).
267+
**Ingress Configuration:**
268+
```yaml
269+
ingress:
270+
enabled: true
271+
class: "nginx" # or "gce" for GKE
272+
tlsEnabled: true
273+
annotations:
274+
gke:
275+
kubernetes.io/ingress.class: gce
276+
networking.gke.io/managed-certificates: wildcard-cert
277+
```
278+
279+
**Agent Configuration:**
280+
```yaml
281+
sentriusagent:
282+
image:
283+
repository: sentrius-agent
284+
oauth2:
285+
client_id: java-agents
286+
client_secret: your-secret
287+
288+
sentriusaiagent:
289+
image:
290+
repository: sentrius-ai-agent
291+
oauth2:
292+
client_id: java-agents
293+
```
294+
295+
#### Custom Values Example
296+
297+
Create a `my-values.yaml` file:
298+
```yaml
299+
environment: "gke"
300+
tenant: "my-company"
301+
subdomain: "my-company.sentrius.cloud"
302+
303+
sentrius:
304+
image:
305+
repository: "my-registry/sentrius"
306+
tag: "v1.0.0"
307+
308+
postgres:
309+
storageSize: "20Gi"
310+
311+
ingress:
312+
enabled: true
313+
tlsEnabled: true
314+
class: "gce"
315+
```
316+
317+
Deploy with custom values:
318+
```bash
319+
helm install my-sentrius sentrius-chart -f my-values.yaml
320+
```
321+
322+
### Multi-Environment Support
323+
324+
The charts support multiple deployment environments with different configurations:
325+
326+
**Local Development:**
327+
- Uses NodePort services
328+
- Minimal resource requirements
329+
- In-memory storage options
330+
331+
**GKE (Google Cloud):**
332+
- Uses LoadBalancer services
333+
- Managed certificates
334+
- Persistent storage
335+
336+
**AWS:**
337+
- ALB ingress support
338+
- EBS storage classes
339+
- AWS-specific annotations
340+
341+
**Azure:**
342+
- Azure Load Balancer integration
343+
- Azure disk storage
344+
- Azure-specific networking
345+
346+
### Helm Testing
347+
348+
For comprehensive testing documentation including CI/CD testing, local testing, and troubleshooting, see [docs/helm-testing.md](docs/helm-testing.md).
349+
350+
## Custom Agents
351+
352+
Sentrius supports both Java and Python-based custom agents that can extend the platform's functionality for monitoring, automation, and user assistance.
353+
354+
### Java Agents
355+
356+
Java agents are built using the Spring Boot framework and integrate with the Sentrius ecosystem through the agent launcher service.
357+
358+
#### Creating a Custom Java Agent
359+
360+
1. **Create a new Spring Boot module** following the pattern of existing agents:
361+
```
362+
my-custom-agent/
363+
├── src/main/java/
364+
│ └── io/sentrius/agent/mycustom/
365+
│ ├── MyCustomAgent.java
366+
│ └── MyCustomAgentConfig.java
367+
└── pom.xml
368+
```
369+
370+
2. **Implement the Agent Interface:**
371+
```java
372+
@Component
373+
@ConditionalOnProperty(name = "agents.mycustom.enabled", havingValue = "true")
374+
public class MyCustomAgent implements ApplicationListener<ApplicationReadyEvent> {
375+
376+
@Autowired
377+
private AgentService agentService;
378+
379+
@Override
380+
public void onApplicationEvent(ApplicationReadyEvent event) {
381+
// Register agent and start processing
382+
agentService.register(this);
383+
}
384+
}
385+
```
386+
387+
3. **Configuration Properties:**
388+
```java
389+
@ConfigurationProperties(prefix = "agents.mycustom")
390+
@Data
391+
public class MyCustomAgentConfig {
392+
private boolean enabled = false;
393+
private String name = "my-custom-agent";
394+
private String description = "Custom agent for specialized tasks";
395+
}
396+
```
397+
398+
4. **Add to application.properties:**
399+
```properties
400+
agents.mycustom.enabled=true
401+
agents.mycustom.name=my-custom-agent
402+
agents.mycustom.description=Custom agent for specialized tasks
403+
```
404+
405+
5. **Deploy with Helm Chart:**
406+
```yaml
407+
# Add to values.yaml
408+
mycustomagent:
409+
image:
410+
repository: my-custom-agent
411+
tag: latest
412+
oauth2:
413+
client_id: java-agents
414+
client_secret: your-secret
415+
```
416+
417+
#### Java Agent Features
418+
419+
- **Zero Trust Integration**: Automatic ZTAT (Zero Trust Access Token) handling
420+
- **Provenance Tracking**: Built-in event logging and audit trails
421+
- **LLM Integration**: Access to language models through the LLM proxy
422+
- **Session Monitoring**: Real-time SSH session monitoring capabilities
423+
- **RESTful APIs**: Full access to Sentrius APIs and data
424+
425+
### Python Agents
426+
427+
Python agents provide a flexible framework for creating custom automation and user assistance tools.
428+
429+
#### Creating a Custom Python Agent
430+
431+
1. **Set up the agent structure:**
432+
```python
433+
# agents/my_custom/my_custom_agent.py
434+
from agents.base import BaseAgent
435+
436+
class MyCustomAgent(BaseAgent):
437+
def __init__(self, config_manager):
438+
super().__init__(config_manager, name="my-custom-agent")
439+
self.agent_definition = config_manager.get_agent_definition('my.custom')
440+
441+
def execute_task(self, task_data=None):
442+
# Your custom logic here
443+
self.submit_provenance(
444+
event_type="CUSTOM_TASK",
445+
details={"task": "custom_operation", "data": task_data}
446+
)
447+
448+
return {
449+
"status": "completed",
450+
"result": "Custom task executed successfully"
451+
}
452+
```
453+
454+
2. **Create agent configuration:**
455+
```yaml
456+
# my-custom.yaml
457+
description: "Custom agent that performs specialized tasks"
458+
context: |
459+
You are a custom agent designed to handle specific business logic.
460+
Process requests according to your specialized capabilities.
461+
```
462+
463+
3. **Add to application.properties:**
464+
```properties
465+
agent.my.custom.config=my-custom.yaml
466+
agent.my.custom.enabled=true
467+
```
468+
469+
4. **Register in main.py:**
470+
```python
471+
from agents.my_custom.my_custom_agent import MyCustomAgent
472+
473+
AVAILABLE_AGENTS = {
474+
'chat-helper': ChatHelperAgent,
475+
'my-custom': MyCustomAgent, # Add your agent here
476+
}
477+
```
478+
479+
5. **Run your custom agent:**
480+
```bash
481+
python main.py my-custom --task-data '{"operation": "process_data"}'
482+
```
483+
484+
#### Python Agent Features
485+
486+
- **API Integration**: Full access to Sentrius APIs using JWT authentication
487+
- **Configuration Management**: Support for properties files and YAML configurations
488+
- **LLM Proxy Access**: Integration with language models for AI-powered tasks
489+
- **Provenance Submission**: Automatic event tracking and audit logging
490+
- **Keycloak Authentication**: Built-in OAuth2/JWT token management
491+
492+
#### Running Python Agents
493+
494+
```bash
495+
# With properties configuration
496+
python main.py my-custom --config my-app.properties
497+
498+
# With environment variables
499+
export KEYCLOAK_BASE_URL=http://localhost:8180
500+
export KEYCLOAK_CLIENT_ID=python-agents
501+
python main.py my-custom
502+
503+
# Test mode (no external services)
504+
TEST_MODE=true python main.py my-custom
505+
```
506+
507+
### Agent Development Best Practices
508+
509+
1. **Authentication**: Always use proper OAuth2/JWT authentication
510+
2. **Provenance**: Submit detailed provenance events for audit trails
511+
3. **Error Handling**: Implement robust error handling and logging
512+
4. **Configuration**: Use environment-specific configurations
513+
5. **Testing**: Test agents in isolation before integration
514+
6. **Documentation**: Document agent capabilities and configuration options
515+
516+
For detailed Python agent documentation, see [python-agent/README.md](python-agent/README.md).
236517

237518
Contributing
238519

0 commit comments

Comments
 (0)