Updated Custom Tests and Plugins (markdown)

Michael Boelen 2016-02-22 13:24:46 +01:00
parent aefd844c2f
commit 23f5635c2f

@ -4,14 +4,18 @@ Extending Lynis with your own custom tests is easy.
## Tests
To start developing your own custom tests, look in the **include** directory. There is a file named **tests_custom.template**. Rename this file to **tests_custom**.
Next is adding your own tests in the file. They all should be named as CUST-xxxx, where xxxx is a unique number of your choice. By using the CUST category, Lynis knows it is a custom test.
After adding your test(s) to the tests_custom file, check the file permissions and set them equally as the other files in the include directory. Run Lynis and check if your tests were performed (near the end of the test cycle).
## Plugins
Another option is creating your own plugin. This is especially useful if you want to do data collection, for later analysis. This data can be stored in the report and then analyzed via Lynis, or an external tool of your choice.
1. To start, copy the plugin template or an existing plugin.
2. Define all plugins with an unique identifier, starting with CUST, followed by an unique number. This way Lynis knows it is a custom plugin.
2. Define all plugins with a unique identifier, starting with CUST, followed by a unique number. This way Lynis knows it is a custom plugin.
3. Create the related code of your plugin
4. Enable the plugin in your profile
5. Set file permissions (as strict as possible)