diff --git a/CHANGELOG.md b/CHANGELOG.md index 28d35ce1fb..5ef5f451ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed ### Fixed ### Removed +- Removed interface access from users in GSA and gsad [#3123](https://github.com/greenbone/gsa/pull/3123) - Removed bid and bugtraq_id handling [#3122](https://github.com/greenbone/gsa/pull/3122) - Removed OSP scanner and scan config handling [#3094](https://github.com/greenbone/gsa/pull/3094) - Removed business process map feature [#3051](https://github.com/greenbone/gsa/pull/3051), [#3058] (https://github.com/greenbone/gsa/pull/3058) diff --git a/gsa/src/gmp/commands/users.js b/gsa/src/gmp/commands/users.js index ee650bb878..f35c824f1a 100644 --- a/gsa/src/gmp/commands/users.js +++ b/gsa/src/gmp/commands/users.js @@ -178,12 +178,10 @@ export class UserCommand extends EntityCommand { create({ access_hosts, - access_ifaces, auth_method, comment, group_ids, hosts_allow, - ifaces_allow, name, password, role_ids, @@ -198,12 +196,10 @@ export class UserCommand extends EntityCommand { const data = { cmd: 'create_user', access_hosts, - access_ifaces, auth_method, comment, 'group_ids:': group_ids, hosts_allow, - ifaces_allow, login: name, password, 'role_ids:': role_ids, @@ -215,12 +211,10 @@ export class UserCommand extends EntityCommand { save({ id, access_hosts = '', - access_ifaces = '', auth_method, comment = '', group_ids, hosts_allow, - ifaces_allow, name, old_name, password = '', // needs to be included in httpPost, should be optional in gsad @@ -238,12 +232,10 @@ export class UserCommand extends EntityCommand { const data = { cmd: 'save_user', access_hosts, - access_ifaces, comment, 'group_ids:': group_ids, hosts_allow, id, - ifaces_allow, login: name, modify_password: auth_method, old_login: old_name, @@ -310,9 +302,8 @@ export class UserCommand extends EntityCommand { [saveDefaultFilterSettingId('group')]: data.groupsFilter, [saveDefaultFilterSettingId('host')]: data.hostsFilter, [saveDefaultFilterSettingId('note')]: data.notesFilter, - [saveDefaultFilterSettingId( - 'operatingsystem', - )]: data.operatingSystemsFilter, + [saveDefaultFilterSettingId('operatingsystem')]: + data.operatingSystemsFilter, [saveDefaultFilterSettingId('override')]: data.overridesFilter, [saveDefaultFilterSettingId('permission')]: data.permissionsFilter, [saveDefaultFilterSettingId('portlist')]: data.portListsFilter, @@ -326,9 +317,8 @@ export class UserCommand extends EntityCommand { [saveDefaultFilterSettingId('target')]: data.targetsFilter, [saveDefaultFilterSettingId('task')]: data.tasksFilter, [saveDefaultFilterSettingId('ticket')]: data.ticketsFilter, - [saveDefaultFilterSettingId( - 'tlscertificate', - )]: data.tlsCertificatesFilter, + [saveDefaultFilterSettingId('tlscertificate')]: + data.tlsCertificatesFilter, [saveDefaultFilterSettingId('user')]: data.usersFilter, [saveDefaultFilterSettingId('vulnerability')]: data.vulnerabilitiesFilter, [saveDefaultFilterSettingId('cpe')]: data.cpeFilter, diff --git a/gsa/src/gmp/models/__tests__/user.js b/gsa/src/gmp/models/__tests__/user.js index 51d635c8af..bc9bb6a9c4 100644 --- a/gsa/src/gmp/models/__tests__/user.js +++ b/gsa/src/gmp/models/__tests__/user.js @@ -81,27 +81,6 @@ describe('User model tests', () => { expect(user2.hosts).toEqual(res2); }); - test('should parse ifaces', () => { - const elem = { - ifaces: { - __text: '123.456.789.42, 987.654.321.1', - _allow: '0', - }, - }; - const res = { - addresses: ['123.456.789.42', '987.654.321.1'], - allow: '0', - }; - const res2 = { - addresses: [], - }; - const user = User.fromElement(elem); - const user2 = User.fromElement({}); - - expect(user.ifaces).toEqual(res); - expect(user2.ifaces).toEqual(res2); - }); - test('should parse sources to auth_method', () => { const elem1 = { sources: { diff --git a/gsa/src/gmp/models/user.js b/gsa/src/gmp/models/user.js index 57239507ba..93506f7f2a 100644 --- a/gsa/src/gmp/models/user.js +++ b/gsa/src/gmp/models/user.js @@ -62,17 +62,6 @@ class User extends Model { }; } - if (isDefined(element.ifaces)) { - ret.ifaces = { - addresses: parseCsv(element.ifaces.__text), - allow: element.ifaces._allow, - }; - } else { - ret.ifaces = { - addresses: [], - }; - } - if (isDefined(element.sources)) { const {source} = element.sources; if (source === 'ldap_connect') { diff --git a/gsa/src/web/pages/users/component.js b/gsa/src/web/pages/users/component.js index 7031040c28..28220e1a67 100644 --- a/gsa/src/web/pages/users/component.js +++ b/gsa/src/web/pages/users/component.js @@ -61,11 +61,9 @@ class UserComponent extends React.Component { this.setState({ dialogVisible: true, accessHosts: user.hosts.addresses.join(', '), - accessIfaces: user.ifaces.addresses.join(', '), comment: user.comment, groupIds, hostsAllow: user.hosts.allow, - ifacesAllow: user.ifaces.allow, name: user.name, oldName: user.name, roleIds, @@ -76,12 +74,10 @@ class UserComponent extends React.Component { } else { this.setState({ accessHosts: undefined, - accessIfaces: undefined, comment: undefined, dialogVisible: true, groupIds: undefined, hostsAllow: undefined, - ifacesAllow: undefined, name: undefined, oldName: undefined, roleIds: undefined, @@ -127,13 +123,11 @@ class UserComponent extends React.Component { const { accessHosts, - accessIfaces, comment, dialogVisible, groupIds, groups, hostsAllow, - ifacesAllow, name, oldName, roleIds, @@ -168,12 +162,10 @@ class UserComponent extends React.Component { {dialogVisible && ( { }; const UserDetails = ({entity, links = true}) => { - const { - auth_method, - comment, - groups = [], - hosts = {}, - ifaces = [], - roles = [], - } = entity; + const {auth_method, comment, groups = [], hosts = {}, roles = []} = entity; return ( @@ -134,11 +127,6 @@ const UserDetails = ({entity, links = true}) => { - - {_('Interface Access')} - {convert_allow(ifaces)} - - {_('Authentication Type')} {convert_auth_method(auth_method)} diff --git a/gsa/src/web/pages/users/dialog.js b/gsa/src/web/pages/users/dialog.js index ddaec7fcda..400a7e0ea2 100644 --- a/gsa/src/web/pages/users/dialog.js +++ b/gsa/src/web/pages/users/dialog.js @@ -92,13 +92,11 @@ class Dialog extends React.Component { render() { const { accessHosts = '', - accessIfaces = '', capabilities, comment = '', groups, groupIds = [], hostsAllow = ACCESS_ALLOW_ALL, - ifacesAllow = ACCESS_ALLOW_ALL, name = _('Unnamed'), oldName, password = '', @@ -117,7 +115,6 @@ class Dialog extends React.Component { const data = { ...user, access_hosts: accessHosts, - access_ifaces: accessIfaces, auth_method: isEdit && isDefined(user.authMethod) ? user.authMethod @@ -126,7 +123,6 @@ class Dialog extends React.Component { group_ids: groupIds, groups, hosts_allow: hostsAllow, - ifaces_allow: ifacesAllow, name, old_name: oldName, password, @@ -318,33 +314,6 @@ class Dialog extends React.Component { /> - - - - - - - - - - {confirmationDialogVisible && ( str); g_string_free (role_elements, TRUE); - buf = g_markup_printf_escaped ("%s" - "%s", - hosts_allow, hosts, ifaces_allow, ifaces); + buf = g_markup_printf_escaped ("%s", hosts_allow, + hosts); g_string_append (string, buf); g_free (buf); if (auth_method && !strcmp (auth_method, "1")) @@ -14368,7 +14363,7 @@ save_user_gmp (gvm_connection_t *connection, credentials_t *credentials, int ret; gchar *html, *response, *buf; const char *user_id, *login, *old_login, *modify_password, *password; - const char *hosts, *hosts_allow, *ifaces, *ifaces_allow, *comment; + const char *hosts, *hosts_allow, *comment; entity_t entity; GString *command, *group_elements, *role_elements; params_t *groups, *roles; @@ -14379,8 +14374,6 @@ save_user_gmp (gvm_connection_t *connection, credentials_t *credentials, /* Whether hosts grants ("1") or forbids ("0") access. "2" for all * access. */ hosts_allow = params_value (params, "hosts_allow"); - ifaces = params_value (params, "access_ifaces"); - ifaces_allow = params_value (params, "ifaces_allow"); login = params_value (params, "login"); old_login = params_value (params, "old_login"); modify_password = params_value (params, "modify_password"); @@ -14392,8 +14385,6 @@ save_user_gmp (gvm_connection_t *connection, credentials_t *credentials, CHECK_VARIABLE_INVALID (modify_password, "Save User"); CHECK_VARIABLE_INVALID (hosts, "Save User"); CHECK_VARIABLE_INVALID (hosts_allow, "Save User"); - CHECK_VARIABLE_INVALID (ifaces, "Save User"); - CHECK_VARIABLE_INVALID (ifaces_allow, "Save User"); CHECK_VARIABLE_INVALID (login, "Save User"); CHECK_VARIABLE_INVALID (old_login, "Save User"); @@ -14430,9 +14421,8 @@ save_user_gmp (gvm_connection_t *connection, credentials_t *credentials, g_free (buf); } - buf = g_markup_printf_escaped ("%s" - "%s", - hosts_allow, hosts, ifaces_allow, ifaces); + buf = g_markup_printf_escaped ("%s", hosts_allow, + hosts); g_string_append (command, buf); g_free (buf);