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

Update fix docs #2931

Merged
merged 2 commits into from
Feb 22, 2024
Merged

Update fix docs #2931

merged 2 commits into from
Feb 22, 2024

Conversation

lucasmoura
Copy link
Contributor

This PR is aims at:

  • Updating the output examples of pro fix for the latest improvement in the Pro client
  • Add a how-to-guide to help users on better visualizing the status of each CVE when the fix execute API endpoint

The pro fix commands were updated recently. Due to that,
we need to update the output examples in the docs.
@github-actions github-actions bot added the docs label Jan 29, 2024
Copy link
Member

@renanrodrigo renanrodrigo left a comment

Choose a reason for hiding this comment

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

couple suggestions, lgtm overall

@@ -0,0 +1,56 @@
# How better visualized result of fixing multiple CVEs
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# How better visualized result of fixing multiple CVEs
# How to better visualize the result when fixing multiple CVEs

CVE-2017-9233 (Coin3D vulnerability) - fixed
```

Note that this output consists of three information details:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Note that this output consists of three information details:
Note that each entry in this output consists of three fields:

@lucasmoura
Copy link
Contributor Author

@s-makin CI is failing here due to a spellcheck error. However, the error is on the word visualize. I can change that word, but I just want to double check if we are following the British spelling here, and no problem at all if we are using, as I just want to double check if that is expected

@s-makin
Copy link
Contributor

s-makin commented Feb 13, 2024

@s-makin CI is failing here due to a spellcheck error. However, the error is on the word visualize. I can change that word, but I just want to double check if we are following the British spelling here, and no problem at all if we are using, as I just want to double check if that is expected

Yes, we are using British English so it should be "visualise". Global replace should get rid of the errors I think.

@lucasmoura
Copy link
Contributor Author

@s-makin fixed

Copy link
Contributor

@s-makin s-makin left a comment

Choose a reason for hiding this comment

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

Only a couple of small nits, I think these might be why the spellcheck is still failing (hopefully should be gtg once fixed)

@@ -92,3 +92,11 @@ Create a ``pro`` Golden Image
:maxdepth: 1

Create a customised Cloud Ubuntu Pro image <howtoguides/create_pro_golden_image.md>

Better visualise result when fixing multiple CVEs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Better visualise result when fixing multiple CVEs
Fixing multiple CVEs

.. toctree::
:maxdepth: 1

Better visualise result when fixing multiple CVEs <howtoguides/how_to_better_visualise_fixing_multiple_cves.rst>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Better visualise result when fixing multiple CVEs <howtoguides/how_to_better_visualise_fixing_multiple_cves.rst>
Better visualise results when fixing multiple CVEs <howtoguides/how_to_better_visualise_fixing_multiple_cves.rst>

*************************************************************

To fix multiple CVEs, you need to use the `u.pro.security.fix.cve.execute.v1` endpoint,
as the CLI `pro fix` command doesn't support multiple CVEs. However, as can be seen :ref:`here <cve-execute-api-v1>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
as the CLI `pro fix` command doesn't support multiple CVEs. However, as can be seen :ref:`here <cve-execute-api-v1>`
as the CLI `pro fix` command doesn't support multiple CVEs. However, as can be seen :ref:`in the endpoint documentation <cve-execute-api-v1>`

as the CLI `pro fix` command doesn't support multiple CVEs. However, as can be seen :ref:`here <cve-execute-api-v1>`
this command will output a JSON blob containing the results of the fix operation for each CVE.

This doesn't allow for a quick visualization of the fix status of each requested CVE.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This doesn't allow for a quick visualization of the fix status of each requested CVE.
This doesn't allow for a quick visualisation of the fix status of each requested CVE.

this command will output a JSON blob containing the results of the fix operation for each CVE.

This doesn't allow for a quick visualization of the fix status of each requested CVE.
To address that, we can use a `jq` filter. The `jq` command is mainly used to parse JSON data directly on
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To address that, we can use a `jq` filter. The `jq` command is mainly used to parse JSON data directly on
To address that, we can use a `jq` filter. The `jq` command is mainly used to parse JSON data directly in


