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

Bug 1826354: Container Security Fixes #5326

Merged

Conversation

alecmerdler
Copy link
Contributor

@alecmerdler alecmerdler commented May 7, 2020

Description

Addresses a few issues in the UI for the Container Security Operator, including clarification of text on the popover card, fixing link creation, and fixing page crashes caused by unsafe k8s property access.

Screenshots

Image Security breakdown card (vulns present):
Screenshot_20200507_133122

Image Security breakdown card (no vulns present):
Screenshot_20200504_153545

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1826354
Fixes https://issues.redhat.com/browse/PROJQUAY-676
Addresses https://issues.redhat.com/browse/PROJQUAY-482

@spadgett spadgett changed the title Container Security Fixes Bug 1826354: Container Security Fixes May 7, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label May 7, 2020
@openshift-ci-robot
Copy link
Contributor

@alecmerdler: This pull request references Bugzilla bug 1826354, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1826354: Container Security Fixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label May 7, 2020
@spadgett
Copy link
Member

spadgett commented May 7, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 7, 2020
@openshift-ci-robot
Copy link
Contributor

@spadgett: This pull request references Bugzilla bug 1826354, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label May 7, 2020
@spadgett spadgett added this to the v4.5 milestone May 7, 2020
Header={ImageManifestVulnTableHeader}
Row={ImageManifestVulnTableRow}
EmptyMsg={() => <MsgBox title="No Image Vulnerabilities Found" detail="" />}
Copy link
Member

Choose a reason for hiding this comment

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

This will unmount and remount the empty msg component on each render. It would be better not to inline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

.color.value
}
<ExclamationTriangleIcon
color={priorityFor(_.get(v.status, 'highestSeverity')).color.value}
Copy link
Member

Choose a reason for hiding this comment

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

We've been trying to remove _.get in favor of optional chaining when already updating the code.

Suggested change
color={priorityFor(_.get(v.status, 'highestSeverity')).color.value}
color={priorityFor(v.status?.highestSeverity).color.value}

Having said that, I'm not sure _.get even helps here since we'll have a runtime error on lin 142 if v.status is undefined.

@@ -378,7 +380,7 @@ export const ContainerVulnerabilities: React.FC<ContainerVulnerabilitiesProps> =
title={vuln.metadata.uid}
displayName={`${totalFor(
vulnPriority.findKey(
({ title }) => vuln.status.highestSeverity === title,
({ title }) => _.get(vuln.status, 'highestSeverity') === title,
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
({ title }) => _.get(vuln.status, 'highestSeverity') === title,
({ title }) => vuln.status?.highestSeverity === title,

vulnPriority.find(({ title }) => vuln.status.highestSeverity === title)
.color.value
}
color={priorityFor(_.get(vuln.status, 'highestSeverity')).color.value}
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
color={priorityFor(_.get(vuln.status, 'highestSeverity')).color.value}
color={priorityFor(vuln.status?.highestSeverity).color.value}

color={vulnPriority.find(({ title }) => obj.status.highestSeverity === title).color.value}
/>
&nbsp;{obj.status.highestSeverity}
{_.get(obj.status, 'highestSeverity') ? (
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
{_.get(obj.status, 'highestSeverity') ? (
{obj.status?.highestSeverity ? (

&nbsp;{obj.status.highestSeverity}
{_.get(obj.status, 'highestSeverity') ? (
<>
<SecurityIcon color={priorityFor(_.get(obj.status, 'highestSeverity')).color.value} />
Copy link
Member

Choose a reason for hiding this comment

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

This _.get shouldn't be needed since we already check for highSeverity above.

Suggested change
<SecurityIcon color={priorityFor(_.get(obj.status, 'highestSeverity')).color.value} />
<SecurityIcon color={priorityFor(obj.status.highestSeverity).color.value} />

@spadgett
Copy link
Member

spadgett commented May 7, 2020

/assign

@itsptk
Copy link

itsptk commented May 7, 2020

Does this PR also change the nav item and IMV list to "Image Vulnerabilities?"

1imvlist

cc @beanh66 @alimobrem

@itsptk
Copy link

itsptk commented May 7, 2020

The top section is showing a count of containers? And the bottom is images?
Perhaps we can change the status (outside of the popover) to:

Image Vulnerabilities
8 vulnerable containers

And the top section's heading to:
"Vulnerable Containers" (don't really think the "by severity" is needed)

@alecmerdler
Copy link
Contributor Author

@itsptk The top section is unique container images in the cluster, deduplicated by namespace and pod. That way it aligns with the section below, which is unique container images and shows the impacted namespaces as a column.

@openshift-ci-robot
Copy link
Contributor

@alecmerdler: This pull request references Bugzilla bug 1826354, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1826354: Container Security Fixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@alecmerdler
Copy link
Contributor Author

@spadgett Addressed the issues you pointed out.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alecmerdler, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2020
@openshift-merge-robot openshift-merge-robot merged commit 4e57b07 into openshift:master May 8, 2020
@openshift-ci-robot
Copy link
Contributor

@alecmerdler: All pull requests linked via external trackers have merged: openshift/console#5326. Bugzilla bug 1826354 has been moved to the MODIFIED state.

In response to this:

Bug 1826354: Container Security Fixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@alecmerdler alecmerdler deleted the bugzilla-1826354 branch May 8, 2020 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants