# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-EXTRA_CFLAGS := -I${PWD}/include
+CONFIG_AUDITTRAIL = m
+export CONFIG_AUDITTRAIL
-obj-m = audit-trail.o
-
-audit-trail-objs = \
- src/main.o
+obj-y = audittrail/
all:
$(MAKE) -C ${KERNEL_DEV_PATH} M=${PWD} modules
install:
- @cp audit-trail.ko ${KERNEL_MOD_PATH}/.
+ @cp audittrail/*.ko ${KERNEL_MOD_PATH}/.
clean:
$(MAKE) -C ${KERNEL_DEV_PATH} M=${PWD} clean
--- /dev/null
+config AUDITTRAIL
+ boolean "Enable Audit trail collector"
+ depends on SECURITYFS
+ default y
+ help
+ This option enables a system to collect various kinds of audit trail
+ (audit log). It has a directory which has two files.
+ First file is used for sending some commands such as registering
+ process itself as a consumer or provider.
+ Second files is used for getting or putting audit logs as a consumer
+ or provider.
--- /dev/null
+obj-$(CONFIG_AUDITTRAIL) = audittrail.o
+audittrail-objs += main.o
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+#ifndef __AUDITTRAIL_LOG_H__
+#define __AUDITTRAIL_LOG_H__
+
+#include <linux/printk.h>
+
+#define LOG_TAG "audit-trail: "
+
+#define FMT(fmt) fmt
+#define AUDITTRAIL_ERROR(fmt, ...) \
+ printk(KERN_ERR LOG_TAG FMT(fmt), ##__VA_ARGS__)
+#define AUDITTRAIL_WARN(fmt, ...) \
+ printk(KERN_WARNING LOG_TAG FMT(fmt), ##__VA_ARGS__)
+#define AUDITTRAIL_INFO(fmt, ...) \
+ printk(KERN_INFO LOG_TAG FMT(fmt), ##__VA_ARGS__)
+
+#endif //! __AUDITTRAIL_LOG_H__
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+#include <linux/module.h>
+
+#include "log.h"
+
+int audittrail_init(void)
+{
+ AUDITTRAIL_INFO("loaded");
+
+ return 0;
+}
+
+void audittrail_exit(void)
+{
+ AUDITTRAIL_INFO("unloaded");
+}
+
+module_init(audittrail_init);
+module_exit(audittrail_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Sungbae Yoo");
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-#ifndef __AUDIT_LOG_H__
-#define __AUDIT_LOG_H__
-
-#include <linux/printk.h>
-
-#define LOG_TAG "audit: "
-
-#define FMT(fmt) fmt
-#define AUDIT_ERROR(fmt, ...) \
- printk(KERN_ERR LOG_TAG FMT(fmt), ##__VA_ARGS__)
-#define AUDIT_WARN(fmt, ...) \
- printk(KERN_WARNING LOG_TAG FMT(fmt), ##__VA_ARGS__)
-#define AUDIT_INFO(fmt, ...) \
- printk(KERN_INFO LOG_TAG FMT(fmt), ##__VA_ARGS__)
-
-#endif //! __AUDIT_LOG_H__
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-#include <linux/module.h>
-
-#include "log.h"
-
-int audit_trail_init(void)
-{
- AUDIT_INFO("loaded");
-
- return 0;
-}
-
-void audit_trail_exit(void)
-{
- AUDIT_INFO("unloaded");
-}
-
-module_init(audit_trail_init);
-module_exit(audit_trail_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Sungbae Yoo");