Skip to content

Commit 81a2256

Browse files
committed
Update readme
1 parent 161454c commit 81a2256

File tree

1 file changed

+26
-62
lines changed

1 file changed

+26
-62
lines changed

README.md

Lines changed: 26 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ Installation
8686
git clone https://github.com/your-organization/sentrius.git
8787
cd sentrius
8888

89+
Running Sentrius
90+
91+
For convenience the ops/local directory contains a "run-sentrius.sh" script which will start the core and api modules. You can run this script from the project root:
92+
93+
./ops/local/run-sentrius.sh
94+
95+
You are welcome to run the core and api modules separately, as needed. You can start the core module by running:
96+
97+
mvn install
98+
cd api
99+
mvn spring-boot:run
100+
89101
Build the Project
90102

91103
Sentrius uses Maven for its build process. Ensure Maven is installed and then run:
@@ -110,8 +122,20 @@ spring.jpa.hibernate.ddl-auto=update
110122
Security & Authentication
111123

112124
# JWT or OAuth
113-
sentrius.security.jwt.secret=YOUR_SECRET_KEY
114-
sentrius.security.jwt.expiration=3600
125+
To configure Keycloak, you can use the following properties:
126+
127+
keycloak.realm=sentrius
128+
keycloak.base-url=${KEYCLOAK_BASE_URL:http://localhost:8180}
129+
spring.security.oauth2.client.registration.keycloak.client-secret=${KEYCLOAK_SECRET:defaultSecret}
130+
131+
spring.security.oauth2.client.registration.keycloak.client-id=sentrius-api
132+
spring.security.oauth2.client.registration.keycloak.authorization-grant-type=authorization_code
133+
spring.security.oauth2.client.registration.keycloak.redirect-uri=${BASE_URL:http://localhost:8080}/login/oauth2/code/keycloak
134+
spring.security.oauth2.client.registration.keycloak.scope=openid,profile,email
135+
136+
spring.security.oauth2.resourceserver.jwt.issuer-uri=${KEYCLOAK_BASE_URL:http://localhost:8180}/realms/sentrius
137+
spring.security.oauth2.client.provider.keycloak.issuer-uri=${KEYCLOAK_BASE_URL:http://localhost:8180}/realms/sentrius
138+
115139

116140
SSH Settings
117141

@@ -123,67 +147,7 @@ SSH Settings
123147
The API often needs separate configurations for its own port, API versioning, or logging settings.
124148

125149
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.
126-
Running Sentrius
127-
1. Running the Core
128-
129-
Navigate to the core sub-project:
130-
131-
cd core
132-
mvn spring-boot:run
133-
134-
Once the core service is running, it will initialize the necessary security policies, database migrations, and SSH session handling.
135-
2. Running the API
136-
137-
In a separate terminal, navigate to the api sub-project:
138-
139-
cd api
140-
mvn spring-boot:run
141-
142-
The API will connect to the running core service and expose the REST endpoints (by default) at http://localhost:8080/api/v1/.
143-
Usage
144-
145-
Below are examples of how to interact with Sentrius via the REST API. These can be tested using cURL, Postman, or any other HTTP client.
146-
1. Create an Enclave
147-
148-
POST /api/v1/enclaves
149-
Content-Type: application/json
150-
151-
{
152-
"name": "Production Servers",
153-
"description": "Access group for production nodes"
154-
}
155-
156-
2. Add a Host to an Enclave
157-
158-
POST /api/v1/enclaves/{enclaveId}/hosts
159-
Content-Type: application/json
160-
161-
{
162-
"host": "192.168.1.10",
163-
"username": "admin",
164-
"port": 22
165-
}
166-
167-
3. Establish a Secure Connection
168-
169-
POST /api/v1/ssh/connect
170-
Content-Type: application/json
171-
172-
{
173-
"enclaveId": "12345",
174-
"hostId": "67890"
175-
}
176-
177-
If your zero trust policies allow the connection, Sentrius will open a secure SSH session. The connection details (session ID, session logs, etc.) can be accessed through further API endpoints.
178-
API Documentation
179-
180-
Sentrius uses Swagger for API documentation. Once the api module is running, browse to:
181-
182-
http://localhost:8080/swagger-ui.html
183150

184-
Here, you can explore all available endpoints, models, and request/response structures.
185-
For advanced use cases, consult the automatically generated openapi.json/openapi.yaml file.
186-
Deployment to Google Kubernetes Engine (GKE)
187151

188152
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.
189153

0 commit comments

Comments
 (0)