Skip to content

Conversation

SoumyaRaikwar
Copy link

@SoumyaRaikwar SoumyaRaikwar commented Sep 29, 2025

This PR adds selective scoping to scheduled “Scan All” executions so admins can target only the artifacts they care about. The backend now accepts an optional X-Scan-All-Scope header on schedule create/update that limits the scan set by either:

  1. project_ids: [number, ...]
  2. repositories: [string, ...] (e.g., project/repo or project/repo:tag)

When the header is present, the scan-all execution enumerates only matching artifacts; when omitted, behavior remains unchanged and all artifacts are scanned (backward compatible).

Portal updates: in Interrogation Services > Vulnerability, users can select projects and optionally load and multi-select repositories before saving the schedule; the chosen scope is sent via X-Scan-All-Scope. A small TS fix switches the Project import to the local app model to resolve a type mismatch and ensure a successful Angular build.

Notes/limits:

  • This change scopes scheduled runs only; manual “Scan All now” remains global in this iteration.
  • Invalid or unauthorized targets in the scope are ignored safely.

Build status:

  • Backend: compile succeeds.
  • Frontend: npm ci + ng build succeed after the type import fix.

Related issue

…an-All-Scope header; propagate scope into execution and filter artifacts by project IDs or repositories; add simple UI to choose projects for schedule

Signed-off-by: SoumyaRaikwar <[email protected]>
…der sends repositories if chosen

Signed-off-by: SoumyaRaikwar <[email protected]>
…2322 by importing the local app Project model instead of the swagger-generated Project type. The ProjectService returns the app model (creation_time: string | Date), which mismatched the swagger model (creation_time: string). This unblocks Angular build for the selective scan scope UI.

Signed-off-by: SoumyaRaikwar <[email protected]>
@stonezdj
Copy link
Contributor

@SoumyaRaikwar, thanks for your contribution! because it involves much of code change in Harbor, could you please raise a proposal in github.com/goharbor/community?

Copy link
Contributor

@stonezdj stonezdj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add your proposal in github.com/goharbor/community

@SoumyaRaikwar
Copy link
Author

Hi @stonezdj,

Thank you for the feedback! I've submitted the design proposal to the community repository as requested:

Proposal PR: Add proposal for selective scan-all scope

The proposal includes:

  • Detailed technical specification for the X-Scan-All-Scope header approach
  • Implementation plan covering backend, frontend, and testing
  • Backward compatibility analysis
  • Security considerations and open issues

I'll wait for the community review and approval before proceeding with any further changes to this implementation PR.
Thanks for guiding me through Harbor's contribution process!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Selective Image Scanning Instead of "Scan All" in Scheduled Interrogation Services

6 participants