Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d8da7f8
fix(build): allow cargo check without node_modules in worktree
yacosta738 Jun 1, 2026
9ba5461
fix(ci): address all code scanning security alerts
yacosta738 Jun 1, 2026
cb18d8f
fix(ci): harden checkout credentials and build script
yacosta738 Jun 1, 2026
c1780a3
Merge branch 'main' into maintenance
yacosta738 Jun 1, 2026
0c20109
fix(build): improve error messages for missing vite in release mode
yacosta738 Jun 1, 2026
b5bf3e7
fix(quality): resolve SonarQube issues across codebase
yacosta738 Jun 1, 2026
04c115f
style(lib): format code for better readability in lib.rs
yacosta738 Jun 1, 2026
55c14ad
Merge branch 'main' into maintenance
yacosta738 Jun 1, 2026
ba312a4
chore(security): add CodeQL workflow and configure merge-gate securit…
yacosta738 Jun 1, 2026
5c70e96
Merge branch 'main' into maintenance
yacosta738 Jun 1, 2026
f7a349b
fix(codeql): pin codeql-action to existing SHA v3.36.0
yacosta738 Jun 1, 2026
6332f9d
fix(security): address code scanning review findings across workflows…
yacosta738 Jun 1, 2026
d51df5b
fix(security-deep): replace aquasecurity/trivy-action with direct CLI…
yacosta738 Jun 1, 2026
72fdd12
fix(codeql): build dashboard before cargo check so rust-embed resolves
yacosta738 Jun 1, 2026
aac1224
fix(codeql): use workspace filter for dashboard build in CodeQL workflow
yacosta738 Jun 1, 2026
f411c76
chore: remove the custom CodeQL workflow entirely.
yacosta738 Jun 1, 2026
ccb02a9
Merge branch 'main' into maintenance
yacosta738 Jun 1, 2026
e7123cf
Merge branch 'main' into maintenance
yacosta738 Jun 1, 2026
91afc82
fix(security-deep): remove --exit-code 1 from trivy reporting-only scan
yacosta738 Jun 1, 2026
4eda6fe
fix(security): resolve 4 code scanning alerts
yacosta738 Jun 1, 2026
915d790
fix(security): address PR feedback on code scanning alerts
yacosta738 Jun 1, 2026
8c081c0
Merge branch 'main' into maintenance
yacosta738 Jun 1, 2026
a7568e7
fix(formatting): improve code readability and update dependencies in …
yacosta738 Jun 1, 2026
4cbd229
fix(security-deep): use aquasecurity/trivy-action instead of communit…
yacosta738 Jun 1, 2026
fd4b161
Potential fix for pull request finding 'CodeQL / Log injection'
yacosta738 Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions .github/workflows/security-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,16 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Create reports directory
run: mkdir -p reports/trivy

- name: Install Trivy CLI
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | \
sh -s -- -b /usr/local/bin v0.65.0
trivy --version