This doesn't allow for a quick visualization of the fix status of each requested CVE.
To address that, we can use a `jq` filter. The `jq` command is mainly used to parse JSON data directly on
the terminal. To know more about it, please refer to this `page <https://manpages.ubuntu.com/manpages/xenial/man1/jq.1.html>`_
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the terminal. To know more about it, please refer to this `page <https://manpages.ubuntu.com/manpages/xenial/man1/jq.1.html>`_
the terminal. To know more about it, please refer to `the jq manpage <https://manpages.ubuntu.com/manpages/xenial/man1/jq.1.html>`_

$ apt update & apt install jq -y

Now that `jq` is installed, we can properly parse the JSON data delivered from the execute API.
As an example, let's assume we want to fix those three CVEs here: **CVE-2020-28196, CVE-2020-15180**
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
As an example, let's assume we want to fix those three CVEs here: **CVE-2020-28196, CVE-2020-15180**
As an example, let's assume we want to fix these three CVEs: **CVE-2020-28196, CVE-2020-15180**


jq -r '.data.attributes.cves_data.cves[] | "\(.title) - \(.status)"'

Finally, if you want to have the same visualization when fixing USNs, just change the `jq` filter
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Finally, if you want to have the same visualization when fixing USNs, just change the `jq` filter
Finally, if you want to have the same visualisation when fixing USNs, just change the `jq` filter

@lucasmoura
Copy link
Contributor Author

@s-makin done

Copy link
Contributor

@s-makin s-makin left a comment

Choose a reason for hiding this comment

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

Thanks @lucasmoura :) LGTM!

@s-makin
Copy link
Contributor

s-makin commented Feb 16, 2024

Thanks @lucasmoura :) LGTM!

Not going to merge - the spellchecker is complaining about jq and manpage, if you wouldn't mind adding those to the wordlist so that the checks can pass, you can feel free to merge it after

Add a how-to-guide to allow users to better visualize the status of each
CVE they have try to fix when running the fix execute API endpoint
@lucasmoura
Copy link
Contributor Author

@s-makin done

Copy link
Contributor

@s-makin s-makin left a comment

Choose a reason for hiding this comment

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

LGTM :) thanks for all your work on this

@s-makin s-makin merged commit dd4bdbb into docs-devel Feb 22, 2024
7 checks passed
@s-makin s-makin deleted the update-fix-docs branch February 22, 2024 09:14
orndorffgrant pushed a commit that referenced this pull request Mar 13, 2024
* docs: update pro fix examples

The pro fix commands were updated recently. Due to that,
we need to update the output examples in the docs.

* docs: better visualize fixing multiple CVEs

Add a how-to-guide to allow users to better visualize the status of each
CVE they have try to fix when running the fix execute API endpoint
s-makin added a commit that referenced this pull request Mar 14, 2024
* Docs apparmor update (#2906)

* doc: Add security features troubleshooting doc

This adds a document explaining how to troubleshoot the Apparmor and
systemd sandboxing features added to the apt-news service.

* global replace of apparmor with AppArmor

* Review from Sally: wording on the description of how applications can behave under confinement

Co-authored-by: Sally <[email protected]>

* Systemd capitalization

* Turns out it should be systemd instead (lowercase)

---------

Co-authored-by: Sally <[email protected]>

* docs: add guide to setup windows machine for WSL

Add guide to setup windows machine for running our
integration tests on WSL instances

* Update fix docs (#2931)

* docs: update pro fix examples

The pro fix commands were updated recently. Due to that,
we need to update the output examples in the docs.

* docs: better visualize fixing multiple CVEs

Add a how-to-guide to allow users to better visualize the status of each
CVE they have try to fix when running the fix execute API endpoint

* remove unnecessary anchor that linkcheck doesn't like

* Apply suggestions from code review

Co-authored-by: Sally <[email protected]>

* Update wordlist.txt

There's a jq in a link as well, so spellcheck still fails. I've re-added jq to the wordlist.

---------

Co-authored-by: Andreas Hasenack <[email protected]>
Co-authored-by: Sally <[email protected]>
Co-authored-by: Lucas Moura <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants