diff options
author | Matthias Held <ilovemilk@wusa.io> | 2018-06-18 15:14:17 +0300 |
---|---|---|
committer | Matthias Held <ilovemilk@wusa.io> | 2018-06-18 15:14:17 +0300 |
commit | 0d4208bd4934d83654fc3893867b2557546b404a (patch) | |
tree | b6db2416bb0da30e119fdf8ff2120dea7d086481 /appinfo | |
parent | 7a756a94ab887209f7ad7ffc6a01e2d16d01bfd4 (diff) |
Add Nextcloud application
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/app.php | 25 | ||||
-rw-r--r-- | appinfo/database.xml | 111 | ||||
-rw-r--r-- | appinfo/info.xml | 41 | ||||
-rw-r--r-- | appinfo/routes.php | 25 |
4 files changed, 202 insertions, 0 deletions
diff --git a/appinfo/app.php b/appinfo/app.php new file mode 100644 index 0000000..b2f987a --- /dev/null +++ b/appinfo/app.php @@ -0,0 +1,25 @@ +<?php + +/** + * @copyright Copyright (c) 2017 Matthias Held <matthias.held@uni-konstanz.de> + * @author Matthias Held <matthias.held@uni-konstanz.de> + * @license GNU AGPL version 3 or any later version + * + * This program 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. + * + * 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ +$app = new \OCA\RansomwareDetection\AppInfo\Application(); +$app->register(); + +// debug mode +\OC::$server->getConfig()->setAppValue('ransomware_detection', 'debug', 0); diff --git a/appinfo/database.xml b/appinfo/database.xml new file mode 100644 index 0000000..f7f27f4 --- /dev/null +++ b/appinfo/database.xml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<database> + <name>*dbname*</name> + <create>true</create> + <overwrite>false</overwrite> + <charset>utf8</charset> + <table> + <name>*dbprefix*ransomware_detection_file_operation</name> + <declaration> + <field> + <name>id</name> + <type>integer</type> + <notnull>true</notnull> + <autoincrement>true</autoincrement> + </field> + <field> + <name>user_id</name> + <type>text</type> + <notnull>true</notnull> + <length>255</length> + </field> + <field> + <name>path</name> + <type>text</type> + <notnull>false</notnull> + <length>255</length> + </field> + <field> + <name>original_name</name> + <type>text</type> + <notnull>false</notnull> + <length>255</length> + </field> + <field> + <name>new_name</name> + <type>text</type> + <notnull>false</notnull> + <length>255</length> + </field> + <field> + <name>type</name> + <type>text</type> + <notnull>false</notnull> + <length>255</length> + </field> + <field> + <name>mime_type</name> + <type>text</type> + <notnull>false</notnull> + <length>255</length> + </field> + <field> + <name>size</name> + <type>integer</type> + <notnull>false</notnull> + <length>32</length> + </field> + <field> + <name>corrupted</name> + <type>integer</type> + <notnull>false</notnull> + <length>32</length> + </field> + <field> + <name>timestamp</name> + <type>integer</type> + <notnull>true</notnull> + <length>12</length> + </field> + <field> + <name>command</name> + <type>integer</type> + <notnull>true</notnull> + <length>12</length> + </field> + <field> + <name>sequence</name> + <type>integer</type> + <notnull>true</notnull> + <length>255</length> + </field> + <field> + <name>entropy</name> + <type>float</type> + <notnull>false</notnull> + </field> + <field> + <name>standard_deviation</name> + <type>float</type> + <notnull>false</notnull> + </field> + <field> + <name>file_name_entropy</name> + <type>float</type> + <notnull>false</notnull> + </field> + <field> + <name>file_class</name> + <type>text</type> + <notnull>false</notnull> + <length>64</length> + </field> + <field> + <name>file_name_class</name> + <type>text</type> + <notnull>false</notnull> + <length>64</length> + </field> + </declaration> + </table> +</database> diff --git a/appinfo/info.xml b/appinfo/info.xml new file mode 100644 index 0000000..8fc1536 --- /dev/null +++ b/appinfo/info.xml @@ -0,0 +1,41 @@ +<?xml version="1.0"?> +<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd"> + <id>ransomware_detection</id> + <name>Ransomware detection</name> + <summary><![CDATA[This app monitors file operations to detect ransomware attacks for a guided user-controlled recovery.]]></summary> + <description><![CDATA[This app monitors file operations to detect ransomware attacks by using generic indicators for a guided user-controlled recovery utilizing the integrated file versioning methods.]]></description> + <licence>agpl</licence> + <author mail="matthias.held@uni-konstanz.de">Matthias Held</author> + <version>0.2.3</version> + <namespace>RansomwareDetection</namespace> + <category>files</category> + <category>monitoring</category> + <category>security</category> + <bugs>https://github.com/ilovemilk/ransomware_detection/issues</bugs> + <dependencies> + <nextcloud min-version="13" max-version="13"/> + </dependencies> + + <navigations> + <navigation> + <name>Ransomware recovery</name> + <route>ransomware_detection.recover.index</route> + </navigation> + </navigations> + + <types> + <logging/> + </types> + + <settings> + <admin>OCA\RansomwareDetection\Settings\Admin</admin> + <admin-section>OCA\RansomwareDetection\Settings\AdminSection</admin-section> + <personal>OCA\RansomwareDetection\Settings\Personal</personal> + <personal-section>OCA\RansomwareDetection\Settings\PersonalSection</personal-section> + </settings> + + <background-jobs> + <job>OCA\RansomwareDetection\BackgroundJob\CleanUpJob</job> + </background-jobs> +</info> diff --git a/appinfo/routes.php b/appinfo/routes.php new file mode 100644 index 0000000..3914b5a --- /dev/null +++ b/appinfo/routes.php @@ -0,0 +1,25 @@ +<?php + +/** + * Create your routes in here. The name is the lowercase name of the controller + * without the controller part, the stuff after the hash is the method. + * e.g. page#index -> OCA\RansomwareDetection\Controller\PageController->index(). + * + * The controller class has to be registered in the application.php file since + * it's instantiated in there + */ +return [ + 'routes' => [ + ['name' => 'recover#index', 'url' => '/', 'verb' => 'GET'], + ], + 'ocs' => [ + ['name' => 'api#listFileOperations', 'url' => '/api/{apiVersion}/list', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'api#export', 'url' => '/api/{apiVersion}/export', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'api#deleteSequence', 'url' => '/api/{apiVersion}/delete-sequence/{sequence}', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'api#recover', 'url' => '/api/{apiVersion}/recover', 'verb' => 'POST', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'api#changeColorMode', 'url' => '/api/{apiVersion}/change-color-mode/{colorMode}', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'api#getColorMode', 'url' => '/api/{apiVersion}/get-color-mode', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'api#getDebugMode', 'url' => '/api/{apiVersion}/get-debug-mode', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ['name' => 'analyzer#analyze', 'url' => '/analyzer/{apiVersion}/analyze/{operationId}/{userId}', 'verb' => 'GET', 'requirements' => ['apiVersion' => 'v1']], + ], +]; |