Skip to content

Reject duplicate credential services#2234

Open
BharatDeva wants to merge 1 commit into
greenbone:mainfrom
BharatDeva:fix/openvas-duplicate-credential-services
Open

Reject duplicate credential services#2234
BharatDeva wants to merge 1 commit into
greenbone:mainfrom
BharatDeva:fix/openvas-duplicate-credential-services

Conversation

@BharatDeva

Copy link
Copy Markdown

Summary

This adds a sanity check when creating scans so a target cannot include multiple credentials for the same service.

OpenVAS currently supports one credential per service for a target. With this change, duplicate services are rejected before the scan is stored and the API returns 400 Bad Request with a clear message.

Fixes #1783

Testing

$ cargo test -p greenbone-scanner-framework post_scans
running 9 tests
test post_scans_id::tests::missing_scan ... ok
test post_scans::tests::missing_scan ... ok
test post_scans::tests::duplicate_id ... ok
test post_scans::tests::internal_server_error ... ok
test post_scans_id::tests::internal_server_error ... ok
test post_scans_id::tests::already_running ... ok
test post_scans_id::tests::ok ... ok
test post_scans::tests::duplicate_credential_service ... ok
test post_scans::tests::post_scans ... ok

test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 52 filtered out
$ cargo fmt --check -p greenbone-scanner-framework
$ git diff --check HEAD~1..HEAD

@BharatDeva BharatDeva requested a review from a team as a code owner June 4, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add sanity check for credentials

1 participant