Commit a97e67c5 authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- New templates for edit and display of timers

- route handlers for the new templates
- CSS modifications for dropdown submenus
- Nav menu edits to add new routes
parent 162e9384
<?php if (!defined('skynet')) exit();
/* Skynet - Automated "Cloud" Security Scanner *#
#* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *#
#* *#
#* This program is free software; you can redistribute it and/or modify *#
#* it under the terms of the GNU General Public License as published by *#
#* the Free Software Foundation; either version 2 of the License, or *#
#* (at your option) any later version. *#
#* *#
#* This program is distributed in the hope that it will be useful, *#
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *#
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *#
#* GNU General Public License for more details. *#
#* *#
#* You should have received a copy of the GNU General Public License *#
#* along with this program; if not, write to the Free Software *#
#* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
// Edit Server Item
$app->get('/edit-server', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('edit-server.tpl', $smarty_data);
});
// Edit Target Item
$app->get('/edit-target', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('edit-target.tpl', $smarty_data);
});
// Edit Scan Type Item
$app->get('/edit-scantype', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('edit-scantype.tpl', $smarty_data);
});
// Edit Schedule Item
$app->get('/edit-schedule', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('edit-schedule.tpl', $smarty_data);
});
?>
<?php if (!defined('skynet')) exit();
/* Skynet - Automated "Cloud" Security Scanner *#
#* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *#
#* *#
#* This program is free software; you can redistribute it and/or modify *#
#* it under the terms of the GNU General Public License as published by *#
#* the Free Software Foundation; either version 2 of the License, or *#
#* (at your option) any later version. *#
#* *#
#* This program is distributed in the hope that it will be useful, *#
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *#
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *#
#* GNU General Public License for more details. *#
#* *#
#* You should have received a copy of the GNU General Public License *#
#* along with this program; if not, write to the Free Software *#
#* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
// List Servers
$app->get('/servers', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('servers.tpl', $smarty_data);
});
// List Targets
$app->get('/targets', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('targets.tpl', $smarty_data);
});
// List Scan Types
$app->get('/scantypes', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('scantypes.tpl', $smarty_data);
});
// List Schedule
$app->get('/schedule', $isauthenticated(), function () use ($app) {
global $smarty_data;
prep_smarty($app);
$app->render('schedule.tpl', $smarty_data);
});
?>
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}
{--* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
{--* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
{--* GNU General Public License for more details. *}
{--* *}
{--* You should have received a copy of the GNU General Public License *}
{--* along with this program; if not, write to the Free Software *}
{--* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='shortcut icon' type='image/x-icon' href='{$skynet_favicon}'>
{include file='head-css.tpl'}
<title>Skynet Automated Security Scanner</title>
</head>
<body>
{assign var=page value='timer'}
{include file='header.tpl'}
<div class='container'>
<div class='page-header'>
<h1>Scan Type Editor</h1>
</div>
<form>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Server IP</span>
<input type='text' name='server_ip' value='{$server_ip|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Key</span>
<input type='text' name='ssh_key' value='{$ssh_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Username</span>
<input type='text' name='ssh_username' value='{$ssh_user|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">GPG Key</span>
<input type='text' name='gpg_key' value='{$gog_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Config Directory</span>
<input type='text' name='config_dir' value='{$config_dir|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Output Directory</span>
<input type='text' name='output_dir' value='{$output_dir|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Key Type</span>
<input type='text' name='key_type' value='{$key_type|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Contact Frequency</span>
<input type='text' name='contact_frequency' value='{$frequency|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Description</span>
<textarea name='description'>{$description|default:""}</textarea>
</div>
</div>
</div>
<div class='input-group'>
<input type='button' name='save' value='Submit' />
</div>
<input type='hidden' name='cloud_id' value='{$cloud_id|default:""}' />
</form>
</div>
{include file='footer.tpl'}
</body>
</html>
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}
{--* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
{--* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
{--* GNU General Public License for more details. *}
{--* *}
{--* You should have received a copy of the GNU General Public License *}
{--* along with this program; if not, write to the Free Software *}
{--* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='shortcut icon' type='image/x-icon' href='{$skynet_favicon}'>
{include file='head-css.tpl'}
<title>Skynet Automated Security Scanner</title>
</head>
<body>
{assign var=page value='timer'}
{include file='header.tpl'}
<div class='container'>
<div class='page-header'>
<h1>Schedule Editor</h1>
</div>
<form>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Server IP</span>
<input type='text' name='server_ip' value='{$server_ip|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Key</span>
<input type='text' name='ssh_key' value='{$ssh_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Username</span>
<input type='text' name='ssh_username' value='{$ssh_user|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">GPG Key</span>
<input type='text' name='gpg_key' value='{$gog_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Config Directory</span>
<input type='text' name='config_dir' value='{$config_dir|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Output Directory</span>
<input type='text' name='output_dir' value='{$output_dir|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Key Type</span>
<input type='text' name='key_type' value='{$key_type|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Contact Frequency</span>
<input type='text' name='contact_frequency' value='{$frequency|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Description</span>
<textarea name='description'>{$description|default:""}</textarea>
</div>
</div>
</div>
<div class='input-group'>
<input type='button' name='save' value='Submit' />
</div>
<input type='hidden' name='cloud_id' value='{$cloud_id|default:""}' />
</form>
</div>
{include file='footer.tpl'}
</body>
</html>
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}
{--* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
{--* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
{--* GNU General Public License for more details. *}
{--* *}
{--* You should have received a copy of the GNU General Public License *}
{--* along with this program; if not, write to the Free Software *}
{--* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='shortcut icon' type='image/x-icon' href='{$skynet_favicon}'>
{include file='head-css.tpl'}
<title>Skynet Automated Security Scanner</title>
</head>
<body>
{assign var=page value='timer'}
{include file='header.tpl'}
<div class='container'>
<div class='page-header'>
<h1>Server Editor</h1>
</div>
<form>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Server IP</span>
<input type='text' name='server_ip' value='{$server_ip|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Key</span>
<input type='text' name='ssh_key' value='{$ssh_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Username</span>
<input type='text' name='ssh_username' value='{$ssh_user|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">GPG Key</span>
<input type='text' name='gpg_key' value='{$gog_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Config Directory</span>
<input type='text' name='config_dir' value='{$config_dir|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Output Directory</span>
<input type='text' name='output_dir' value='{$output_dir|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Key Type</span>
<input type='text' name='key_type' value='{$key_type|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Contact Frequency</span>
<input type='text' name='contact_frequency' value='{$frequency|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Description</span>
<textarea name='description'>{$description|default:""}</textarea>
</div>
</div>
</div>
<div class='input-group'>
<input type='button' name='save' value='Submit' />
</div>
<input type='hidden' name='cloud_id' value='{$cloud_id|default:""}' />
</form>
</div>
{include file='footer.tpl'}
</body>
</html>
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}
{--* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
{--* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
{--* GNU General Public License for more details. *}
{--* *}
{--* You should have received a copy of the GNU General Public License *}
{--* along with this program; if not, write to the Free Software *}
{--* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='shortcut icon' type='image/x-icon' href='{$skynet_favicon}'>
{include file='head-css.tpl'}
<title>Skynet Automated Security Scanner</title>
</head>
<body>
{assign var=page value='timer'}
{include file='header.tpl'}
<div class='container'>
<div class='page-header'>
<h1>Target Editor</h1>
</div>
<form>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Server IP</span>
<input type='text' name='server_ip' value='{$server_ip|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Key</span>
<input type='text' name='ssh_key' value='{$ssh_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">SSH Username</span>
<input type='text' name='ssh_username' value='{$ssh_user|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">GPG Key</span>
<input type='text' name='gpg_key' value='{$gog_key|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Config Directory</span>
<input type='text' name='config_dir' value='{$config_dir|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Output Directory</span>
<input type='text' name='output_dir' value='{$output_dir|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Key Type</span>
<input type='text' name='key_type' value='{$key_type|default:""}' />
</div>
</div>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Contact Frequency</span>
<input type='text' name='contact_frequency' value='{$frequency|default:""}' />
</div>
</div>
</div>
<div class='row'>
<div class="col-md-4">
<div class='input-group'>
<span class="input-group-addon">Description</span>
<textarea name='description'>{$description|default:""}</textarea>
</div>
</div>
</div>
<div class='input-group'>
<input type='button' name='save' value='Submit' />
</div>
<input type='hidden' name='cloud_id' value='{$cloud_id|default:""}' />
</form>
</div>
{include file='footer.tpl'}
</body>
</html>
......@@ -35,11 +35,41 @@
<li><a href="/">Home</a></li>
{/if}
{if $username != 'guest'}
{if $page == 'reports'}
<li class="active"><a href="/reports">Reports</a></li>
{if $page == 'timer'}
<li class="active dropdown">
{else}
<li><a href="/reports">Reports</a></li>
<li class="dropdown">
{/if}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Timers <span class="caret"></span></a>
<ul class="dropdown-menu multi-level" role="menu">
<li><a href="/servers">Scan Servers</a></li>
<li><a href="/targets">Targets</a></li>
<li><a href="/scantypes">Scan Types</a></li>
<li><a href="/schedule">Scheduling</a></li>
<li class='dropdown-submenu'>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Add</a>
<ul class="dropdown-menu" role="menu">
<li><a href="/edit-server">Scan Server</a></li>
<li><a href="/edit-target">Target</a></li>
<li><a href="/edit-scantype">Scan Type</a></li>
<li><a href="/edit-schedule">Schedule</a></li>
</ul>
</li>
</ul>
</li>
{if $page == 'report'}
<li class="active dropdown">
{else}
<li class="dropdown">
{/if}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Reports <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="/report1">Report 1</a></li>
<li><a href="/report2">Report 2</a></li>
<li><a href="/report3">Report 3</a></li>
<li><a href="/report4">Report 4</a></li>
</ul>
</li>
{/if}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{$username} <span class="caret"></span></a>
......
{--* Skynet - Automated "Cloud" Security Scanner *}
{--* Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> *}
{--* *}
{--* This program is free software; you can redistribute it and/or modify *}
{--* it under the terms of the GNU General Public License as published by *}
{--* the Free Software Foundation; either version 2 of the License, or *}
{--* (at your option) any later version. *}
{--* *}
{--* This program is distributed in the hope that it will be useful, *}