Skip to content

Commit

Permalink
Remove network source interface from tasks and audits
Browse files Browse the repository at this point in the history
  • Loading branch information
saberlynx committed May 6, 2021
1 parent c672923 commit 340ad6f
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 80 deletions.
6 changes: 0 additions & 6 deletions gsa/src/gmp/commands/__tests__/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ describe('AuditCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: undefined,
schedule_periods: undefined,
source_iface: undefined,
tag_id: undefined,
target_id: 't1',
usage_type: 'audit',
Expand Down Expand Up @@ -123,7 +122,6 @@ describe('AuditCommand tests', () => {
scannerType: OPENVAS_SCANNER_TYPE,
scheduleId: 's1',
schedulePeriods: 1,
sourceIface: 'eth0',
tagId: 't1',
targetId: 't1',
})
Expand All @@ -149,7 +147,6 @@ describe('AuditCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: 's1',
schedule_periods: 1,
source_iface: 'eth0',
tag_id: 't1',
target_id: 't1',
usage_type: 'audit',
Expand Down Expand Up @@ -203,7 +200,6 @@ describe('AuditCommand tests', () => {
scanner_type: undefined,
schedule_id: 0,
schedule_periods: undefined,
source_iface: undefined,
task_id: 'audit1',
target_id: 0,
usage_type: 'audit',
Expand Down Expand Up @@ -242,7 +238,6 @@ describe('AuditCommand tests', () => {
scannerType: OPENVAS_SCANNER_TYPE,
scheduleId: 's1',
schedulePeriods: 1,
sourceIface: 'eth0',
targetId: 't1',
})
.then(resp => {
Expand All @@ -266,7 +261,6 @@ describe('AuditCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: 's1',
schedule_periods: 1,
source_iface: 'eth0',
task_id: 'audit1',
target_id: 't1',
usage_type: 'audit',
Expand Down
6 changes: 0 additions & 6 deletions gsa/src/gmp/commands/__tests__/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ describe('TaskCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: undefined,
schedule_periods: undefined,
source_iface: undefined,
tag_id: undefined,
target_id: 't1',
usage_type: 'scan',
Expand Down Expand Up @@ -114,7 +113,6 @@ describe('TaskCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: 's1',
schedule_periods: 1,
source_iface: 'eth0',
tag_id: 't1',
target_id: 't1',
})
Expand All @@ -140,7 +138,6 @@ describe('TaskCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: 's1',
schedule_periods: 1,
source_iface: 'eth0',
tag_id: 't1',
target_id: 't1',
usage_type: 'scan',
Expand Down Expand Up @@ -222,7 +219,6 @@ describe('TaskCommand tests', () => {
scanner_type: undefined,
schedule_id: 0,
schedule_periods: undefined,
source_iface: undefined,
task_id: 'task1',
target_id: 0,
usage_type: 'scan',
Expand Down Expand Up @@ -261,7 +257,6 @@ describe('TaskCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: 's1',
schedule_periods: 1,
source_iface: 'eth0',
target_id: 't1',
})
.then(resp => {
Expand All @@ -285,7 +280,6 @@ describe('TaskCommand tests', () => {
scanner_type: OPENVAS_SCANNER_TYPE,
schedule_id: 's1',
schedule_periods: 1,
source_iface: 'eth0',
task_id: 'task1',
target_id: 't1',
usage_type: 'scan',
Expand Down
4 changes: 0 additions & 4 deletions gsa/src/gmp/commands/audits.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export class AuditCommand extends EntityCommand {
scannerId,
scheduleId,
schedulePeriods,
sourceIface,
tagId,
targetId,
} = args;
Expand All @@ -127,7 +126,6 @@ export class AuditCommand extends EntityCommand {
scanner_type: scannerType,
schedule_id: scheduleId,
schedule_periods: schedulePeriods,
source_iface: sourceIface,
tag_id: tagId,
target_id: targetId,
usage_type: 'audit',
Expand Down Expand Up @@ -157,7 +155,6 @@ export class AuditCommand extends EntityCommand {
scheduleId = NO_VALUE,
schedulePeriods,
targetId = NO_VALUE,
sourceIface,
} = args;
const data = {
alterable,
Expand All @@ -178,7 +175,6 @@ export class AuditCommand extends EntityCommand {
scanner_type: scannerType,
schedule_id: scheduleId,
schedule_periods: schedulePeriods,
source_iface: sourceIface,
target_id: targetId,
task_id: id,
usage_type: 'audit',
Expand Down
4 changes: 0 additions & 4 deletions gsa/src/gmp/commands/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export class TaskCommand extends EntityCommand {
scanner_id,
schedule_id,
schedule_periods,
source_iface,
tag_id,
target_id,
} = args;
Expand All @@ -130,7 +129,6 @@ export class TaskCommand extends EntityCommand {
scanner_type,
schedule_id,
schedule_periods,
source_iface,
tag_id,
target_id,
usage_type: 'scan',
Expand Down Expand Up @@ -172,7 +170,6 @@ export class TaskCommand extends EntityCommand {
schedule_id = NO_VALUE,
schedule_periods,
target_id = NO_VALUE,
source_iface,
} = args;
const data = {
alterable,
Expand All @@ -193,7 +190,6 @@ export class TaskCommand extends EntityCommand {
scanner_type,
schedule_id,
schedule_periods,
source_iface,
target_id,
task_id: id,
usage_type: 'scan',
Expand Down
5 changes: 0 additions & 5 deletions gsa/src/gmp/models/__tests__/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ describe('Audit model tests', () => {
scanner_name: 'max_checks',
value: '4',
},
{
scanner_name: 'source_iface',
value: 'eth0',
},
{
scanner_name: 'foo',
value: 'bar',
Expand Down Expand Up @@ -128,7 +124,6 @@ describe('Audit model tests', () => {
expect(audit1.auto_delete).toEqual('keep');
expect(audit1.max_hosts).toEqual(20);
expect(audit1.max_checks).toEqual(4);
expect(audit1.source_iface).toEqual('eth0');
expect(audit1.preferences).toEqual({foo: {value: 'bar', name: 'lorem'}});
expect(audit2.in_assets).toEqual(0);
expect(audit2.apply_overrides).toEqual(0);
Expand Down
5 changes: 0 additions & 5 deletions gsa/src/gmp/models/__tests__/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,6 @@ describe('Task Model parse tests', () => {
scanner_name: 'max_checks',
value: '4',
},
{
scanner_name: 'source_iface',
value: 'eth0',
},
{
scanner_name: 'foo',
value: 'bar',
Expand Down Expand Up @@ -354,7 +350,6 @@ describe('Task Model parse tests', () => {
expect(task1.auto_delete).toEqual('keep');
expect(task1.max_hosts).toEqual(20);
expect(task1.max_checks).toEqual(4);
expect(task1.source_iface).toEqual('eth0');
expect(task1.preferences).toEqual({foo: {value: 'bar', name: 'lorem'}});
expect(task2.in_assets).toEqual(0);
expect(task2.apply_overrides).toEqual(0);
Expand Down
3 changes: 0 additions & 3 deletions gsa/src/gmp/models/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ class Audit extends Model {
case 'max_checks':
copy[pref.scanner_name] = parseInt(pref.value);
break;
case 'source_iface':
copy.source_iface = pref.value;
break;
default:
prefs[pref.scanner_name] = {value: pref.value, name: pref.name};
break;
Expand Down
3 changes: 0 additions & 3 deletions gsa/src/gmp/models/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ class Task extends Model {
case 'max_checks':
copy[pref.scanner_name] = parseInt(pref.value);
break;
case 'source_iface':
copy.source_iface = pref.value;
break;
default:
prefs[pref.scanner_name] = {value: pref.value, name: pref.name};
break;
Expand Down
1 change: 0 additions & 1 deletion gsa/src/web/pages/audits/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ class AuditComponent extends React.Component {
scannerId: hasId(audit.scanner) ? audit.scanner.id : undefined,
scheduleId,
schedulePeriods,
sourceIface: audit.source_iface,
targetId: hasId(audit.target) ? audit.target.id : undefined,
audit,
title: _('Edit Audit {{name}}', audit),
Expand Down
9 changes: 0 additions & 9 deletions gsa/src/web/pages/audits/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ class AuditDetails extends React.Component {
hosts_ordering,
in_assets,
last_report,
preferences,
scanner,
schedule_periods,
target,
max_checks,
max_hosts,
} = entity;
const {iface = {}} = preferences;

let dur;
const hasDuration =
Expand Down Expand Up @@ -176,13 +174,6 @@ class AuditDetails extends React.Component {
<TableData>{hosts_ordering}</TableData>
</TableRow>
)}
{isDefined(policy) &&
policy.policy_type === OPENVAS_SCAN_CONFIG_TYPE && (
<TableRow>
<TableData>{_('Network Source Interface')}</TableData>
<TableData>{iface.value}</TableData>
</TableRow>
)}
{isDefined(policy) &&
policy.policy_type === OPENVAS_SCAN_CONFIG_TYPE &&
isDefined(max_checks) && (
Expand Down
10 changes: 0 additions & 10 deletions gsa/src/web/pages/audits/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ const AuditDialog = ({
scheduleId = UNSET_VALUE,
schedulePeriods = NO_VALUE,
schedules = [],
sourceIface = '',
targetId,
targets,
audit,
Expand Down Expand Up @@ -170,7 +169,6 @@ const AuditDialog = ({
name,
scannerId,
scannerType,
sourceIface,
audit,
};

Expand Down Expand Up @@ -330,13 +328,6 @@ const AuditDialog = ({
onChange={onChange}
/>
</FormGroup>
<FormGroup titleSize="4" title={_('Network Source Interface')}>
<TextField
name="sourceIface"
value={state.sourceIface}
onChange={onValueChange}
/>
</FormGroup>
<FormGroup titleSize="4" title={_('Order for target hosts')}>
<Select
name="hostsOrdering"
Expand Down Expand Up @@ -416,7 +407,6 @@ AuditDialog.propTypes = {
scheduleId: PropTypes.idOrZero,
schedulePeriods: PropTypes.yesno,
schedules: PropTypes.array,
sourceIface: PropTypes.string,
targetId: PropTypes.idOrZero,
targets: PropTypes.array,
title: PropTypes.string,
Expand Down
5 changes: 0 additions & 5 deletions gsa/src/web/pages/policies/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ class PolicyComponent extends React.Component {
name: undefined,
scheduleId: defaultScheduleId,
schedulePeriods: undefined,
sourceIface: undefined,
targetId: defaultTargetId,
title: _('New Audit'),
});
Expand Down Expand Up @@ -297,7 +296,6 @@ class PolicyComponent extends React.Component {
scannerType = OPENVAS_SCANNER_TYPE,
scheduleId,
schedulePeriods,
sourceIface,
targetId,
}) {
const {gmp} = this.props;
Expand Down Expand Up @@ -332,7 +330,6 @@ class PolicyComponent extends React.Component {
scannerId,
scheduleId,
schedulePeriods,
sourceIface,
tagId,
targetId,
})
Expand Down Expand Up @@ -659,7 +656,6 @@ class PolicyComponent extends React.Component {
scanners,
scheduleId,
schedulePeriods,
sourceIface,
targetId,
title,
} = this.state;
Expand Down Expand Up @@ -727,7 +723,6 @@ class PolicyComponent extends React.Component {
scheduleId={scheduleId}
schedulePeriods={schedulePeriods}
schedules={schedules}
sourceIface={sourceIface}
targetId={targetId}
targets={targets}
title={title}
Expand Down
9 changes: 0 additions & 9 deletions gsa/src/web/pages/tasks/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ class TaskDetails extends React.Component {
in_assets,
last_report,
min_qod,
preferences,
scanner,
schedule_periods,
target,
max_checks,
max_hosts,
} = entity;
const {iface = {}} = preferences;

let dur;
const has_duration =
Expand Down Expand Up @@ -190,13 +188,6 @@ class TaskDetails extends React.Component {
<TableData>{hosts_ordering}</TableData>
</TableRow>
)}
{isDefined(scanConfig) &&
scanConfig.scan_config_type === OPENVAS_SCAN_CONFIG_TYPE && (
<TableRow>
<TableData>{_('Network Source Interface')}</TableData>
<TableData>{iface.value}</TableData>
</TableRow>
)}
{isDefined(scanConfig) &&
scanConfig.scan_config_type === OPENVAS_SCAN_CONFIG_TYPE &&
isDefined(max_checks) && (
Expand Down
10 changes: 0 additions & 10 deletions gsa/src/web/pages/tasks/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const TaskDialog = ({
schedule_id = UNSET_VALUE,
schedule_periods = NO_VALUE,
schedules = [],
source_iface = '',
tags = [],
target_id,
targets,
Expand Down Expand Up @@ -275,7 +274,6 @@ const TaskDialog = ({
scanner_type,
scanner_id,
schedule_periods,
source_iface,
tag_id,
tags,
task,
Expand Down Expand Up @@ -504,13 +502,6 @@ const TaskDialog = ({
/>
</div>
</FormGroup>
<FormGroup titleSize="4" title={_('Network Source Interface')}>
<TextField
name="source_iface"
value={state.source_iface}
onChange={onValueChange}
/>
</FormGroup>
<FormGroup titleSize="4" title={_('Order for target hosts')}>
<Select
name="hosts_ordering"
Expand Down Expand Up @@ -638,7 +629,6 @@ TaskDialog.propTypes = {
schedule_id: PropTypes.idOrZero,
schedule_periods: PropTypes.yesno,
schedules: PropTypes.array,
source_iface: PropTypes.string,
tag_id: PropTypes.id,
tags: PropTypes.array,
target_id: PropTypes.idOrZero,
Expand Down

0 comments on commit 340ad6f

Please sign in to comment.