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

Fix report cves #1673

Merged
merged 42 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3420c61
Use camel case for variable name
bjoernricks Oct 2, 2019
eac8ee4
Ensure variables are always defined at ReportCve creation
bjoernricks Oct 2, 2019
c6d9b54
Refactor report app model for new model parsing process
bjoernricks Oct 2, 2019
43c52e1
Add tests for Report App model
bjoernricks Oct 2, 2019
830212d
Fix parsing the port counts of the report hosts
bjoernricks Oct 2, 2019
80e6370
Fix parsing high result counts for hosts in reports
bjoernricks Oct 2, 2019
d451f55
Update Report Host model to use new parsing functions
bjoernricks Oct 2, 2019
9ed4f64
Add tests for Report Host model
bjoernricks Oct 2, 2019
193b7e5
Cleanup Report Vulnerability model
bjoernricks Oct 2, 2019
d3ad54e
Add tests for Report Vulnerability model
bjoernricks Oct 2, 2019
5cbee59
Update Report OperatingSystem model
bjoernricks Oct 2, 2019
1a8caae
Add test for Report OperatingSystem model
bjoernricks Oct 2, 2019
aefdbbb
Update Report Port model
bjoernricks Oct 2, 2019
7d1b756
Add tests for Report Port model
bjoernricks Oct 2, 2019
4fbb975
Drop obsolete method from Report Task model
bjoernricks Oct 4, 2019
2746ccc
Add tests for Report Task model
bjoernricks Oct 4, 2019
2a49316
Add comment about the special behavior of report certs
bjoernricks Oct 4, 2019
431495f
Add tests for Report TLS Certificate model
bjoernricks Oct 4, 2019
0d9aa77
Extend setProperties function to allow overriding properties
bjoernricks Oct 4, 2019
76a587f
Use fromElement in Report model tests to create new models
bjoernricks Oct 4, 2019
92dbd39
Update Report Port model to allow overriding parsed properties
bjoernricks Oct 4, 2019
6596919
Update report parseHosts function
bjoernricks Oct 4, 2019
ddd05c3
Update report parsePorts function
bjoernricks Oct 4, 2019
d6f1c0b
Update parsing report vulnerabilities
bjoernricks Oct 4, 2019
d264af4
Update report parseApps function
bjoernricks Oct 4, 2019
8b16fa6
Update parseOperatingSystems function
bjoernricks Oct 4, 2019
97f0358
Refactor ReportTlsCertificate model to behave more like other models
bjoernricks Oct 4, 2019
8767f86
Fix parsing TLS cert port as integer
bjoernricks Oct 4, 2019
ce823f2
Update parsing report TLS certificates
bjoernricks Oct 4, 2019
e37a6c8
Add tests for parsing report cves
bjoernricks Oct 7, 2019
efb3050
Drop vulnerabilities code from report details
bjoernricks Oct 7, 2019
46ca91f
Drop obsolete report vulnerability
bjoernricks Oct 7, 2019
23f4d59
Update changelog entry
bjoernricks Oct 7, 2019
b58eb06
Merge pull request #1668 from bjoernricks/report-model-parsing-updates
bjoernricks Oct 7, 2019
b96f5ce
Merge branch gsa-8.0 into gsa-9.0
bjoernricks Oct 8, 2019
6d2320c
Fix parsing an nvt from an info response
bjoernricks Oct 8, 2019
becafe1
Add tests for parsing nvt data from an info response element
bjoernricks Oct 8, 2019
fd6f3d8
Improve parsing nvt ref elements
bjoernricks Oct 8, 2019
3e90655
Fix parsing report cve data
bjoernricks Oct 8, 2019
c623785
Add nvtName property to Report Cve model
bjoernricks Oct 8, 2019
9a04f9a
Add nvt columns to the cve list of a report
bjoernricks Oct 8, 2019
f90d394
Add changelog entry
bjoernricks Oct 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions gsa/src/web/pages/reports/cvestable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ import React from 'react';

import {_, _l} from 'gmp/locale/lang';

import {shorten} from 'gmp/utils/string';

import PropTypes from 'web/utils/proptypes';

import SeverityBar from 'web/components/bar/severitybar';

import Divider from 'web/components/layout/divider';

import CveLink from 'web/components/link/cvelink';
import DetailsLink from 'web/components/link/detailslink';

import TableData from 'web/components/table/data';
import TableHead from 'web/components/table/head';
Expand All @@ -42,30 +45,41 @@ const Header = ({currentSortDir, currentSortBy, sort = true, onSortChange}) => (
currentSortDir={currentSortDir}
currentSortBy={currentSortBy}
sortBy={sort ? 'cve' : false}
onSortChange={onSortChange}
title={_('CVE')}
width="50%"
onSortChange={onSortChange}
/>
<TableHead
currentSortDir={currentSortDir}
currentSortBy={currentSortBy}
sortBy={sort ? 'hosts' : false}
sortBy={sort ? 'nvt' : false}
title={_('NVT')}
width="30%"
onSortChange={onSortChange}
/>
<TableHead
currentSortDir={currentSortDir}
currentSortBy={currentSortBy}
sortBy={sort ? 'hosts' : false}
title={_('Hosts')}
width="5%"
onSortChange={onSortChange}
/>
<TableHead
currentSortDir={currentSortDir}
currentSortBy={currentSortBy}
sortBy={sort ? 'occurrences' : false}
onSortChange={onSortChange}
title={_('Occurrences')}
width="5%"
onSortChange={onSortChange}
/>
<TableHead
currentSortDir={currentSortDir}
currentSortBy={currentSortBy}
sortBy={sort ? 'severity' : false}
title={_('Severity')}
width="10%"
onSortChange={onSortChange}
title={_('Severity')}
/>
</TableRow>
</TableHeader>
Expand All @@ -79,7 +93,7 @@ Header.propTypes = {
};

const Row = ({entity}) => {
const {cves, hosts, occurrences, severity} = entity;
const {cves, hosts, occurrences, severity, id, nvtName} = entity;
return (
<TableRow>
<TableData>
Expand All @@ -89,6 +103,11 @@ const Row = ({entity}) => {
))}
</Divider>
</TableData>
<TableData>
<DetailsLink type="nvt" id={id} title={nvtName}>
{shorten(nvtName, 80)}
Copy link
Member

Choose a reason for hiding this comment

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

What happens if the windows gets smaller? Would it be necessary to add line-breaking here, although it might look ok in "full-screen"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't it break automatically? IMHO it only doesn't break if we use css to forbid that.

</DetailsLink>
</TableData>
<TableData>{hosts.count}</TableData>
<TableData>{occurrences}</TableData>
<TableData>
Expand Down
1 change: 1 addition & 0 deletions gsa/src/web/pages/reports/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const closedCvesSortFunctions = {
export const cvesSortFunctions = {
cve: makeCompareString(entity => entity.cves.join(' ')),
hosts: makeCompareNumber(entity => entity.hosts.count),
nvt: makeCompareString(entity => entity.nvtName),
occurrences: makeCompareNumber(entity => entity.occurrences),
severity: makeCompareSeverity(),
};
Expand Down