-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
342 changed files
with
1,182 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* | ||
* | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* | ||
* @copyright Copyright (c) 2014, Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
@@ -677,6 +677,11 @@ public function update() | |
include "db_upgrades/db_2.0.8.php"; | ||
} | ||
|
||
if (($db_internal_version < '20171010') and ($this->db->platform() == 'mysql')) { | ||
# upgrade for 2.0.10 | ||
include "db_upgrades/db_2.0.10.php"; | ||
} | ||
|
||
$this->data['include'] = 'v_database_update'; | ||
$this->data['heading'] = 'Database Upgrade'; | ||
$this->data['success'] = "Database upgraded successfully. New database version is ".$this->config->config['display_version']." (".$this->config->config['internal_version'].")"; | ||
|
73 changes: 73 additions & 0 deletions
73
code_igniter/application/controllers/db_upgrades/db_2.0.10.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/** | ||
# Copyright 2003-2015 Opmantek Limited (www.opmantek.com) | ||
# | ||
# ALL CODE MODIFICATIONS MUST BE SENT TO [email protected] | ||
# | ||
# This file is part of Open-AudIT. | ||
# | ||
# Open-AudIT is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Open-AudIT 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 Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with Open-AudIT (most likely in a file named LICENSE). | ||
# If not, see <http://www.gnu.org/licenses/> | ||
# | ||
# For further information on Open-AudIT or for a license other than AGPL please see | ||
# www.opmantek.com or email [email protected] | ||
# | ||
# ***************************************************************************** | ||
* | ||
**/ | ||
|
||
$this->log_db('Upgrade database to 2.0.10 commenced'); | ||
|
||
$sql = "DELETE FROM `configuration` WHERE name = 'discovery_linux_use_sudo'"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$sql = "INSERT INTO `configuration` VALUES (NULL,'discovery_linux_use_sudo','y','bool','y','system','2000-01-01 00:00:00','When running discovery commands on a Linux target, should we use sudo.')"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$sql = "DELETE FROM `configuration` WHERE name = 'delete_noncurrent_netstat'"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$sql = "INSERT INTO `configuration` VALUES (NULL,'delete_noncurrent_netstat','y','bool','y','system','2000-01-01 00:00:00','Should we store non-current netstat data and generate change logs.')"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$sql = "DELETE FROM `configuration` WHERE name = 'delete_noncurrent_variable'"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$sql = "INSERT INTO `configuration` VALUES (NULL,'delete_noncurrent_variable','y','bool','y','system','2000-01-01 00:00:00','Should we store non-current environment variable data and generate change logs.')"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
# fields | ||
alter_table('fields', 'type', "`type` enum('varchar','list','date') NOT NULL DEFAULT 'varchar'"); | ||
|
||
# ldap_servers | ||
alter_table('ldap_servers', 'port', "`port` varchar(200) NOT NULL DEFAULT '389'"); | ||
|
||
# set our versions | ||
$sql = "UPDATE `configuration` SET `value` = '20171010' WHERE `name` = 'internal_version'"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$sql = "UPDATE `configuration` SET `value` = '2.0.10' WHERE `name` = 'display_version'"; | ||
$this->db->query($sql); | ||
$this->log_db($this->db->last_query()); | ||
|
||
$this->log_db("Upgrade database to 2.0.10 completed"); | ||
$this->config->config['internal_version'] = '20171010'; | ||
$this->config->config['display_version'] = '2.0.10'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
@@ -191,6 +191,28 @@ private function create() | |
$device->last_seen = $this->config->config['timestamp']; | ||
$this->load->model('m_devices'); | ||
$id = $this->m_devices->create($device); | ||
$device->id = $id; | ||
if (!empty($device->ip) and !empty($device->netmask)) { | ||
$this->load->helper('network'); | ||
$network = network_details($device->ip . ' ' . $device->netmask); | ||
if (empty($network->error)) { | ||
$this->load->model('m_devices_components'); | ||
$device_ip = new stdClass(); | ||
$device_ip->mac = ''; | ||
$device_ip->net_index = ''; | ||
$device_ip->ip = $network->address; | ||
$device_ip->netmask = $network->netmask; | ||
$device_ip->cidr = $network->network_slash; | ||
$device_ip->version = 4; | ||
$device_ip->network = $network->network . '/' . $network->network_slash; | ||
$device_ip->set_by = ''; | ||
$input = new stdClass(); | ||
$input->item = array(); | ||
$input->item[] = $device_ip; | ||
$error = $this->m_devices_components->process_component('ip', $device, $input); | ||
} | ||
} | ||
|
||
if ($this->response->meta->format == 'screen') { | ||
redirect('devices/' . $id); | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
* @author Mark Unwin <[email protected]> | ||
* @copyright 2014 Opmantek | ||
* @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3 | ||
* @version 2.0.8 | ||
* @version 2.0.10 | ||
* @link http://www.open-audit.org | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.