Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Template and Asset healthcheck #3616

Open
Tracked by #3521
de-jcup opened this issue Nov 15, 2024 · 0 comments
Open
Tracked by #3521

Introduce Template and Asset healthcheck #3616

de-jcup opened this issue Nov 15, 2024 · 0 comments
Assignees

Comments

@de-jcup
Copy link
Member

de-jcup commented Nov 15, 2024

Situation

With the "template an assets" feature SecHub is able to handle different resources at runtime.
It is possible to remove them, assign different assets to projects which have same product setup - so we are able to customize behavior when necessary at runtime.

While the PDS template prarameter is constructed, the SecHub server does automatically check if the template asset does contains a file ${PdsProductIdentifier}.zip inside database.
If it is not available, the Server will throw an exception and the job will fail (without calling a PDS instance at all).

The situation happens only at runtime and it is not easy to understand as an administrator at the first glance why there is a problem etc.

Wanted

There shall be a possibility to check if the current situation with template and assets can lead to problems and how to solve them

Solution

We provide a REST endpoint for administrators:
/api/admin/template/healthcheck

The call will inspect all asociations between

project->Template -> asset
project->Profile->Executor (product identifier) + enabling states

When assets/${assetId}/${productIdentifier}.zip does not exist, the validation will mark this as
serious problem and suggests to upload an empty zipfile as a workaround.

The result of the rest call shall be JSON:

{
  "assetFilesMissing" : [
      "template" : "template-x",
      "asset" : "asset-1",
      "file" : "$filename",

      "executionProfile" : "$profileId",
      "executorConfiguration" : "$executorId",

      "projects" : ["projectId1","projectId2", ".."],

      "suggestion" : "Create at least an empty zip file '$filename' and upload to asset $assetId"
      
  ] 
}
@de-jcup de-jcup self-assigned this Nov 15, 2024
@de-jcup de-jcup changed the title Introduce Template and Asset overall validation Introduce Template and Asset healthcheck Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant