From 7f8f355d52d63838a7e6d3c5c7401819bb50be34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 14:35:45 +0200 Subject: [PATCH 01/56] Update wording Use camelCase for all variables. --- gsa/src/web/entities/__tests__/filterprovider.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gsa/src/web/entities/__tests__/filterprovider.js b/gsa/src/web/entities/__tests__/filterprovider.js index 3f7a44128d..d2615e9dd8 100644 --- a/gsa/src/web/entities/__tests__/filterprovider.js +++ b/gsa/src/web/entities/__tests__/filterprovider.js @@ -33,7 +33,7 @@ describe('FilterProvider component tests', () => { const locationQuery = {filter: 'location=query'}; - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); const getSetting = jest.fn().mockResolvedValue({}); const gmp = { @@ -50,7 +50,7 @@ describe('FilterProvider component tests', () => { store.dispatch(loadingActions.success({rowsperpage: {value: '42'}})); store.dispatch( - defaultFilterLoadingActions.success('task', defaultSettingfilter), + defaultFilterLoadingActions.success('task', defaultSettingFilter), ); const renderFunc = jest @@ -76,7 +76,7 @@ describe('FilterProvider component tests', () => { const emptyFilter = Filter.fromString('rows=42'); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); const getSetting = jest.fn().mockResolvedValue({}); const gmp = { @@ -93,7 +93,7 @@ describe('FilterProvider component tests', () => { store.dispatch(loadingActions.success({rowsperpage: {value: '42'}})); store.dispatch( - defaultFilterLoadingActions.success('task', defaultSettingfilter), + defaultFilterLoadingActions.success('task', defaultSettingFilter), ); store.dispatch(pageFilter('task', pFilter)); @@ -114,7 +114,7 @@ describe('FilterProvider component tests', () => { test('should use defaultSettingFilter', async () => { const resultingFilter = Filter.fromString('foo=bar rows=42'); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); const emptyFilter = Filter.fromString('rows=42'); @@ -133,7 +133,7 @@ describe('FilterProvider component tests', () => { store.dispatch(loadingActions.success({rowsperpage: {value: '42'}})); store.dispatch( - defaultFilterLoadingActions.success('task', defaultSettingfilter), + defaultFilterLoadingActions.success('task', defaultSettingFilter), ); const renderFunc = jest @@ -150,7 +150,7 @@ describe('FilterProvider component tests', () => { expect(renderFunc).not.toHaveBeenCalledWith({filter: emptyFilter}); }); - test('should use fallbackfilter if defaultSettingFilter could not be loaded', async () => { + test('should use fallbackFilter if defaultSettingFilter could not be loaded', async () => { const resultingFilter = Filter.fromString('fall=back rows=42'); const fallbackFilter = Filter.fromString('fall=back'); From a873e07678de684bee973e0e0a94092823f1458b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 14:53:23 +0200 Subject: [PATCH 02/56] Don't change global filter object Filter model objects are mutable. Therefore a copy must be created to not influence other tests. --- gsa/src/web/entities/__tests__/filterprovider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsa/src/web/entities/__tests__/filterprovider.js b/gsa/src/web/entities/__tests__/filterprovider.js index d2615e9dd8..88aa0211ac 100644 --- a/gsa/src/web/entities/__tests__/filterprovider.js +++ b/gsa/src/web/entities/__tests__/filterprovider.js @@ -231,7 +231,7 @@ describe('FilterProvider component tests', () => { }); test('should use default fallbackFilter as last resort', async () => { - const resultingFilter = DEFAULT_FALLBACK_FILTER.set('rows', 42); + const resultingFilter = DEFAULT_FALLBACK_FILTER.copy().set('rows', 42); const getSetting = jest.fn().mockResolvedValue({}); const subscribe = jest.fn(); From d29fdbba30f7a088999519d3eb3d9d77046a7e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 14:54:39 +0200 Subject: [PATCH 03/56] Allow to use a different name to load the page filter The FilterProvider is used to load and determine a filter (mostly) for list pages. In saved the current used filter at a list page in the redux store under the gmp name e.g. task. This change allows to use a different name for the filter saved in the redux store. --- .../web/entities/__tests__/filterprovider.js | 46 +++++++++++++++++++ gsa/src/web/entities/filterprovider.js | 8 +++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/gsa/src/web/entities/__tests__/filterprovider.js b/gsa/src/web/entities/__tests__/filterprovider.js index 88aa0211ac..bf7d978bd2 100644 --- a/gsa/src/web/entities/__tests__/filterprovider.js +++ b/gsa/src/web/entities/__tests__/filterprovider.js @@ -111,6 +111,52 @@ describe('FilterProvider component tests', () => { expect(renderFunc).not.toHaveBeenCalledWith({filter: emptyFilter}); }); + test('should allow to set a pageName for loading the pageFilter', async () => { + const gmpName = 'task'; + const pageName = 'foo-bar-baz'; + const resultingFilter = Filter.fromString('page=filter rows=42'); + + const pFilter = Filter.fromString('page=filter'); + + const emptyFilter = Filter.fromString('rows=42'); + + const defaultSettingFilter = Filter.fromString('foo=bar'); + + const getSetting = jest.fn().mockResolvedValue({}); + const gmp = { + user: { + getSetting, + }, + }; + + const {render, store} = rendererWith({ + gmp, + store: true, + router: true, + }); + + store.dispatch(loadingActions.success({rowsperpage: {value: '42'}})); + store.dispatch( + defaultFilterLoadingActions.success(gmpName, defaultSettingFilter), + ); + store.dispatch(pageFilter(pageName, pFilter)); + + const renderFunc = jest + .fn() + .mockReturnValue(); + + const {getByTestId} = render( + + {renderFunc} + , + ); + + await waitForElement(() => getByTestId('awaiting-span')); + + expect(renderFunc).toHaveBeenCalledWith({filter: resultingFilter}); + expect(renderFunc).not.toHaveBeenCalledWith({filter: emptyFilter}); + }); + test('should use defaultSettingFilter', async () => { const resultingFilter = Filter.fromString('foo=bar rows=42'); diff --git a/gsa/src/web/entities/filterprovider.js b/gsa/src/web/entities/filterprovider.js index e7f61dcc30..1f165faf77 100644 --- a/gsa/src/web/entities/filterprovider.js +++ b/gsa/src/web/entities/filterprovider.js @@ -45,6 +45,7 @@ const FilterProvider = ({ children, fallbackFilter, gmpname, + pageName = gmpname, locationQuery = {}, }) => { const gmp = useGmp(); @@ -96,12 +97,14 @@ const FilterProvider = ({ useEffect(() => { if (isDefined(locationQuery.filter)) { - dispatch(setPageFilter(gmpname, Filter.fromString(locationQuery.filter))); + dispatch( + setPageFilter(pageName, Filter.fromString(locationQuery.filter)), + ); } setLocationQueryFilter(undefined); }, []); // eslint-disable-line react-hooks/exhaustive-deps - const pageFilter = useSelector(state => getPage(state).getFilter(gmpname)); + const pageFilter = useSelector(state => getPage(state).getFilter(pageName)); if (isDefined(locationQueryFilter)) { returnedFilter = locationQueryFilter; @@ -146,6 +149,7 @@ FilterProvider.propTypes = { locationQuery: PropTypes.shape({ filter: PropTypes.string, }), + pageName: PropTypes.string, }; export default FilterProvider; From c9dbf993d056c4a106b98072d215a48a029fddf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 14:57:33 +0200 Subject: [PATCH 04/56] Revert commit and use filter from FilterProvider again Revert 60ec7eb8f0d8d63811b680584e422a4d28eb2d08 and PR #2358 because it doesn't fix the cause of the original problem. --- gsa/src/web/pages/reports/detailspage.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gsa/src/web/pages/reports/detailspage.js b/gsa/src/web/pages/reports/detailspage.js index 197d9d9f41..d75b0a40dc 100644 --- a/gsa/src/web/pages/reports/detailspage.js +++ b/gsa/src/web/pages/reports/detailspage.js @@ -714,6 +714,11 @@ const load = ({ filter = reportFilter; } + if (!hasValue(filter)) { + // use filter from user setting + filter = defaultFilter; + } + if (!hasValue(filter)) { // use fallback filter filter = DEFAULT_FILTER; From 7ec8842bbcdeef6f670214140ce6d2a7d1f0ba1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 15:00:22 +0200 Subject: [PATCH 05/56] During loading a report use the stored page filter The page filter is already passed via redux connect and should be used for loading the report with second highest priority. --- gsa/src/web/pages/reports/detailspage.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gsa/src/web/pages/reports/detailspage.js b/gsa/src/web/pages/reports/detailspage.js index d75b0a40dc..ae042927a4 100644 --- a/gsa/src/web/pages/reports/detailspage.js +++ b/gsa/src/web/pages/reports/detailspage.js @@ -706,6 +706,7 @@ const load = ({ reportId, // eslint-disable-next-line no-shadow loadReportWithThreshold, + pageFilter, reportFilter, updateFilter, }) => filter => { @@ -714,6 +715,11 @@ const load = ({ filter = reportFilter; } + if (!hasValue(filter)) { + // use filter from store + filter = pageFilter; + } + if (!hasValue(filter)) { // use filter from user setting filter = defaultFilter; From 9509dfa9e332bbc3d00b3774776138fe2e8a5151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 15:02:49 +0200 Subject: [PATCH 06/56] Update loading of results filter for report details When determining the filter for loading a report and its results we need to ensure that the user settings are considered but not to use the stored filter of the results list page. Therefore use a different page name in the FilterProvider to load the report results filter. The resulting filter is passed as defaultFilter to the load function. --- gsa/src/web/pages/reports/detailspage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gsa/src/web/pages/reports/detailspage.js b/gsa/src/web/pages/reports/detailspage.js index ae042927a4..21be7f4450 100644 --- a/gsa/src/web/pages/reports/detailspage.js +++ b/gsa/src/web/pages/reports/detailspage.js @@ -735,7 +735,11 @@ const load = ({ }; const ReportDetailsWrapper = ({reportFilter, ...props}) => ( - + {({filter}) => ( Date: Thu, 6 Aug 2020 15:09:11 +0200 Subject: [PATCH 07/56] Add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe5d5aa53..da7865df91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Deleting a single entity now removes its ID from store [#1839](https://github.com/greenbone/gsa/pull/1839) ### Fixed +- Don't use stored result list page filter at report results tab [#2366](https://github.com/greenbone/gsa/pull/2366) - Fixed flickering reports [#2359](https://github.com/greenbone/gsa/pull/2359) - Fixed "Hosts scanned" in report details disappearing during page refresh [#2357](https://github.com/greenbone/gsa/pull/2357) - Fixed schedule_periods not forwarded if there is no schedule [#2331](https://github.com/greenbone/gsa/pull/2331) From d9ad09d5346fc9af1a1b121e6a1dae634994392b Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Thu, 6 Aug 2020 15:39:52 +0200 Subject: [PATCH 08/56] Adjust ErrorPanel to handle long error messages without overflow --- gsa/src/web/components/error/errorpanel.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/gsa/src/web/components/error/errorpanel.js b/gsa/src/web/components/error/errorpanel.js index 366ebe57a5..4c80a61176 100644 --- a/gsa/src/web/components/error/errorpanel.js +++ b/gsa/src/web/components/error/errorpanel.js @@ -45,9 +45,7 @@ const ErrorDetails = styled.div` background-color: ${Theme.white}; padding: 5px; max-height: 200px; - overflow: auto; overflow-x: auto; - white-space: pre; `; const ErrorPanel = ({error, message, info}) => { From d0e328e6d2b6be54322232276bd5833bb185e857 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Thu, 6 Aug 2020 15:42:58 +0200 Subject: [PATCH 09/56] Handle missing report formats with a better error message --- gsa/src/web/pages/reports/detailspage.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gsa/src/web/pages/reports/detailspage.js b/gsa/src/web/pages/reports/detailspage.js index 197d9d9f41..d536ffcd25 100644 --- a/gsa/src/web/pages/reports/detailspage.js +++ b/gsa/src/web/pages/reports/detailspage.js @@ -263,6 +263,17 @@ class ReportDetails extends React.Component { // if no report format id is available we would create an infinite // render loop here this.setState({reportFormatId}); + } else { + // if there is no report format at all, throw a proper error message + // instead of just showing x is undefined JS stacktrace + const noReportFormatError = _( + 'The report cannot be displayed because' + + ' no Greenbone Vulnerability Manager report format is available.' + + ' This could be due to a missing feed. Please update the feed, ' + + 'check the "feed import owner" setting, or contact your system ' + + 'administrator.', + ); + throw new Error(noReportFormatError); } } From 1a3349d93acc6f41440fe10bb60c309e369deeb7 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Thu, 6 Aug 2020 15:57:35 +0200 Subject: [PATCH 10/56] Translate new error message for missing report formats to German --- gsa/public/locales/gsa-de.json | 1 + 1 file changed, 1 insertion(+) diff --git a/gsa/public/locales/gsa-de.json b/gsa/public/locales/gsa-de.json index b59648ed2d..b71c6a76da 100644 --- a/gsa/public/locales/gsa-de.json +++ b/gsa/public/locales/gsa-de.json @@ -1659,6 +1659,7 @@ "The maximum of {{num}} hosts was exceeded. If there are more hosts associated with this process, they will not be taken into account.": "Das Maximum von {{num}} Hosts wurde überschritten. Sollten weitere Hosts mit diesem Prozess verknüpft sein, werden sie nicht mitberücksichtigt.", "The name must include at least one alphanumeric character or one of .,-/_# and space.": "Der Name muss mindestens ein alphanumerisches Zeichen oder eines von .,-/_# und Leerzeichen enthalten.", "The port range needs numerical values for start and end!": "Der Portbereich benötigt numerische Werte für Start und Ende!", + "The report cannot be displayed because no Greenbone Vulnerability Manager report format is available. This could be due to a missing feed. Please update the feed, check the \"feed import owner\" setting, or contact your system administrator.": "Der Bericht kann nicht angezeigt werden, weil dem Greenbone Vulnerability Manager kein Berichtformat zur Verfügung steht. Dies könnte an einem fehlenden Feed liegen. Bitte aktualisieren Sie den Feed, überprüfen die \"Feed Import Besitzer\"-Einstellungen, oder kontaktieren Ihren Systemadministrator.", "The report is empty. The filter does not match any of the {{all}} results.": "Der Bericht ist leer. Der Filter passt zu keinem der {{all}} Ergebnisse.", "The scan did not collect any results": "Der Scan hat keine Ergebnisse gesammelt", "The scan is still running and no results have arrived yet": "Der Scan läuft noch und es sind noch keine Ergebnisse eingetroffen", From 45072cb010d7be4b1199e46ea711e46d37cb03d7 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Thu, 6 Aug 2020 15:59:46 +0200 Subject: [PATCH 11/56] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe5d5aa53..8c59d0565c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Deleting a single entity now removes its ID from store [#1839](https://github.com/greenbone/gsa/pull/1839) ### Fixed +- Show proper error message on report detailspage when no report format is available [#2367](https://github.com/greenbone/gsa/pull/2367) - Fixed flickering reports [#2359](https://github.com/greenbone/gsa/pull/2359) - Fixed "Hosts scanned" in report details disappearing during page refresh [#2357](https://github.com/greenbone/gsa/pull/2357) - Fixed schedule_periods not forwarded if there is no schedule [#2331](https://github.com/greenbone/gsa/pull/2331) From 03dd128e297ffc4b0420d47e0b57306adcaffbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 10:46:10 +0200 Subject: [PATCH 12/56] Fix pagination for report results tab Use the loaded results counts not the result counts from the report. The results are loaded independently of the report now and therefore the result counts from the report doesn't fit anymore. --- gsa/src/web/pages/reports/details/resultstab.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gsa/src/web/pages/reports/details/resultstab.js b/gsa/src/web/pages/reports/details/resultstab.js index dd9f51c6ed..9cd8738e9f 100644 --- a/gsa/src/web/pages/reports/details/resultstab.js +++ b/gsa/src/web/pages/reports/details/resultstab.js @@ -364,6 +364,7 @@ const mapStateToProps = (state, {reportId}) => { resultsFilter, resultsError: selector.getEntitiesError(resultsFilter), results: selector.getEntities(resultsFilter), + resultsCounts: selector.getEntitiesCounts(resultsFilter), isLoading: selector.isLoadingEntities(resultsFilter), }; }; From 6880977c648dd47973937b18ac1824f5cd8f214e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 10:50:19 +0200 Subject: [PATCH 13/56] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7543144cab..b99ec32a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Show proper error message on report detailspage when no report format is available [#2367](https://github.com/greenbone/gsa/pull/2367) - Don't use stored result list page filter at report results tab [#2366](https://github.com/greenbone/gsa/pull/2366) +- Fixed pagination of report results [#2365](https://github.com/greenbone/gsa/pull/2365) - Fixed flickering reports [#2359](https://github.com/greenbone/gsa/pull/2359) - Fixed "Hosts scanned" in report details disappearing during page refresh [#2357](https://github.com/greenbone/gsa/pull/2357) - Fixed schedule_periods not forwarded if there is no schedule [#2331](https://github.com/greenbone/gsa/pull/2331) From e01e9b424e9b66f4cf10dd50c9c8c064ae55a83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 6 Aug 2020 17:03:22 +0200 Subject: [PATCH 14/56] Fix displaying correct counts in empty result message box https://github.com/greenbone/gsa/pull/2335 tried to fix that but broke the report results pagination. --- gsa/src/web/pages/reports/details/resultstab.js | 10 ++++++---- gsa/src/web/pages/reports/detailscontent.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gsa/src/web/pages/reports/details/resultstab.js b/gsa/src/web/pages/reports/details/resultstab.js index 9cd8738e9f..2dda2f455c 100644 --- a/gsa/src/web/pages/reports/details/resultstab.js +++ b/gsa/src/web/pages/reports/details/resultstab.js @@ -165,6 +165,7 @@ class ResultsTab extends React.Component { progress, reportFilter, reportId, + reportResultsCounts, resultsError, resultsFilter, status, @@ -210,8 +211,8 @@ class ResultsTab extends React.Component { ? resultsFilter.copy().delete('_and_report_id') : reportFilter; - if (isDefined(resultsCounts) && resultsCounts.filtered === 0) { - if (resultsCounts.all === 0) { + if (reportResultsCounts?.filtered === 0) { + if (reportResultsCounts.all === 0) { return ( ); - } else if (resultsCounts.all > 0) { + } else if (reportResultsCounts.all > 0) { return ( Date: Thu, 6 Aug 2020 17:12:00 +0200 Subject: [PATCH 15/56] Update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b99ec32a44..94d15dda28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Improve performance of form fields in edit scan config dialog [#2354](https://github.com/greenbone/gsa/pull/2354) - Default to sorting nvts by "Created", newest first [#2352](https://github.com/greenbone/gsa/pull/2352) - Disable EditIcons for data objects from feed [#2346](https://github.com/greenbone/gsa/pull/2346) -- EmptyResultsReport uses the same counts as the results tab title in normal reports, when filtering for nonexistent results [#2335](https://github.com/greenbone/gsa/pull/2335) - Improve error 503 message at login [#2310](https://github.com/greenbone/gsa/pull/2310) - Use unified solution type instead of solution type nvt tag [#2268](https://github.com/greenbone/gsa/pull/2268) - Changed queued status color [#2227](https://github.com/greenbone/gsa/pull/2227) @@ -43,6 +42,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Deleting a single entity now removes its ID from store [#1839](https://github.com/greenbone/gsa/pull/1839) ### Fixed +- EmptyResultsReport uses the same counts as the results tab title in normal reports, when filtering for nonexistent results + [#2335](https://github.com/greenbone/gsa/pull/2335), [#2365](https://github.com/greenbone/gsa/pull/2365) - Show proper error message on report detailspage when no report format is available [#2367](https://github.com/greenbone/gsa/pull/2367) - Don't use stored result list page filter at report results tab [#2366](https://github.com/greenbone/gsa/pull/2366) - Fixed pagination of report results [#2365](https://github.com/greenbone/gsa/pull/2365) From 8202ea61d80253da0d2b56d6d32bf7a6cba298db Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Fri, 7 Aug 2020 09:44:31 +0200 Subject: [PATCH 16/56] Updated references in docs / manpages. --- gsad/doc/gsad.8 | 23 +++++++++++++++-------- gsad/doc/gsad.8.xml | 14 ++++++++++---- gsad/doc/gsad.html | 21 +++++++++++---------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/gsad/doc/gsad.8 b/gsad/doc/gsad.8 index 64463f8297..8debc84e77 100644 --- a/gsad/doc/gsad.8 +++ b/gsad/doc/gsad.8 @@ -108,18 +108,25 @@ gsad Start gsad with the default port configuration and listen on port 443 for HTTPS requests. .SH SEE ALSO -.BR openvassd (8), -.BR gmp (8), +.BR openvas (8), .BR gvmd (8), -.BR gsad (8) +.BR ospd-openvas (8) .SH MORE INFORMATION ABOUT GREENBONE VULNERABILITY MANAGEMENT The canonical places where you will find more information about the Greenbone Vulnerability Manager are: -\fBhttps://community.greenbone.net\f1 (Community portal) - -\fBhttps://github.com/greenbone\f1 (Development Platform) - -\fBhttps://greenbone.net\f1 (Greenbone website) +.RS +.UR https://community.greenbone.net +Community Portal +.UE +.br +.UR https://github.com/greenbone +Development Platform +.UE +.br +.UR https://www.greenbone.net +Greenbone Website +.UE +.RE .SH COPYRIGHT The Greenbone Security Assistant is released under the GNU GPL, version 2, or, at your option, any later version. diff --git a/gsad/doc/gsad.8.xml b/gsad/doc/gsad.8.xml index 9efe5df216..7f7773707f 100644 --- a/gsad/doc/gsad.8.xml +++ b/gsad/doc/gsad.8.xml @@ -126,19 +126,25 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

+ +

- The places where you will find more information are: + The canonical places where you will find more information + about the Greenbone Vulnerability Manager are: - - (Official site) + + (Community Portal) - + (Development Platform) + + + (Greenbone Website)

diff --git a/gsad/doc/gsad.html b/gsad/doc/gsad.html index c41871788e..e7f24f4cb9 100644 --- a/gsad/doc/gsad.html +++ b/gsad/doc/gsad.html @@ -122,26 +122,27 @@

EXAMPLES

SEE ALSO

- openvassd (8) - openvasad (8) - omp (8) - openvasmd (8) - gsd (8) + openvas (8) + gvmd (8) + ospd-openvas (8)

-

MORE INFORMATION ABOUT THE OpenVAS PROJECT

+

MORE INFORMATION ABOUT GREENBONE VULNERABILITY MANAGEMENT

The canonical places where you will find more information - about the OpenVAS project are: + about the Greenbone Vulnerability Manager are: - http://www.openvas.org/ - (Official site) + https://community.greenbone.net + (Community Portal) - http://wald.intevation.org/projects/openvas/ + https://github.com/greenbone (Development Platform) + + https://www.greenbone.net + (Greenbone Website)

From 12540a115bc2087fe8e0c4fedd511dcd6cc00146 Mon Sep 17 00:00:00 2001 From: cfi-gb <34644702+cfi-gb@users.noreply.github.com> Date: Fri, 7 Aug 2020 09:52:32 +0200 Subject: [PATCH 17/56] Update gsad/doc/gsad.html --- gsad/doc/gsad.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsad/doc/gsad.html b/gsad/doc/gsad.html index e7f24f4cb9..66fa6e9ca6 100644 --- a/gsad/doc/gsad.html +++ b/gsad/doc/gsad.html @@ -129,7 +129,7 @@

SEE ALSO

-

MORE INFORMATION ABOUT GREENBONE VULNERABILITY MANAGEMENT

+

MORE INFORMATION

The canonical places where you will find more information From 5a0cf51a675d23d72425baf9670beb02dd5270a8 Mon Sep 17 00:00:00 2001 From: cfi-gb <34644702+cfi-gb@users.noreply.github.com> Date: Fri, 7 Aug 2020 09:52:41 +0200 Subject: [PATCH 18/56] Update gsad/doc/gsad.8 --- gsad/doc/gsad.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsad/doc/gsad.8 b/gsad/doc/gsad.8 index 8debc84e77..a7a0b935ba 100644 --- a/gsad/doc/gsad.8 +++ b/gsad/doc/gsad.8 @@ -111,7 +111,7 @@ Start gsad with the default port configuration and listen on port 443 for HTTPS .BR openvas (8), .BR gvmd (8), .BR ospd-openvas (8) -.SH MORE INFORMATION ABOUT GREENBONE VULNERABILITY MANAGEMENT +.SH MORE INFORMATION The canonical places where you will find more information about the Greenbone Vulnerability Manager are: .RS From 6ba77f222a2643cf4d052d12c3ef51c8af7994da Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Fri, 7 Aug 2020 10:56:47 +0200 Subject: [PATCH 19/56] Minor textual improvement to explain which feed should be synced. --- gsa/public/locales/gsa-de.json | 2 +- gsa/src/web/pages/reports/detailspage.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gsa/public/locales/gsa-de.json b/gsa/public/locales/gsa-de.json index b71c6a76da..4774abf143 100644 --- a/gsa/public/locales/gsa-de.json +++ b/gsa/public/locales/gsa-de.json @@ -1659,7 +1659,7 @@ "The maximum of {{num}} hosts was exceeded. If there are more hosts associated with this process, they will not be taken into account.": "Das Maximum von {{num}} Hosts wurde überschritten. Sollten weitere Hosts mit diesem Prozess verknüpft sein, werden sie nicht mitberücksichtigt.", "The name must include at least one alphanumeric character or one of .,-/_# and space.": "Der Name muss mindestens ein alphanumerisches Zeichen oder eines von .,-/_# und Leerzeichen enthalten.", "The port range needs numerical values for start and end!": "Der Portbereich benötigt numerische Werte für Start und Ende!", - "The report cannot be displayed because no Greenbone Vulnerability Manager report format is available. This could be due to a missing feed. Please update the feed, check the \"feed import owner\" setting, or contact your system administrator.": "Der Bericht kann nicht angezeigt werden, weil dem Greenbone Vulnerability Manager kein Berichtformat zur Verfügung steht. Dies könnte an einem fehlenden Feed liegen. Bitte aktualisieren Sie den Feed, überprüfen die \"Feed Import Besitzer\"-Einstellungen, oder kontaktieren Ihren Systemadministrator.", + "The report cannot be displayed because no Greenbone Vulnerability Manager report format is available. This could be due to a missing GVMd data feed. Please update the GVMd data feed, check the \"feed import owner\" setting, or contact your system administrator.": "Der Bericht kann nicht angezeigt werden, weil dem Greenbone Vulnerability Manager kein Berichtformat zur Verfügung steht. Dies könnte an einem fehlenden GVMd Data Feed liegen. Bitte aktualisieren Sie den GVMd Data Feed, überprüfen die \"Feed Import Besitzer\"-Einstellungen, oder kontaktieren Ihren Systemadministrator.", "The report is empty. The filter does not match any of the {{all}} results.": "Der Bericht ist leer. Der Filter passt zu keinem der {{all}} Ergebnisse.", "The scan did not collect any results": "Der Scan hat keine Ergebnisse gesammelt", "The scan is still running and no results have arrived yet": "Der Scan läuft noch und es sind noch keine Ergebnisse eingetroffen", diff --git a/gsa/src/web/pages/reports/detailspage.js b/gsa/src/web/pages/reports/detailspage.js index b2f332340a..1b9ca5e051 100644 --- a/gsa/src/web/pages/reports/detailspage.js +++ b/gsa/src/web/pages/reports/detailspage.js @@ -269,9 +269,9 @@ class ReportDetails extends React.Component { const noReportFormatError = _( 'The report cannot be displayed because' + ' no Greenbone Vulnerability Manager report format is available.' + - ' This could be due to a missing feed. Please update the feed, ' + - 'check the "feed import owner" setting, or contact your system ' + - 'administrator.', + ' This could be due to a missing GVMd data feed. Please update' + + ' the GVMd data feed, check the "feed import owner" setting, or' + + ' contact your system administrator.', ); throw new Error(noReportFormatError); } From 33fb63f4448827ce5c8a00441679cd96be8affa6 Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Fri, 7 Aug 2020 13:06:01 +0200 Subject: [PATCH 20/56] Make the daemon name lower case. --- gsa/public/locales/gsa-de.json | 2 +- gsa/src/web/pages/reports/detailspage.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gsa/public/locales/gsa-de.json b/gsa/public/locales/gsa-de.json index 4774abf143..fbb7467ccb 100644 --- a/gsa/public/locales/gsa-de.json +++ b/gsa/public/locales/gsa-de.json @@ -1659,7 +1659,7 @@ "The maximum of {{num}} hosts was exceeded. If there are more hosts associated with this process, they will not be taken into account.": "Das Maximum von {{num}} Hosts wurde überschritten. Sollten weitere Hosts mit diesem Prozess verknüpft sein, werden sie nicht mitberücksichtigt.", "The name must include at least one alphanumeric character or one of .,-/_# and space.": "Der Name muss mindestens ein alphanumerisches Zeichen oder eines von .,-/_# und Leerzeichen enthalten.", "The port range needs numerical values for start and end!": "Der Portbereich benötigt numerische Werte für Start und Ende!", - "The report cannot be displayed because no Greenbone Vulnerability Manager report format is available. This could be due to a missing GVMd data feed. Please update the GVMd data feed, check the \"feed import owner\" setting, or contact your system administrator.": "Der Bericht kann nicht angezeigt werden, weil dem Greenbone Vulnerability Manager kein Berichtformat zur Verfügung steht. Dies könnte an einem fehlenden GVMd Data Feed liegen. Bitte aktualisieren Sie den GVMd Data Feed, überprüfen die \"Feed Import Besitzer\"-Einstellungen, oder kontaktieren Ihren Systemadministrator.", + "The report cannot be displayed because no Greenbone Vulnerability Manager report format is available. This could be due to a missing gvmd data feed. Please update the gvmd data feed, check the \"feed import owner\" setting, or contact your system administrator.": "Der Bericht kann nicht angezeigt werden, weil dem Greenbone Vulnerability Manager kein Berichtformat zur Verfügung steht. Dies könnte an einem fehlenden gvmd Data Feed liegen. Bitte aktualisieren Sie den gvmd Data Feed, überprüfen die \"Feed Import Besitzer\"-Einstellungen, oder kontaktieren Ihren Systemadministrator.", "The report is empty. The filter does not match any of the {{all}} results.": "Der Bericht ist leer. Der Filter passt zu keinem der {{all}} Ergebnisse.", "The scan did not collect any results": "Der Scan hat keine Ergebnisse gesammelt", "The scan is still running and no results have arrived yet": "Der Scan läuft noch und es sind noch keine Ergebnisse eingetroffen", diff --git a/gsa/src/web/pages/reports/detailspage.js b/gsa/src/web/pages/reports/detailspage.js index 1b9ca5e051..2b5e325698 100644 --- a/gsa/src/web/pages/reports/detailspage.js +++ b/gsa/src/web/pages/reports/detailspage.js @@ -269,8 +269,8 @@ class ReportDetails extends React.Component { const noReportFormatError = _( 'The report cannot be displayed because' + ' no Greenbone Vulnerability Manager report format is available.' + - ' This could be due to a missing GVMd data feed. Please update' + - ' the GVMd data feed, check the "feed import owner" setting, or' + + ' This could be due to a missing gvmd data feed. Please update' + + ' the gvmd data feed, check the "feed import owner" setting, or' + ' contact your system administrator.', ); throw new Error(noReportFormatError); From a121118f5eca009657427eea01e30b9ae03c3cd3 Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Fri, 7 Aug 2020 13:09:57 +0200 Subject: [PATCH 21/56] Change the daemon name to lowercase in feedstatuspage.js test. --- gsa/src/web/pages/extras/__tests__/feedstatuspage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js index 60571289fa..8502bbfcd3 100644 --- a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js +++ b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js @@ -51,7 +51,7 @@ const certFeed = new Feed({ }); const gvmdDataFeed = new Feed({ - name: 'Greenbone Community GVMd Data Feed', + name: 'Greenbone Community gvmd Data Feed', type: 'GVMD_DATA', version: 202007221009, currently_syncing: {timestamp: 'foo'}, @@ -156,7 +156,7 @@ describe('Feed status page tests', () => { expect(element).toHaveTextContent('Greenbone Community Feed'); expect(element).toHaveTextContent('Greenbone Community SCAP Feed'); expect(element).toHaveTextContent('Greenbone Community CERT Feed'); - expect(element).toHaveTextContent('Greenbone Community GVMd Data Feed'); + expect(element).toHaveTextContent('Greenbone Community gvmd Data Feed'); // Feed versions expect(element).toHaveTextContent('20200724T1005'); From 4f384d57a1d5220d8ff49dedc600c6c09fdf9617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Fri, 7 Aug 2020 13:28:13 +0200 Subject: [PATCH 22/56] Update links to techdoc and gmp api for 20.08 release Both urls are not available yet but will be in future. --- gsa/src/gmp/gmpsettings.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gsa/src/gmp/gmpsettings.js b/gsa/src/gmp/gmpsettings.js index 0eb73d6ebe..9b597915d6 100644 --- a/gsa/src/gmp/gmpsettings.js +++ b/gsa/src/gmp/gmpsettings.js @@ -20,9 +20,10 @@ import {isDefined} from './utils/identity'; export const DEFAULT_RELOAD_INTERVAL = 15 * 1000; // fifteen seconds export const DEFAULT_RELOAD_INTERVAL_ACTIVE = 3 * 1000; // three seconds export const DEFAULT_RELOAD_INTERVAL_INACTIVE = 60 * 1000; // one minute -export const DEFAULT_MANUAL_URL = 'http://docs.greenbone.net/GSM-Manual/gos-6/'; +export const DEFAULT_MANUAL_URL = + 'http://docs.greenbone.net/GSM-Manual/gos-20.08/'; export const DEFAULT_PROTOCOLDOC_URL = - 'https://docs.greenbone.net/API/GMP/gmp-9.0.html'; + 'https://docs.greenbone.net/API/GMP/gmp-20.08.html'; export const DEFAULT_REPORT_RESULTS_THRESHOLD = 25000; export const DEFAULT_LOG_LEVEL = 'warn'; export const DEFAULT_TIMEOUT = 300000; // 5 minutes From b2359579fc26138955733d619380adf00d0d31a1 Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Mon, 10 Aug 2020 11:25:19 +0200 Subject: [PATCH 23/56] Minor systemd / config files updates: - Mention "daemon" and "gsad" in systemd unit description - Allow to configure a user / group in gsad.default - Rename the "Alias" to "gsad.service" to use a consistent naming scheme for all daemons - Add PIDFile call to systemd unit - Make the EnvironmentFile mandatory --- gsad/config/gsad.default | 20 +++++++++++++++----- gsad/config/gsad.service.in | 9 ++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gsad/config/gsad.default b/gsad/config/gsad.default index 05dfcf66f6..afb3f5ab55 100644 --- a/gsad/config/gsad.default +++ b/gsad/config/gsad.default @@ -1,8 +1,3 @@ -# -# Additional options -# -OPTIONS="" - # # The address the Greenbone Security Assistant daemon will listen on. # @@ -12,3 +7,18 @@ GSA_ADDRESS=127.0.0.1 # The port the Greenbone Security Assistant daemon will listen on. # GSA_PORT=9392 + +# +# The user for running the Greenbone Security Assistant daemon in the gsad.service systemd file +# +GSAD_USER="gvm" + +# +# The group for running the Greenbone Security Assistant daemon in the gsad.service systemd file +# +GSAD_GROUP="gvm" + +# +# Additional options +# +OPTIONS="" diff --git a/gsad/config/gsad.service.in b/gsad/config/gsad.service.in index 89450e10e8..6a1d00bae9 100644 --- a/gsad/config/gsad.service.in +++ b/gsad/config/gsad.service.in @@ -1,16 +1,19 @@ [Unit] -Description=Greenbone Security Assistant +Description=Greenbone Security Assistant daemon (gsad) After=network.target networking.service gvmd.service Documentation=man:gsad(8) ConditionKernelCommandLine=!recovery [Service] Type=forking -EnvironmentFile=-${DEFAULT_CONFIG_DIR}/gsad +User=$GSAD_USER +Group=$GSAD_GROUP +PIDFile=${GVM_RUN_DIR}/gsad.pid +EnvironmentFile=${DEFAULT_CONFIG_DIR}/gsad ExecStart=${SBINDIR}/gsad --listen $GSA_ADDRESS --port $GSA_PORT $OPTIONS Restart=always TimeoutStopSec=10 [Install] WantedBy=multi-user.target -Alias=greenbone-security-assistant.service +Alias=gsad.service From 48a0a6427a8eb0f58a6de4b303d857bbcba59fe1 Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Mon, 10 Aug 2020 11:57:00 +0200 Subject: [PATCH 24/56] Renamed variables. --- gsad/config/gsad.default | 6 +++--- gsad/config/gsad.service.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gsad/config/gsad.default b/gsad/config/gsad.default index afb3f5ab55..529b2d0db6 100644 --- a/gsad/config/gsad.default +++ b/gsad/config/gsad.default @@ -1,12 +1,12 @@ # # The address the Greenbone Security Assistant daemon will listen on. # -GSA_ADDRESS=127.0.0.1 +GSAD_ADDRESS=127.0.0.1 # # The port the Greenbone Security Assistant daemon will listen on. # -GSA_PORT=9392 +GSAD_PORT=9392 # # The user for running the Greenbone Security Assistant daemon in the gsad.service systemd file @@ -21,4 +21,4 @@ GSAD_GROUP="gvm" # # Additional options # -OPTIONS="" +GSAD_OPTIONS="" diff --git a/gsad/config/gsad.service.in b/gsad/config/gsad.service.in index 6a1d00bae9..3045c1f3e4 100644 --- a/gsad/config/gsad.service.in +++ b/gsad/config/gsad.service.in @@ -10,7 +10,7 @@ User=$GSAD_USER Group=$GSAD_GROUP PIDFile=${GVM_RUN_DIR}/gsad.pid EnvironmentFile=${DEFAULT_CONFIG_DIR}/gsad -ExecStart=${SBINDIR}/gsad --listen $GSA_ADDRESS --port $GSA_PORT $OPTIONS +ExecStart=${SBINDIR}/gsad --listen $GSAD_ADDRESS --port $GSAD_PORT $GSAD_OPTIONS Restart=always TimeoutStopSec=10 From f09130f0792a3a8ab1179da22a72df96da1d2bb1 Mon Sep 17 00:00:00 2001 From: cfi-gb <34644702+cfi-gb@users.noreply.github.com> Date: Mon, 10 Aug 2020 15:31:13 +0200 Subject: [PATCH 25/56] Update gsad/config/gsad.service.in --- gsad/config/gsad.service.in | 1 - 1 file changed, 1 deletion(-) diff --git a/gsad/config/gsad.service.in b/gsad/config/gsad.service.in index 3045c1f3e4..3809cbf091 100644 --- a/gsad/config/gsad.service.in +++ b/gsad/config/gsad.service.in @@ -16,4 +16,3 @@ TimeoutStopSec=10 [Install] WantedBy=multi-user.target -Alias=gsad.service From 0182d7ef1016e3054531780e1404b1feb7544093 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Tue, 11 Aug 2020 16:47:42 +0200 Subject: [PATCH 26/56] Prepare Changelog for release --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d15dda28..3012e1eec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [20.08] - unreleased +## [20.08.0] - 2020-08-11 ### Added - Add reload timer to feedstatuspage and displaying when updating is in progress [#2350](https://github.com/greenbone/gsa/pull/2350) @@ -75,7 +75,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Removed "All SecInfo" section [#1685](https://github.com/greenbone/gsa/pull/1685) [#1695](https://github.com/greenbone/gsa/pull/1695) - Removed agents [#1903](https://github.com/greenbone/gsa/pull/1903) -[20.08]: https://github.com/greenbone/gsa/compare/gsa-9.0...master +[20.08]: https://github.com/greenbone/gsa/compare/gsa-9.0...gsa-20.08 ## [9.0.1] - 2020-05-13 From cb8e3fe1ac7283309f25ab6458db9e4271e9487c Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Tue, 11 Aug 2020 16:48:42 +0200 Subject: [PATCH 27/56] Prepare CMakeLists for release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96923dac09..8ad10c7f64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ message ("-- Configuring Greenbone Security Assistant") # VERSION: Set patch version for stable releases, e.g. "9.0.1", # unset patch version for prereleases, e.g. "9.0" project (greenbone-security-assistant - VERSION 20.08) + VERSION 20.08.0) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) From fa0baa6dd80638fdb3de7da0bf68c79dbc8d2e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 11 Aug 2020 16:54:51 +0200 Subject: [PATCH 28/56] Update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3012e1eec6..3e12f2d7f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [20.08.0] - 2020-08-11 ### Added -- Add reload timer to feedstatuspage and displaying when updating is in progress [#2350](https://github.com/greenbone/gsa/pull/2350) -- Add filtered links to GVMD_DATA row in feed status page [#2339](https://github.com/greenbone/gsa/pull/2339) +- Added reload timer to feedstatuspage and displaying when updating is in progress [#2350](https://github.com/greenbone/gsa/pull/2350) +- Added filtered links to GVMD_DATA row in feed status page [#2339](https://github.com/greenbone/gsa/pull/2339) - Added loading indicator for CVEs on CPE detailspage [#2248](https://github.com/greenbone/gsa/pull/2248) - Added new form validation feature, implemented on create and edit ticket dialog [#1782](https://github.com/greenbone/gsa/pull/1782) - Added German translation for About page [#1998](https://github.com/greenbone/gsa/pull/1998) From d764d57d964d2fe0f5acea3776312a46a992bae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 11 Aug 2020 16:55:22 +0200 Subject: [PATCH 29/56] Prepare 20.08.0 release of GSA cmake doesn't support a .0X version schema. Therefore it 20.8 must be used instead. --- CHANGELOG.md | 2 +- CMakeLists.txt | 4 ++-- gsa/CMakeLists.txt | 2 +- gsa/package.json | 2 +- gsad/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e12f2d7f3..ee66734fdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Removed "All SecInfo" section [#1685](https://github.com/greenbone/gsa/pull/1685) [#1695](https://github.com/greenbone/gsa/pull/1695) - Removed agents [#1903](https://github.com/greenbone/gsa/pull/1903) -[20.08]: https://github.com/greenbone/gsa/compare/gsa-9.0...gsa-20.08 +[20.08]: https://github.com/greenbone/gsa/compare/gsa-9.0...v20.8.0 ## [9.0.1] - 2020-05-13 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ad10c7f64..9ce469aa9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ message ("-- Configuring Greenbone Security Assistant") # VERSION: Set patch version for stable releases, e.g. "9.0.1", # unset patch version for prereleases, e.g. "9.0" project (greenbone-security-assistant - VERSION 20.08.0) + VERSION 20.8.0) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) @@ -32,7 +32,7 @@ endif (NOT CMAKE_BUILD_TYPE) # set if this is in prerelease status, starting at 0 before first beta release, # unset if this is a stable release series. -set (PROJECT_BETA_RELEASE 0) +# set (PROJECT_BETA_RELEASE 0) ## Retrieve git revision (at configure time) include (ProjectVersion) diff --git a/gsa/CMakeLists.txt b/gsa/CMakeLists.txt index db597d390b..7d99b67756 100644 --- a/gsa/CMakeLists.txt +++ b/gsa/CMakeLists.txt @@ -19,7 +19,7 @@ cmake_minimum_required (VERSION 3.0) message ("-- Configuring gsa") -project (gsa VERSION 20.08 LANGUAGES) +project (gsa VERSION 20.8.0 LANGUAGES) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) diff --git a/gsa/package.json b/gsa/package.json index f3143b3f8f..b5bb119a93 100644 --- a/gsa/package.json +++ b/gsa/package.json @@ -1,6 +1,6 @@ { "name": "gsa", - "version": "20.08", + "version": "20.08.0", "description": "Greenbone Security Assistant", "keywords": [ "openvas", diff --git a/gsad/CMakeLists.txt b/gsad/CMakeLists.txt index 233bf1a513..21719bd3b7 100644 --- a/gsad/CMakeLists.txt +++ b/gsad/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required (VERSION 3.0) message ("-- Configuring gsad") -project (gsad VERSION 20.08 LANGUAGES C) +project (gsad VERSION 20.8.0 LANGUAGES C) if (NOT DEFINED PROJECT_VERSION_STRING) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) From 22cf9006ae98b93ae16730da974c571ac972736d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 11 Aug 2020 17:11:24 +0200 Subject: [PATCH 30/56] Update license of GSA in package.json file We switched to AGPLv3+ now. --- gsa/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsa/package.json b/gsa/package.json index b5bb119a93..d8f4db465c 100644 --- a/gsa/package.json +++ b/gsa/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/greenbone/gsa/" }, "author": "Björn Ricks ", - "license": "GPL-2.0+", + "license": "AGPL-3.0+", "main": "src/index.js", "engines": { "node": ">=10.0" From a115fe1fccc0122ffb17002cc233cd246207690e Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Tue, 11 Aug 2020 17:39:16 +0200 Subject: [PATCH 31/56] Update Changelog for new unreleased release --- CHANGELOG.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee66734fdd..9d76564a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [20.08.0] - 2020-08-11 +## [21.04] - unreleased + +### Added + +### Changed + +### Fixed + +### Removed + +[21.04]: https://github.com/greenbone/gsa/compare/v20.8.0...master + +## [20.8.0] - 2020-08-11 ### Added - Added reload timer to feedstatuspage and displaying when updating is in progress [#2350](https://github.com/greenbone/gsa/pull/2350) @@ -75,7 +87,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Removed "All SecInfo" section [#1685](https://github.com/greenbone/gsa/pull/1685) [#1695](https://github.com/greenbone/gsa/pull/1695) - Removed agents [#1903](https://github.com/greenbone/gsa/pull/1903) -[20.08]: https://github.com/greenbone/gsa/compare/gsa-9.0...v20.8.0 +[20.8.0]: https://github.com/greenbone/gsa/compare/gsa-9.0...v20.8.0 ## [9.0.1] - 2020-05-13 From 15d85d8255bc92976c807c5e16d8ad004ed888d4 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp <32056637+swaterkamp@users.noreply.github.com> Date: Tue, 11 Aug 2020 17:44:27 +0200 Subject: [PATCH 32/56] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Björn Ricks --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d76564a3f..750cf40619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [21.04] - unreleased +## [20.8.1] - unreleased ### Added From 2e94057145d251b647815d0bb53c9fbf6b413ab9 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp <32056637+swaterkamp@users.noreply.github.com> Date: Tue, 11 Aug 2020 17:44:39 +0200 Subject: [PATCH 33/56] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Björn Ricks --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 750cf40619..637db31129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Removed -[21.04]: https://github.com/greenbone/gsa/compare/v20.8.0...master +[20.8.1]: https://github.com/greenbone/gsa/compare/v20.8.0...gsa-20.08 ## [20.8.0] - 2020-08-11 From fa423e812c61d07abe743a9061d441c9703d97fe Mon Sep 17 00:00:00 2001 From: Sarah Diedrich Date: Fri, 14 Aug 2020 13:57:41 +0200 Subject: [PATCH 34/56] fix missing nvt solution type --- gsa/src/gmp/models/nvt.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gsa/src/gmp/models/nvt.js b/gsa/src/gmp/models/nvt.js index 6fe3165876..7438b2cb12 100644 --- a/gsa/src/gmp/models/nvt.js +++ b/gsa/src/gmp/models/nvt.js @@ -136,11 +136,11 @@ class Nvt extends Info { getFilteredRefs(refs, 'cert-bund'), ); - if (isDefined(element.solution)) { + if (isDefined(ret.solution)) { ret.solution = { - type: element.solution._type, - description: element.solution.__text, - method: element.solution._method, + type: ret.solution._type, + description: ret.solution.__text, + method: ret.solution._method, }; } From 3b9aa5fd061e1b50ac63658a1b7f6d2841ff6a45 Mon Sep 17 00:00:00 2001 From: Sarah Diedrich Date: Fri, 14 Aug 2020 14:04:21 +0200 Subject: [PATCH 35/56] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 637db31129..d7f7790ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Deleting a single entity now removes its ID from store [#1839](https://github.com/greenbone/gsa/pull/1839) ### Fixed +- Fixed missing NVT solution [#2388](https://github.com/greenbone/gsa/pull/2388) - EmptyResultsReport uses the same counts as the results tab title in normal reports, when filtering for nonexistent results [#2335](https://github.com/greenbone/gsa/pull/2335), [#2365](https://github.com/greenbone/gsa/pull/2365) - Show proper error message on report detailspage when no report format is available [#2367](https://github.com/greenbone/gsa/pull/2367) From 8a303f5fc6cc005a7cec98d066e8e1301bafcbf4 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 08:46:08 +0200 Subject: [PATCH 36/56] Use text indicator when feed is updating --- gsa/src/web/pages/extras/feedstatuspage.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/gsa/src/web/pages/extras/feedstatuspage.js b/gsa/src/web/pages/extras/feedstatuspage.js index 9ade999e69..b7ca0a2bba 100644 --- a/gsa/src/web/pages/extras/feedstatuspage.js +++ b/gsa/src/web/pages/extras/feedstatuspage.js @@ -85,16 +85,7 @@ const renderCheck = feed => { const renderFeedStatus = feed => { if (hasValue(feed.currentlySyncing)) { - return ( - - {_('Loading - - ); + return _('Update in progress...'); } const age = parseInt(feed.age.asDays()); From d76af5cab22fc0e7c17709b57c14d3cbe2490a83 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 10:39:00 +0200 Subject: [PATCH 37/56] Adjust test for new loading text --- gsa/src/web/pages/extras/__tests__/feedstatuspage.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js index 8502bbfcd3..42b8b2e1ff 100644 --- a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js +++ b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js @@ -79,7 +79,7 @@ const gmp = { describe('Feed status page tests', () => { test('should render', async () => { const {render} = rendererWith({gmp, router: true}); - const {element, getAllByTestId, getByTestId} = render(); + const {element, getAllByTestId} = render(); await wait(); @@ -172,12 +172,7 @@ describe('Feed status page tests', () => { expect(ageText[0]).toHaveTextContent('Current'); expect(ageText[1]).toHaveTextContent('2 days old'); expect(ageText[2]).toHaveTextContent('Current'); - - const loadingIndicator = getByTestId('loading-indicator'); - - expect(loadingIndicator).toHaveAttribute('title', 'Update in progress'); - expect(loadingIndicator).toHaveAttribute('src', '/img/loading.gif'); - expect(loadingIndicator).toHaveAttribute('alt', 'Loading Indicator'); + expect(ageText[3]).toHaveTextContent('Update in progress...'); }); }); From 5d60c0e42e89452534c31a9a3c039195725c8a65 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 11:36:06 +0200 Subject: [PATCH 38/56] Update german translation --- gsa/public/locales/gsa-de.json | 1 + 1 file changed, 1 insertion(+) diff --git a/gsa/public/locales/gsa-de.json b/gsa/public/locales/gsa-de.json index fbb7467ccb..3134916a2a 100644 --- a/gsa/public/locales/gsa-de.json +++ b/gsa/public/locales/gsa-de.json @@ -1759,6 +1759,7 @@ "Unreliable rem. banner": "Unzuverlässiger Banner", "Update": "Aktualisieren", "Update Filter": "Filter aktualisieren", + "Update in progress...": "Aktualisierung läuft...", "Updated": "Aktualisiert", "Updated {{secinfo_type}} arrived": "Aktualisierte {{secinfo_type}} eingetroffen", "Updated: ": "Aktualisiert: ", From 7cc60cc4345f0914b57bc4bac506dd4c9a0fc30a Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 11:22:21 +0200 Subject: [PATCH 39/56] Increase age for feed being too old and display Please check automatic synchronization... message --- gsa/src/web/pages/extras/feedstatuspage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsa/src/web/pages/extras/feedstatuspage.js b/gsa/src/web/pages/extras/feedstatuspage.js index b7ca0a2bba..482c66af01 100644 --- a/gsa/src/web/pages/extras/feedstatuspage.js +++ b/gsa/src/web/pages/extras/feedstatuspage.js @@ -78,7 +78,7 @@ const ToolBarIcons = () => ( const renderCheck = feed => { const age = feed.age.asDays(); - return age >= 10 + return age >= 30 && !hasValue(feed.currentlySyncing) ? _('Please check the automatic synchronization of your system.') : ''; }; @@ -90,7 +90,7 @@ const renderFeedStatus = feed => { const age = parseInt(feed.age.asDays()); - if (age >= 10) { + if (age >= 30) { return _('Too old ({{age}} days)', {age}); } From 3622444237a5f95afeb6690aafb5668737d679af Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 12:31:19 +0200 Subject: [PATCH 40/56] Add data-testid for update message --- gsa/src/web/pages/extras/feedstatuspage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsa/src/web/pages/extras/feedstatuspage.js b/gsa/src/web/pages/extras/feedstatuspage.js index 482c66af01..a7c273d1dc 100644 --- a/gsa/src/web/pages/extras/feedstatuspage.js +++ b/gsa/src/web/pages/extras/feedstatuspage.js @@ -251,7 +251,7 @@ const FeedStatus = ({feeds}) => { {renderFeedStatus(feed)} - {renderCheck(feed)} + {renderCheck(feed)} From f13e884fc50f240ad873eedb51b923601493ce96 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 12:31:37 +0200 Subject: [PATCH 41/56] Adjust feedstatuspage test to make sure update message is only rendered when appropriate --- .../pages/extras/__tests__/feedstatuspage.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js index 42b8b2e1ff..885c3c7d2f 100644 --- a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js +++ b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js @@ -47,13 +47,13 @@ const scapFeed = new Feed({ const certFeed = new Feed({ name: 'Greenbone Community CERT Feed', type: 'CERT', - version: 202007231003, + version: 202005231003, }); const gvmdDataFeed = new Feed({ name: 'Greenbone Community gvmd Data Feed', type: 'GVMD_DATA', - version: 202007221009, + version: 202006221009, currently_syncing: {timestamp: 'foo'}, }); @@ -161,18 +161,33 @@ describe('Feed status page tests', () => { // Feed versions expect(element).toHaveTextContent('20200724T1005'); expect(element).toHaveTextContent('20200723T0130'); - expect(element).toHaveTextContent('20200723T1003'); - expect(element).toHaveTextContent('20200722T1009'); + expect(element).toHaveTextContent('20200523T1003'); + expect(element).toHaveTextContent('20200622T1009'); // Feed Status const ageText = element.querySelectorAll('strong'); + const updateMsgs = getAllByTestId('update-msg'); expect(ageText.length).toEqual(4); + expect(updateMsgs.length).toEqual(4); + + // Not too old and not currently syncing expect(ageText[0]).toHaveTextContent('Current'); + expect(updateMsgs[0]).toHaveTextContent(''); + expect(ageText[1]).toHaveTextContent('2 days old'); - expect(ageText[2]).toHaveTextContent('Current'); + expect(updateMsgs[1]).toHaveTextContent(''); + + // CERT feed is too old but is not currently syncing + expect(ageText[2]).toHaveTextContent('Too old (62 days)'); + expect(updateMsgs[2]).toHaveTextContent( + 'Please check the automatic synchronization of your system.', + ); + + // GVMD_DATA feed is too old but IS currently syncing expect(ageText[3]).toHaveTextContent('Update in progress...'); + expect(updateMsgs[3]).toHaveTextContent(''); }); }); From 17e870b60ad7e8621e34c25dc50d76a865daa792 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Mon, 17 Aug 2020 12:38:47 +0200 Subject: [PATCH 42/56] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7f7790ae5..78e0fcbce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added handling of queued task status [#2208](https://github.com/greenbone/gsa/pull/2208) ### Changed +- Increase age for feed being too old [#2394](https://github.com/greenbone/gsa/pull/2394) - Do not use result filter from store on report detailspage by default [#2358](https://github.com/greenbone/gsa/pull/2358) - Improve performance of form fields in edit scan config dialog [#2354](https://github.com/greenbone/gsa/pull/2354) - Default to sorting nvts by "Created", newest first [#2352](https://github.com/greenbone/gsa/pull/2352) From 5b6dade67af605f3059943eb8da5aee02a3a9085 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 17 Aug 2020 17:12:01 +0200 Subject: [PATCH 43/56] Disable editing feed objects according to .predefined --- gsa/src/web/pages/policies/detailspage.js | 4 +--- gsa/src/web/pages/policies/row.js | 4 +--- gsa/src/web/pages/portlists/detailspage.js | 4 +--- gsa/src/web/pages/portlists/row.js | 4 +--- gsa/src/web/pages/reportformats/detailspage.js | 4 +--- gsa/src/web/pages/reportformats/row.js | 4 +--- gsa/src/web/pages/scanconfigs/detailspage.js | 4 +--- gsa/src/web/pages/scanconfigs/row.js | 4 +--- 8 files changed, 8 insertions(+), 24 deletions(-) diff --git a/gsa/src/web/pages/policies/detailspage.js b/gsa/src/web/pages/policies/detailspage.js index 2084fadc59..12b2711d2f 100644 --- a/gsa/src/web/pages/policies/detailspage.js +++ b/gsa/src/web/pages/policies/detailspage.js @@ -50,8 +50,6 @@ import CloneIcon from 'web/entity/icon/cloneicon'; import EditIcon from 'web/entity/icon/editicon'; import TrashIcon from 'web/entity/icon/trashicon'; -import {COMPLIANCE_POLICIES_FROM_FEED} from 'web/pages/extras/feedstatuspage'; - import {selector, loadEntity} from 'web/store/entities/policies'; import { @@ -96,7 +94,7 @@ export const ToolBarIcons = withCapabilities( onClick={onPolicyCloneClick} /> diff --git a/gsa/src/web/pages/portlists/row.js b/gsa/src/web/pages/portlists/row.js index 38c8ff1faf..1a05d545e2 100644 --- a/gsa/src/web/pages/portlists/row.js +++ b/gsa/src/web/pages/portlists/row.js @@ -38,8 +38,6 @@ import IconDivider from 'web/components/layout/icondivider'; import TableData from 'web/components/table/data'; import TableRow from 'web/components/table/row'; -import {PORT_LISTS_FROM_FEED} from 'web/pages/extras/feedstatuspage'; - const IconActions = ({ entity, onPortListDeleteClick, @@ -56,7 +54,7 @@ const IconActions = ({ /> diff --git a/gsa/src/web/pages/reportformats/row.js b/gsa/src/web/pages/reportformats/row.js index d7d39516ac..24d7ab51c4 100644 --- a/gsa/src/web/pages/reportformats/row.js +++ b/gsa/src/web/pages/reportformats/row.js @@ -42,8 +42,6 @@ import {renderYesNo} from 'web/utils/render'; import withCapabilities from 'web/utils/withCapabilities'; import withEntitiesActions from 'web/entities/withEntitiesActions'; -import {REPORT_FORMATS_FROM_FEED} from 'web/pages/extras/feedstatuspage'; - const Actions = compose( withCapabilities, withEntitiesActions, @@ -64,7 +62,7 @@ const Actions = compose( /> diff --git a/gsa/src/web/pages/scanconfigs/row.js b/gsa/src/web/pages/scanconfigs/row.js index dfa002bd1f..9c2dee3e81 100644 --- a/gsa/src/web/pages/scanconfigs/row.js +++ b/gsa/src/web/pages/scanconfigs/row.js @@ -38,8 +38,6 @@ import CloneIcon from 'web/entity/icon/cloneicon'; import EditIcon from 'web/entity/icon/editicon'; import TrashIcon from 'web/entity/icon/trashicon'; -import {SCAN_CONFIGS_FROM_FEED} from 'web/pages/extras/feedstatuspage'; - import PropTypes from 'web/utils/proptypes'; import {na} from 'web/utils/render'; @@ -62,7 +60,7 @@ const ScanConfigActions = withEntitiesActions( /> Date: Mon, 17 Aug 2020 17:12:53 +0200 Subject: [PATCH 44/56] Parse [feedObject].predefined as boolean --- gsa/src/gmp/models/policy.js | 4 +++- gsa/src/gmp/models/portlist.js | 5 ++++- gsa/src/gmp/models/reportformat.js | 3 ++- gsa/src/gmp/models/scanconfig.js | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gsa/src/gmp/models/policy.js b/gsa/src/gmp/models/policy.js index ab2c3d6a41..5573b2ff9f 100644 --- a/gsa/src/gmp/models/policy.js +++ b/gsa/src/gmp/models/policy.js @@ -20,7 +20,7 @@ import {isDefined} from '../utils/identity'; import {forEach, map} from '../utils/array'; import {isEmpty} from '../utils/string'; -import {parseInt} from '../parser'; +import {parseInt, parseBoolean} from '../parser'; import Model, {parseModelFromElement} from '../model'; @@ -130,6 +130,8 @@ class Policy extends Model { ret.audits = []; } + ret.predefined = parseBoolean(element.predefined); + return ret; } } diff --git a/gsa/src/gmp/models/portlist.js b/gsa/src/gmp/models/portlist.js index 70c3080def..f480d4aaf8 100644 --- a/gsa/src/gmp/models/portlist.js +++ b/gsa/src/gmp/models/portlist.js @@ -20,7 +20,7 @@ import {map} from '../utils/array'; import Model, {parseModelFromElement} from '../model'; -import {parseInt} from '../parser'; +import {parseInt, parseBoolean} from '../parser'; class PortRange extends Model { static entityType = 'portrange'; @@ -71,6 +71,9 @@ class PortList extends Model { } else { ret.targets = []; } + + ret.predefined = parseBoolean(element.predefined); + return ret; } } diff --git a/gsa/src/gmp/models/reportformat.js b/gsa/src/gmp/models/reportformat.js index 7da2267fcd..809b0c014e 100644 --- a/gsa/src/gmp/models/reportformat.js +++ b/gsa/src/gmp/models/reportformat.js @@ -19,7 +19,7 @@ import {isDefined, isObject} from '../utils/identity'; import {map} from '../utils/array'; import {isEmpty} from '../utils/string'; -import {parseDate, parseYesNo, YES_VALUE} from '../parser'; +import {parseDate, parseYesNo, YES_VALUE, parseBoolean} from '../parser'; import Model, {parseModelFromElement} from '../model'; @@ -84,6 +84,7 @@ class ReportFormat extends Model { } ret.active = parseYesNo(element.active); + ret.predefined = parseBoolean(element.predefined); return ret; } diff --git a/gsa/src/gmp/models/scanconfig.js b/gsa/src/gmp/models/scanconfig.js index 99f3d3c09a..987f867c99 100644 --- a/gsa/src/gmp/models/scanconfig.js +++ b/gsa/src/gmp/models/scanconfig.js @@ -20,7 +20,7 @@ import {isDefined} from '../utils/identity'; import {forEach, map} from '../utils/array'; import {isEmpty} from '../utils/string'; -import {parseInt} from '../parser'; +import {parseInt, parseBoolean} from '../parser'; import Model, {parseModelFromElement} from '../model'; @@ -167,6 +167,8 @@ class ScanConfig extends Model { ret.tasks = []; } + ret.predefined = parseBoolean(element.predefined); + return ret; } } From 6f2d9a1a952f1352278e72e3b15f4686a5d26c57 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 17 Aug 2020 17:13:15 +0200 Subject: [PATCH 45/56] Add tests for [feedObject].predefined --- gsa/src/gmp/models/__tests__/policy.js | 8 ++++++++ gsa/src/gmp/models/__tests__/portlist.js | 8 ++++++++ gsa/src/gmp/models/__tests__/reportformat.js | 8 ++++++++ gsa/src/gmp/models/__tests__/scanconfig.js | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/gsa/src/gmp/models/__tests__/policy.js b/gsa/src/gmp/models/__tests__/policy.js index 34aab9f38e..298b9fda0c 100644 --- a/gsa/src/gmp/models/__tests__/policy.js +++ b/gsa/src/gmp/models/__tests__/policy.js @@ -246,6 +246,14 @@ describe('Policy model tests', () => { expect(policy.audits).toEqual([]); }); + + test('should parse predefined as yes/no correctly', () => { + const policy = Policy.fromElement({predefined: '0'}); + const policy2 = Policy.fromElement({predefined: '1'}); + + expect(policy.predefined).toEqual(false); + expect(policy2.predefined).toEqual(true); + }); }); // vim: set ts=2 sw=2 tw=80: diff --git a/gsa/src/gmp/models/__tests__/portlist.js b/gsa/src/gmp/models/__tests__/portlist.js index c5538e0149..07c7697652 100644 --- a/gsa/src/gmp/models/__tests__/portlist.js +++ b/gsa/src/gmp/models/__tests__/portlist.js @@ -108,6 +108,14 @@ describe('PortList model tests', () => { expect(portList.targets).toEqual([]); }); + + test('should parse predefined as boolean correctly', () => { + const portList = PortList.fromElement({predefined: '0'}); + const portList2 = PortList.fromElement({predefined: '1'}); + + expect(portList.predefined).toEqual(false); + expect(portList2.predefined).toEqual(true); + }); }); // vim: set ts=2 sw=2 tw=80: diff --git a/gsa/src/gmp/models/__tests__/reportformat.js b/gsa/src/gmp/models/__tests__/reportformat.js index 3361915397..47de91f4fe 100644 --- a/gsa/src/gmp/models/__tests__/reportformat.js +++ b/gsa/src/gmp/models/__tests__/reportformat.js @@ -64,6 +64,14 @@ describe('ReportFormat model tests', () => { expect(reportFormat2.active).toEqual(YES_VALUE); }); + test('should parse predefined as boolean correctly', () => { + const reportFormat = ReportFormat.fromElement({predefined: '0'}); + const reportFormat2 = ReportFormat.fromElement({predefined: '1'}); + + expect(reportFormat.predefined).toEqual(false); + expect(reportFormat2.predefined).toEqual(true); + }); + test('should parse alerts', () => { const elem = { alerts: { diff --git a/gsa/src/gmp/models/__tests__/scanconfig.js b/gsa/src/gmp/models/__tests__/scanconfig.js index fc2aebbcf0..ef6519f7df 100644 --- a/gsa/src/gmp/models/__tests__/scanconfig.js +++ b/gsa/src/gmp/models/__tests__/scanconfig.js @@ -250,6 +250,14 @@ describe('ScanConfig model tests', () => { expect(scanConfig.tasks).toEqual([]); }); + + test('should parse predefined as boolean correctly', () => { + const scanConfig = ScanConfig.fromElement({predefined: '0'}); + const scanConfig2 = ScanConfig.fromElement({predefined: '1'}); + + expect(scanConfig.predefined).toEqual(false); + expect(scanConfig2.predefined).toEqual(true); + }); }); describe('ScanConfigs model function test', () => { From 7cbe05dea528f4c2542f76eaa04570f5cf246174 Mon Sep 17 00:00:00 2001 From: Sarah Diedrich Date: Tue, 18 Aug 2020 16:44:27 +0200 Subject: [PATCH 46/56] fix missing oval def subsections --- gsa/src/gmp/models/ovaldef.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsa/src/gmp/models/ovaldef.js b/gsa/src/gmp/models/ovaldef.js index 2b408b5755..cf39e7fdc6 100644 --- a/gsa/src/gmp/models/ovaldef.js +++ b/gsa/src/gmp/models/ovaldef.js @@ -75,10 +75,10 @@ class Ovaldef extends Info { static parseElement(element) { const ret = super.parseElement(element, 'ovaldef'); - ret.severity = parseSeverity(element.max_cvss); + ret.severity = parseSeverity(ret.max_cvss); delete ret.max_cvss; - const {raw_data} = element; + const {raw_data} = ret; if (isDefined(raw_data) && isDefined(raw_data.definition)) { const {definition} = raw_data; From 186608df8088841ea479ad4ecb08296bed9deec4 Mon Sep 17 00:00:00 2001 From: Sarah Diedrich Date: Tue, 18 Aug 2020 16:51:55 +0200 Subject: [PATCH 47/56] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78e0fcbce9..0bd505438c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Deleting a single entity now removes its ID from store [#1839](https://github.com/greenbone/gsa/pull/1839) ### Fixed +- Fixed empty subsections on oval def details page [#2396](https://github.com/greenbone/gsa/pull/2396) - Fixed missing NVT solution [#2388](https://github.com/greenbone/gsa/pull/2388) - EmptyResultsReport uses the same counts as the results tab title in normal reports, when filtering for nonexistent results [#2335](https://github.com/greenbone/gsa/pull/2335), [#2365](https://github.com/greenbone/gsa/pull/2365) From c225ec05a3705dcba8eaeaea0645dc929e24fe8f Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Wed, 19 Aug 2020 12:14:52 +0200 Subject: [PATCH 48/56] Use predefined filter keyword instead of list of UUIDs --- gsa/src/web/pages/extras/feedstatuspage.js | 28 ++++------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/gsa/src/web/pages/extras/feedstatuspage.js b/gsa/src/web/pages/extras/feedstatuspage.js index a7c273d1dc..aa5b6a7a72 100644 --- a/gsa/src/web/pages/extras/feedstatuspage.js +++ b/gsa/src/web/pages/extras/feedstatuspage.js @@ -128,14 +128,6 @@ export const SCAN_CONFIGS_FROM_FEED = [ 'bbca7412-a950-11e3-9109-406186ea4fc5', // System Discovery ]; -export const composeObjFilter = (objectIds = []) => { - let filterString = ''; - - objectIds.forEach(id => (filterString += 'uuid=' + id + ' ')); - - return filterString; -}; - const FeedStatus = ({feeds}) => { return ( @@ -207,37 +199,25 @@ const FeedStatus = ({feeds}) => { )} {feed.feed_type === GVMD_DATA_FEED && ( - + {_('Compliance Policies')} - + {_('Port Lists')} - + {_('Report Formats')} - + {_('Scan Configs')} From 664767fa598aa16ca628ca24755709c626c23d63 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Wed, 19 Aug 2020 12:19:49 +0200 Subject: [PATCH 49/56] Adjust tests for composeObjFilter() and new predefined filter keyword --- .../pages/extras/__tests__/feedstatuspage.js | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js index 885c3c7d2f..10a4757a96 100644 --- a/gsa/src/web/pages/extras/__tests__/feedstatuspage.js +++ b/gsa/src/web/pages/extras/__tests__/feedstatuspage.js @@ -19,7 +19,7 @@ import React from 'react'; import {rendererWith, wait} from 'web/utils/testing'; -import FeedStatus, {composeObjFilter} from '../feedstatuspage'; +import FeedStatus from '../feedstatuspage'; import {Feed} from 'gmp/commands/feedstatus'; import Response from 'gmp/http/response'; @@ -118,21 +118,18 @@ describe('Feed status page tests', () => { expect(links[4]).toHaveAttribute('href', '/ovaldefs'); expect(links[5]).toHaveAttribute('href', '/certbunds'); expect(links[6]).toHaveAttribute('href', '/dfncerts'); - expect(links[7]).toHaveAttribute( - 'href', - '/policies?filter=uuid%3Dc4b7c0cb-6502-4809-b034-8e635311b3e6%20', - ); + expect(links[7]).toHaveAttribute('href', '/policies?filter=predefined%3D1'); expect(links[8]).toHaveAttribute( 'href', - '/portlists?filter=uuid%3D33d0cd82-57c6-11e1-8ed1-406186ea4fc5%20uuid%3D4a4717fe-57d2-11e1-9a26-406186ea4fc5%20uuid%3D730ef368-57e2-11e1-a90f-406186ea4fc5%20', + '/portlists?filter=predefined%3D1', ); expect(links[9]).toHaveAttribute( 'href', - '/reportformats?filter=uuid%3D5057e5cc-b825-11e4-9d0e-28d24461215b%20uuid%3Dc1645568-627a-11e3-a660-406186ea4fc5%20uuid%3D77bd6c4a-1f62-11e1-abf0-406186ea4fc5%20uuid%3Dc402cc3e-b531-11e1-9163-406186ea4fc5%20uuid%3Da3810a62-1f62-11e1-9219-406186ea4fc5%20uuid%3Da994b278-1f62-11e1-96ac-406186ea4fc5%20', + '/reportformats?filter=predefined%3D1', ); expect(links[10]).toHaveAttribute( 'href', - '/scanconfigs?filter=uuid%3Dd21f6c81-2b88-4ac1-b7b4-a2a9f2ad4663%20uuid%3D8715c877-47a0-438d-98a3-27c7a6ab2196%20uuid%3D085569ce-73ed-11df-83c3-002264764cea%20uuid%3Ddaba56c8-73ec-11df-a475-002264764cea%20uuid%3D2d3f051c-55ba-11e3-bf43-406186ea4fc5%20uuid%3Dbbca7412-a950-11e3-9109-406186ea4fc5%20', + '/scanconfigs?filter=predefined%3D1', ); // Test headers @@ -191,22 +188,5 @@ describe('Feed status page tests', () => { }); }); -describe('Test uuid filter composer', () => { - test('Should return empty string for empty array', () => { - const emptyFilter = composeObjFilter([]); - expect(emptyFilter).toEqual(''); - }); - - test('Should not crash on undefined input', () => { - const noFilter = composeObjFilter(); - expect(noFilter).toEqual(''); - }); - - test('Should return correct filter string', () => { - const filterString = composeObjFilter(['foo', 'bar', 'baz']); - expect(filterString).toEqual('uuid=foo uuid=bar uuid=baz '); - }); -}); - // restore overwritten method global.Date.now = _now; From c0f24911c68e53c344332e88fa40900d1e5c9ea2 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Wed, 19 Aug 2020 12:21:33 +0200 Subject: [PATCH 50/56] Remove unused manual feed object UUID lists from FeedStatusPage --- gsa/src/web/pages/extras/feedstatuspage.js | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/gsa/src/web/pages/extras/feedstatuspage.js b/gsa/src/web/pages/extras/feedstatuspage.js index aa5b6a7a72..fe99886c01 100644 --- a/gsa/src/web/pages/extras/feedstatuspage.js +++ b/gsa/src/web/pages/extras/feedstatuspage.js @@ -100,34 +100,6 @@ const renderFeedStatus = feed => { return _('Current'); }; -export const COMPLIANCE_POLICIES_FROM_FEED = [ - 'c4b7c0cb-6502-4809-b034-8e635311b3e6', // IT-Grundschutz -]; - -export const PORT_LISTS_FROM_FEED = [ - '33d0cd82-57c6-11e1-8ed1-406186ea4fc5', // All IANA assigned TCP - '4a4717fe-57d2-11e1-9a26-406186ea4fc5', // All IANA assigned TCP and UDP - '730ef368-57e2-11e1-a90f-406186ea4fc5', // All TCP and Nmap top 100 UDP -]; - -export const REPORT_FORMATS_FROM_FEED = [ - '5057e5cc-b825-11e4-9d0e-28d24461215b', // Anonymous XML - 'c1645568-627a-11e3-a660-406186ea4fc5', // CSV Results - '77bd6c4a-1f62-11e1-abf0-406186ea4fc5', // ITG - 'c402cc3e-b531-11e1-9163-406186ea4fc5', // PDF - 'a3810a62-1f62-11e1-9219-406186ea4fc5', // TXT - 'a994b278-1f62-11e1-96ac-406186ea4fc5', // XML -]; - -export const SCAN_CONFIGS_FROM_FEED = [ - 'd21f6c81-2b88-4ac1-b7b4-a2a9f2ad4663', // Base - '8715c877-47a0-438d-98a3-27c7a6ab2196', // Discovery - '085569ce-73ed-11df-83c3-002264764cea', // empty - 'daba56c8-73ec-11df-a475-002264764cea', // Full and fast - '2d3f051c-55ba-11e3-bf43-406186ea4fc5', // Host Discovery - 'bbca7412-a950-11e3-9109-406186ea4fc5', // System Discovery -]; - const FeedStatus = ({feeds}) => { return ( From 0e83447d5f4f1f21e97e64b238301393416029d3 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Wed, 19 Aug 2020 12:23:46 +0200 Subject: [PATCH 51/56] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78e0fcbce9..754c3ce823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added ### Changed +- Use to disable feed object editing and filter creation on feed status page [#2398](https://github.com/greenbone/gsa/pull/2398) ### Fixed From 7e6dd1cd2691fc661d7f5e829bfd3981256e0258 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Wed, 19 Aug 2020 12:26:15 +0200 Subject: [PATCH 52/56] Fix test name for policy model test --- gsa/src/gmp/models/__tests__/policy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsa/src/gmp/models/__tests__/policy.js b/gsa/src/gmp/models/__tests__/policy.js index 298b9fda0c..403f1cc08a 100644 --- a/gsa/src/gmp/models/__tests__/policy.js +++ b/gsa/src/gmp/models/__tests__/policy.js @@ -247,7 +247,7 @@ describe('Policy model tests', () => { expect(policy.audits).toEqual([]); }); - test('should parse predefined as yes/no correctly', () => { + test('should parse predefined as boolean correctly', () => { const policy = Policy.fromElement({predefined: '0'}); const policy2 = Policy.fromElement({predefined: '1'}); From 04d47297ddfe26da21a28d28b4cb3d3682bab982 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 24 Aug 2020 14:53:21 +0200 Subject: [PATCH 53/56] Allow to select 'Start Task' event on 'New SecInfo' condition for alerts --- gsa/src/web/pages/alerts/dialog.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsa/src/web/pages/alerts/dialog.js b/gsa/src/web/pages/alerts/dialog.js index 95ceebd169..3d7c9d4215 100644 --- a/gsa/src/web/pages/alerts/dialog.js +++ b/gsa/src/web/pages/alerts/dialog.js @@ -437,6 +437,10 @@ class AlertDialog extends React.Component { value: METHOD_TYPE_SNMP, label: _('SNMP'), }, + { + value: METHOD_TYPE_START_TASK, + label: _('Start Task'), + }, { value: METHOD_TYPE_SYSLOG, label: _('System Logger'), From 98ce261e15ef269d691dd65875a9f233f790c061 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Mon, 24 Aug 2020 14:57:57 +0200 Subject: [PATCH 54/56] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0afa8965a8..11abe67210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [20.8.1] - unreleased ### Added +- Added option for "Start Task" event upon "New SecInfo arrived" condition in alerts dialog [#2418](https://github.com/greenbone/gsa/pull/2418) ### Changed - Use to disable feed object editing and filter creation on feed status page [#2398](https://github.com/greenbone/gsa/pull/2398) From daa0f8c28a619ba9cda056ef994dead2d32f8f48 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Thu, 27 Aug 2020 14:24:52 +0200 Subject: [PATCH 55/56] Replace waitForElement with waitFor in filterprovider test --- gsa/src/web/entities/__tests__/filterprovider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsa/src/web/entities/__tests__/filterprovider.js b/gsa/src/web/entities/__tests__/filterprovider.js index 5d156de8a3..813163e26c 100644 --- a/gsa/src/web/entities/__tests__/filterprovider.js +++ b/gsa/src/web/entities/__tests__/filterprovider.js @@ -23,7 +23,7 @@ import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {defaultFilterLoadingActions} from 'web/store/usersettings/defaultfilters/actions'; import {pageFilter} from 'web/store/pages/actions'; -import {rendererWith, screen} from 'web/utils/testing'; +import {rendererWith, screen, waitFor} from 'web/utils/testing'; import FilterProvider from '../filterprovider'; @@ -151,7 +151,7 @@ describe('FilterProvider component tests', () => { , ); - await waitForElement(() => getByTestId('awaiting-span')); + await waitFor(() => getByTestId('awaiting-span')); expect(renderFunc).toHaveBeenCalledWith({filter: resultingFilter}); expect(renderFunc).not.toHaveBeenCalledWith({filter: emptyFilter}); From c12201c63843d98a811cc11e2760dbc149049047 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Thu, 27 Aug 2020 14:39:31 +0200 Subject: [PATCH 56/56] Revert filterprovider test overwritten by merge --- .../web/entities/__tests__/filterprovider.js | 50 +------------------ 1 file changed, 2 insertions(+), 48 deletions(-) diff --git a/gsa/src/web/entities/__tests__/filterprovider.js b/gsa/src/web/entities/__tests__/filterprovider.js index 813163e26c..dac315c8b9 100644 --- a/gsa/src/web/entities/__tests__/filterprovider.js +++ b/gsa/src/web/entities/__tests__/filterprovider.js @@ -23,7 +23,7 @@ import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {defaultFilterLoadingActions} from 'web/store/usersettings/defaultfilters/actions'; import {pageFilter} from 'web/store/pages/actions'; -import {rendererWith, screen, waitFor} from 'web/utils/testing'; +import {rendererWith, screen} from 'web/utils/testing'; import FilterProvider from '../filterprovider'; @@ -111,52 +111,6 @@ describe('FilterProvider component tests', () => { expect(renderFunc).not.toHaveBeenCalledWith({filter: emptyFilter}); }); - test('should allow to set a pageName for loading the pageFilter', async () => { - const gmpName = 'task'; - const pageName = 'foo-bar-baz'; - const resultingFilter = Filter.fromString('page=filter rows=42'); - - const pFilter = Filter.fromString('page=filter'); - - const emptyFilter = Filter.fromString('rows=42'); - - const defaultSettingFilter = Filter.fromString('foo=bar'); - - const getSetting = jest.fn().mockResolvedValue({}); - const gmp = { - user: { - getSetting, - }, - }; - - const {render, store} = rendererWith({ - gmp, - store: true, - router: true, - }); - - store.dispatch(loadingActions.success({rowsperpage: {value: '42'}})); - store.dispatch( - defaultFilterLoadingActions.success(gmpName, defaultSettingFilter), - ); - store.dispatch(pageFilter(pageName, pFilter)); - - const renderFunc = jest - .fn() - .mockReturnValue(); - - const {getByTestId} = render( - - {renderFunc} - , - ); - - await waitFor(() => getByTestId('awaiting-span')); - - expect(renderFunc).toHaveBeenCalledWith({filter: resultingFilter}); - expect(renderFunc).not.toHaveBeenCalledWith({filter: emptyFilter}); - }); - test('should use defaultSettingFilter', async () => { const resultingFilter = Filter.fromString('foo=bar rows=42'); @@ -275,7 +229,7 @@ describe('FilterProvider component tests', () => { }); test('should use default fallbackFilter as last resort', async () => { - const resultingFilter = DEFAULT_FALLBACK_FILTER.copy().set('rows', 42); + const resultingFilter = DEFAULT_FALLBACK_FILTER.set('rows', 42); const getSetting = jest.fn().mockResolvedValue({}); const subscribe = jest.fn();