Container findings now name the workloads that run the image and link into the Kubernetes view, which highlights them. An update check asks the registry for newer tags of the same variant, scans the newest one and records which of the open findings are gone in it. The image row then shows the candidate tag, how many findings it fixes and how many remain, marks those CVEs in the expanded list, and offers to roll every workload over to it. The check runs as a job, nightly for all running images or on demand for one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
46 lines
2.2 KiB
Rust
46 lines
2.2 KiB
Rust
use axum::Json;
|
|
use utoipa::openapi::security::{HttpAuthScheme, HttpBuilder, SecurityScheme};
|
|
use utoipa::{Modify, OpenApi};
|
|
|
|
struct BearerAuth;
|
|
impl Modify for BearerAuth {
|
|
fn modify(&self, openapi: &mut utoipa::openapi::OpenApi) {
|
|
let components = openapi.components.get_or_insert_with(Default::default);
|
|
components.add_security_scheme(
|
|
"bearer",
|
|
SecurityScheme::Http(
|
|
HttpBuilder::new()
|
|
.scheme(HttpAuthScheme::Bearer)
|
|
.bearer_format("JWT")
|
|
.build(),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
#[derive(OpenApi)]
|
|
#[openapi(
|
|
info(title = "SoftVisor Monitoring API", version = "0.1.0"),
|
|
paths(
|
|
crate::auth::login, crate::auth::refresh, crate::auth::logout, crate::auth::me,
|
|
crate::users::list, crate::users::create, crate::users::get_one, crate::users::update, crate::users::reset_password,
|
|
crate::settings::get_smtp, crate::settings::put_smtp, crate::settings::test_smtp, crate::settings::list_schedules, crate::settings::put_schedule,
|
|
crate::jobs::list, crate::jobs::kinds, crate::jobs::get_one, crate::jobs::run,
|
|
crate::system::inventory, crate::system::upgrade,
|
|
crate::cluster::overview, crate::cluster::restart, crate::cluster::scale, crate::cluster::set_image, crate::cluster::check_images,
|
|
crate::vulnerabilities::list, crate::vulnerabilities::groups, crate::vulnerabilities::summary, crate::vulnerabilities::targets, crate::vulnerabilities::set_status,
|
|
crate::settings::get_notifications, crate::settings::put_notifications,
|
|
crate::backups::list_targets, crate::backups::get_target, crate::backups::create_target, crate::backups::update_target,
|
|
crate::backups::delete_target, crate::backups::test_target, crate::backups::list_strategies, crate::backups::get_strategy,
|
|
crate::backups::create_strategy, crate::backups::update_strategy, crate::backups::delete_strategy,
|
|
crate::backups::run_strategy, crate::backups::records,
|
|
crate::dashboard::dashboard,
|
|
),
|
|
modifiers(&BearerAuth)
|
|
)]
|
|
pub struct ApiDoc;
|
|
|
|
pub async fn spec() -> Json<utoipa::openapi::OpenApi> {
|
|
Json(ApiDoc::openapi())
|
|
}
|