Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2014-08-26 19:33:55 +0400
committermboelen <michael@cisofy.com>2014-08-26 19:33:55 +0400
commitc0ae2e217b7f1fb0171017ce5afb8eb8898470db (patch)
tree545aa150c35c5fb74d7bb4c2d3b0ae41cfa7b4e5 /plugins
Initial import
Diffstat (limited to 'plugins')
-rw-r--r--plugins/README30
-rw-r--r--plugins/custom_plugin.template68
2 files changed, 98 insertions, 0 deletions
diff --git a/plugins/README b/plugins/README
new file mode 100644
index 00000000..c65287a1
--- /dev/null
+++ b/plugins/README
@@ -0,0 +1,30 @@
+
+##########################################################################
+#
+# This directory contains plugins
+#
+##########################################################################
+
+
+General notes
+---------------
+
+Custom plugins should be added to this directory, so they are included in an
+audit.
+
+Notes:
+- File permissions of a plugin should be 600, 640 or the least
+ restrictive 400.
+- Each plugin should be enabled in the profile, before it will be used.
+- Custom plugins should use a test ID's with a "CUS-" prefix.
+
+
+A generic example can be found in the custom_plugin.template file, which
+includes several code snippets to assist in creating customer plugins.
+
+
+
+**************************************************************************
+ Would your plugin or individual test benefit Lynis and others?
+ Share and be part of the Free and Open Source Software community!
+**************************************************************************
diff --git a/plugins/custom_plugin.template b/plugins/custom_plugin.template
new file mode 100644
index 00000000..d0a16cfc
--- /dev/null
+++ b/plugins/custom_plugin.template
@@ -0,0 +1,68 @@
+#!/bin/sh
+# -------------------------- CUT THIS SECTION ---------------------------
+# This is a template to create a personal plugin
+#
+# Each plugin should at least have several variables defined with the
+# prefix PLUGIN_* (see below)
+#
+# To add a section header, use the InsertSection function (see below)
+#
+# -------------------------- CUT THIS SECTION ---------------------------
+
+#########################################################################
+#
+# * DO NOT REMOVE *
+#-----------------------------------------------------
+# PLUGIN_AUTHOR=___firstname_lastname_<email>___
+# PLUGIN_CATEGORY=[category]
+# PLUGIN_DESC=[description]
+# PLUGIN_NAME=[plugin_name]
+# PLUGIN_REQUIRED_TESTS=
+#-----------------------------------------------------
+#########################################################################
+#
+#
+#
+#########################################################################
+#
+# Add custom section to screen output
+# InsertSection "Personal Plugin"
+#
+#################################################################################
+#
+ # Test : CUS-0000
+ # Description : check for an ordinary directory!
+
+ # First check if OPENSSLBINARY is known as a prerequisite for this test.
+ if [ ! -z "${OPENSSLBINARY}" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
+ Register --test-no CUS-0000 --preqs-met ${PREQS_MET} --weight L --network NO --description "Description of custom test"
+
+ # Just do check without any prerequisites
+ Register --test-no CUS-0000 --weight L --network NO --description "Description of custom test"
+ if [ ${SKIPTEST} -eq 0 ]; then
+ FOUNDPROBLEM=0
+ # Check if a directory exists
+ if [ -d /my/path ]; then
+ logtext "Result: log entry for easier debugging or additional information"
+ else
+ FOUNDPROBLEM=1
+ logtext "Result: problem found!"
+ ReportWarning ${TEST_NO} "M" "This is a test warning line"
+ fi
+
+ if [ ${FOUNDPROBLEM} -eq 0 ]; then
+ Display --indent 2 --text "- Checking xxx..." --result OK --color GREEN
+ else
+ Display --indent 2 --text "- Checking xxx..." --result WARNING --color RED
+ ReportSuggestion ${TEST_NO} "This is a suggestion"
+ ReportWarning ${TEST_NO} "M" "This is a medium level warning"
+ fi
+ fi
+#
+#################################################################################
+#
+
+# Wait for keypress (unless --quick is being used)
+wait_for_keypress
+
+#EOF