Skip to content

Commit

Permalink
Add constants and convenience methods related to auto scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
garethlawson committed Jul 16, 2017
1 parent e19bb6b commit 9507f42
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/Entities/ScannerApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Entities;

use Doctrine\ORM\Mapping as ORM;
use Illuminate\Support\Collection;

/**
* App\Entities\ScannerApp
Expand All @@ -18,4 +19,21 @@ class ScannerApp extends Base\ScannerApp
const SCANNER_NETSPARKER = 'netsparker';
const SCANNER_NESSUS = 'nessus';
const SCANNER_RUGGEDY = 'ruggedy';

/**
* Get a Collection of available scanner apps
*
* @return Collection
*/
public static function getScannerApps(): Collection
{
return collect([
self::SCANNER_NMAP,
self::SCANNER_BURP,
self::SCANNER_NEXPOSE,
self::SCANNER_NETSPARKER,
self::SCANNER_NESSUS,
self::SCANNER_RUGGEDY,
]);
}
}
4 changes: 4 additions & 0 deletions app/Entities/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
*/
class Workspace extends Base\Workspace implements SystemComponent
{
const AUTO_SCAN_WORKSPACE_NAME = 'Automatic Scans';
const AUTO_SCAN_WORKSPACE_DESCRIPTION = 'This Workspace is created automatically to contain scan results from '
. 'files that are picked up in the auto_scan directory and processed automagically.';

/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="workspaces", cascade={"persist"}, fetch="EAGER")
* @ORM\JoinColumn(name="`user_id`", referencedColumnName="`id`", nullable=false)
Expand Down
4 changes: 4 additions & 0 deletions app/Entities/WorkspaceApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class WorkspaceApp extends Base\WorkspaceApp implements SystemComponent
const DEFAULT_NAME = 'Unnamed';
const DEFAULT_DESCRIPTION = 'No description given. Please add a relevant description.';

const AUTO_SCAN_WORKSPACE_APP_NAME = 'Automatic Scans';
const AUTO_SCAN_WORKSPACE_APP_DESCRIPTION = 'This Workspace App is created automatically to contain scan results '
. 'from files that are picked up in the auto_scan directory and processed automagically.';

/**
* @ORM\OneToMany(targetEntity="File", mappedBy="workspaceApp", cascade={"persist", "remove"})
* @ORM\JoinColumn(name="`id`", referencedColumnName="`workspace_apps_id`", nullable=false)
Expand Down

0 comments on commit 9507f42

Please sign in to comment.