Repository navigation
Fix pulp-cli commands on vuln report docs #1255
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
Open
pedro-psb
wants to merge
1
commit into
pulp:main
Choose a base branch
from
pedro-psb:fix-vuln-report-cli-commands
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fixed CLI commands in the vulnerability report documentation to use `pulp repository version scan`. The command previously shown there (`pulp vulnerability-report create`) doesn't exit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| # Vulnerability Report | ||
|
|
||
| Pulp Python provides vulnerability scanning capabilities to help you identify known security | ||
| vulnerabilities in your Python packages. This feature integrates with the [Open Source Vulnerabilities (OSV)](https://osv.dev/) | ||
| vulnerabilities in your Python packages. | ||
| This feature integrates with the [Open Source Vulnerabilities (OSV)](https://osv.dev/) | ||
| database to scan Pulp `RepositoryVersions` for vulnerable packages. | ||
|
|
||
| !!! info "New in `pulp_python>=3.21.0`" | ||
| !!! info "New in `pulp-cli>=0.37.0` (optional)" | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before generating the vulnerability report, ensure that: | ||
|
|
@@ -13,11 +17,14 @@ Before generating the vulnerability report, ensure that: | |
|
|
||
| ## Generating a vulnerability report | ||
|
|
||
| To scan a `RepositoryVersion` for vulnerabilities, you need to pass the name of the repository and | ||
| optionally the version: | ||
| To scan a `RepositoryVersion` for vulnerabilities, call the `scan` command on a repository version. | ||
|
|
||
| ```bash | ||
| pulp vulnerability-report create --repository my-repo --version 1 | ||
| # Use the latest version | ||
| pulp python repository version scan --repository my-repo | ||
|
|
||
| # Or specify a version | ||
| pulp python repository version scan --repository my-repo --version 1 | ||
| ``` | ||
|
|
||
| ## Understanding Scan Results | ||
|
|
@@ -70,7 +77,7 @@ To view the actual vulnerability data, retrieve the vulnerability report: | |
|
|
||
| ```bash | ||
| # Get vulnerability report details | ||
| pulp vulnerability-report show --href ${VULN_REPORT_HREF} | ||
| pulp show --href ${VULN_REPORT_HREF} | ||
| ``` | ||
|
|
||
| The report contains detailed information about each vulnerability, including: | ||
|
|
@@ -111,9 +118,9 @@ pulp python repository sync \ | |
| --remote pypi-remote | ||
|
|
||
| # 4. Scan for vulnerabilities | ||
| pulp vulnerability-report create --repository security-scan-repo | ||
| pulp python repository version scan --repository security-scan-repo | ||
|
|
||
| # 5. View the vulnerability report | ||
| VULN_REPORT=$(pulp python repository version show --repository security-scan-repo | jq -r '.vuln_report') | ||
| pulp vulnerability-report show --href $VULN_REPORT | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| pulp show --href $VULN_REPORT | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: pulp/pulp_python
Length of output: 13614
🏁 Script executed:
Repository: pulp/pulp_python
Length of output: 5580
🌐 Web query:
official pulp-cli documentation repository version show --repository --version💡 Result:
Preserve the selected repository version in the follow-up command.
--version 1scans a specific version, but the later lookup omits--version 1. If a newer version exists, it can return a differentRepositoryVersionand itsvuln_report. Thepulp show --hrefcommand then retrieves the report from that unversioned lookup.Proposed fix
🤖 Prompt for AI Agents