- name: Run full Trivy filesystem, dependency, and IaC scan
run: |
# --exit-code 0: reporting-only scan; do NOT fail the step on vulnerabilities
trivy fs . \
--scanners vuln,misconfig \
--severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL \
--format sarif \
--output reports/trivy/trivy-full.sarif
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
with:
scan-type: fs
scan-ref: .
scanners: vuln,misconfig
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
format: sarif
output: reports/trivy/trivy-full.sarif
exit-code: '0'
- name: Verify SARIF file exists
id: verify-sarif
run: |
Expand Down
23 changes: 22 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 19 additions & 8 deletions apps/rook/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,22 @@ async fn announce_bootstrap_if_needed(container: &di::RookContainer) -> anyhow::
match setup_token {
Some(token) => {
// Sanitize: replace control/non-printable chars to prevent log injection
let sanitized: String = token.chars().map(|c| {
if c.is_ascii_control() || c == '"' || c == '\\' || c == '\n' || c == '\r' || c == '\t' {
'?'
} else {
c
}
}).collect();
let sanitized: String = token
.chars()
.map(|c| {
if c.is_ascii_control()
|| c == '"'
|| c == '\\'
|| c == '\n'
|| c == '\r'
|| c == '\t'
{
'?'
} else {
c
}
})
.collect();
let preview = if sanitized.len() > 8 {
format!("{}…", &sanitized[..8])
} else {
Expand All @@ -189,7 +198,9 @@ async fn announce_bootstrap_if_needed(container: &di::RookContainer) -> anyhow::
tracing::warn!(setup_token_preview = %preview, setup_token_len = token.len(), "rook is in bootstrap mode; set the admin password before using the server");
// Only print full token to interactive TTY; otherwise show preview only
if atty::is(atty::Stream::Stderr) {
eprintln!("rook bootstrap mode: use setup token {token} to set the admin password");
eprintln!(
"rook bootstrap mode: use setup token {sanitized} to set the admin password"
);
} else {
eprintln!("rook bootstrap mode: use setup token {preview}… (len={}) to set the admin password", token.len());
}
Expand Down
3 changes: 2 additions & 1 deletion crates/application/rook-usecases/src/route_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ impl RouteRequest {
req: CompletionRequest,
) -> Result<futures::stream::BoxStream<'static, Result<StreamChunk, CortexError>>, CortexError>
{
self.execute_stream_with_format(req, ApiFormat::OpenAI).await
self.execute_stream_with_format(req, ApiFormat::OpenAI)
.await
}

pub async fn execute_stream_with_format(
Expand Down
6 changes: 3 additions & 3 deletions crates/domain/rook-core/src/ports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ use chrono::{DateTime, Utc};
use shared_kernel::{CacheKey, ConnectionId, CortexResult, ModelId, ProviderId};

use super::{
ApiKeyId, ApiKeyRecord, ApiKeyRepositoryError, ApiKeySubject, NewSession, NewUser,
PasswordHash, ProviderConnection, RepositoryError, Session, SessionId, User, UserId,
ApiFormat, AuditEntry, CompletionRequest, CompletionResponse, HealthStatus, StreamChunk,
};
use super::{
ApiFormat, AuditEntry, CompletionRequest, CompletionResponse, HealthStatus, StreamChunk,
ApiKeyId, ApiKeyRecord, ApiKeyRepositoryError, ApiKeySubject, NewSession, NewUser,
PasswordHash, ProviderConnection, RepositoryError, Session, SessionId, User, UserId,
};

/// ---------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions crates/infrastructure/transport-axum/src/format_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ impl FormatTranslatorPort for FormatRegistry {
}

fn missing_translator(kind: &str, from: ApiFormat, to: ApiFormat) -> CortexError {
CortexError::invalid_request(format!(
"missing {kind} translator for {from:?} -> {to:?}"
))
CortexError::invalid_request(format!("missing {kind} translator for {from:?} -> {to:?}"))
}

// ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,15 @@ fn anthropic_response_has_correct_structure() {
assert_eq!(json["usage"]["output_tokens"], 5);
}


// ---------------------------------------------------------------------------
// Registry-routed multi-format use case integration
// ---------------------------------------------------------------------------

use async_trait::async_trait;
use futures::stream;
use rook_core::{
ApiFormat, AuditEntry, AuditPort, CacheKey, CachePort, CompletionRequest,
FormatTranslatorPort, HealthStatus, ProviderPort, RequestMetadata, RouterPort, StreamChunk,
ApiFormat, AuditEntry, AuditPort, CacheKey, CachePort, CompletionRequest, FormatTranslatorPort,
HealthStatus, ProviderPort, RequestMetadata, RouterPort, StreamChunk,
};
use rook_usecases::RouteRequest;
use std::{sync::Arc, time::Duration};
Expand Down Expand Up @@ -248,7 +247,10 @@ impl ProviderPort for RegistryTestProvider {
}
}

async fn complete(&self, req: &CompletionRequest) -> shared_kernel::CortexResult<CompletionResponse> {
async fn complete(
&self,
req: &CompletionRequest,
) -> shared_kernel::CortexResult<CompletionResponse> {
Ok(CompletionResponse {
id: req.id.clone(),
provider: self.id.clone(),
Expand All @@ -267,7 +269,9 @@ impl ProviderPort for RegistryTestProvider {
async fn stream(
&self,
_req: &CompletionRequest,
) -> shared_kernel::CortexResult<futures::stream::BoxStream<'static, shared_kernel::CortexResult<StreamChunk>>> {
) -> shared_kernel::CortexResult<
futures::stream::BoxStream<'static, shared_kernel::CortexResult<StreamChunk>>,
> {
Ok(Box::pin(stream::empty()))
}
}
Expand All @@ -278,7 +282,10 @@ struct RegistryTestRouter {

#[async_trait]
impl RouterPort for RegistryTestRouter {
async fn select(&self, _req: &CompletionRequest) -> shared_kernel::CortexResult<Arc<dyn ProviderPort>> {
async fn select(
&self,
_req: &CompletionRequest,
) -> shared_kernel::CortexResult<Arc<dyn ProviderPort>> {
Ok(self.provider.clone())
}

Expand All @@ -293,7 +300,10 @@ struct NoopCache;

#[async_trait]
impl CachePort for NoopCache {
async fn get(&self, _key: &CacheKey) -> shared_kernel::CortexResult<Option<CompletionResponse>> {
async fn get(
&self,
_key: &CacheKey,
) -> shared_kernel::CortexResult<Option<CompletionResponse>> {
Ok(None)
}

Expand Down