diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2017-08-24 17:21:52 +0800 |
---|---|---|
committer | Lans Zhang <lans.zhang2008@gmail.com> | 2017-08-24 17:21:52 +0800 |
commit | 90fd1b523ad58a461de418bdbd97956e29897188 (patch) | |
tree | 0d1f737327ebb411b9396b125bde0a57d42ca840 | |
parent | c41b36ea73a25607d1fd1e9dc29ef6faf2be1be1 (diff) | |
download | meta-secure-core-90fd1b523ad58a461de418bdbd97956e29897188.tar.gz |
meta-ids: initial commit for IDS support (#11)
* Add new layer for IDS support
* Add package mtree to provide basic IDS functions
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
-rw-r--r-- | meta-ids/COPYING.MIT | 17 | ||||
-rw-r--r-- | meta-ids/README.md | 9 | ||||
-rw-r--r-- | meta-ids/conf/layer.conf | 14 | ||||
-rw-r--r-- | meta-ids/recipes-base/packagegroups/packagegroup-ids.bb | 12 | ||||
-rw-r--r-- | meta-ids/recipes-ids/mtree/mtree/configure.ac-automake-error.patch | 35 | ||||
-rw-r--r-- | meta-ids/recipes-ids/mtree/mtree/mtree-getlogin.patch | 49 | ||||
-rw-r--r-- | meta-ids/recipes-ids/mtree/mtree_git.bb | 21 |
7 files changed, 157 insertions, 0 deletions
diff --git a/meta-ids/COPYING.MIT b/meta-ids/COPYING.MIT new file mode 100644 index 0000000..89de354 --- /dev/null +++ b/meta-ids/COPYING.MIT | |||
@@ -0,0 +1,17 @@ | |||
1 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
2 | of this software and associated documentation files (the "Software"), to deal | ||
3 | in the Software without restriction, including without limitation the rights | ||
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
5 | copies of the Software, and to permit persons to whom the Software is | ||
6 | furnished to do so, subject to the following conditions: | ||
7 | |||
8 | The above copyright notice and this permission notice shall be included in | ||
9 | all copies or substantial portions of the Software. | ||
10 | |||
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
17 | THE SOFTWARE. | ||
diff --git a/meta-ids/README.md b/meta-ids/README.md new file mode 100644 index 0000000..e5901aa --- /dev/null +++ b/meta-ids/README.md | |||
@@ -0,0 +1,9 @@ | |||
1 | ### Intrusion Detection System (IDS) | ||
2 | This layer provides functions for Intrusion Detection System (IDS) achievement. | ||
3 | |||
4 | #### MTREE | ||
5 | The mtree utility compares the file hierarchy rooted in the current directory | ||
6 | against a specification read from the standard input. Messages are written | ||
7 | to the standard output for any files whose characteristics do not match the | ||
8 | specifications, or which are missing from either the file hierarchy or the | ||
9 | specification. | ||
diff --git a/meta-ids/conf/layer.conf b/meta-ids/conf/layer.conf new file mode 100644 index 0000000..1f2e0a6 --- /dev/null +++ b/meta-ids/conf/layer.conf | |||
@@ -0,0 +1,14 @@ | |||
1 | # We have a conf and classes directory, add to BBPATH | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | # We have recipes-* directories, add to BBFILES | ||
5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
6 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
7 | |||
8 | BBFILE_COLLECTIONS += "ids" | ||
9 | BBFILE_PATTERN_ids = "^${LAYERDIR}/" | ||
10 | BBFILE_PRIORITY_ids = "10" | ||
11 | |||
12 | BBLAYERS_LAYERINDEX_NAME_ids = "meta-ids" | ||
13 | |||
14 | LAYERDEPENDS_ids = "core" | ||
diff --git a/meta-ids/recipes-base/packagegroups/packagegroup-ids.bb b/meta-ids/recipes-base/packagegroups/packagegroup-ids.bb new file mode 100644 index 0000000..8f79c7a --- /dev/null +++ b/meta-ids/recipes-base/packagegroups/packagegroup-ids.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | DESCRIPTION = "Packagegroup for Intrusion Detection System (IDS) utilities." | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "\ | ||
4 | file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | ||
5 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ | ||
6 | " | ||
7 | |||
8 | inherit packagegroup | ||
9 | |||
10 | RDEPENDS_${PN} += "\ | ||
11 | mtree \ | ||
12 | " | ||
diff --git a/meta-ids/recipes-ids/mtree/mtree/configure.ac-automake-error.patch b/meta-ids/recipes-ids/mtree/mtree/configure.ac-automake-error.patch new file mode 100644 index 0000000..41d9025 --- /dev/null +++ b/meta-ids/recipes-ids/mtree/mtree/configure.ac-automake-error.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 72916bebc694b821fd35f8721937fdd691049e3e Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Tue, 5 Aug 2014 21:48:17 -0700 | ||
4 | Subject: [PATCH] configure.ac: fixed automake error | ||
5 | |||
6 | Fixed: | ||
7 | configure.ac:29: installing 'scripts/compile' | ||
8 | Makefile.am: error: required file './NEWS' not found | ||
9 | Makefile.am: error: required file './AUTHORS' not found | ||
10 | Makefile.am: error: required file './ChangeLog' not found | ||
11 | autoreconf: automake failed with exit status: 1 | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | |||
15 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
16 | --- | ||
17 | configure.ac | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/configure.ac b/configure.ac | ||
21 | index bf228df..dc10bff 100644 | ||
22 | --- a/configure.ac | ||
23 | +++ b/configure.ac | ||
24 | @@ -6,7 +6,7 @@ | ||
25 | |||
26 | AC_INIT([mtree Utility for creating and verifying file hierarchies], [1.0.2], [http://www.freebsd.org/], [mtree]) | ||
27 | AC_CONFIG_AUX_DIR(scripts) | ||
28 | -AM_INIT_AUTOMAKE | ||
29 | +AM_INIT_AUTOMAKE([foreign]) | ||
30 | dnl AM_MAINTAINER_MODE | ||
31 | AC_PREREQ(2.59) | ||
32 | AC_REVISION($Id: configure.ac 15 2013-05-30 15:29:35Z archie.cobbs $) | ||
33 | -- | ||
34 | 1.7.9.5 | ||
35 | |||
diff --git a/meta-ids/recipes-ids/mtree/mtree/mtree-getlogin.patch b/meta-ids/recipes-ids/mtree/mtree/mtree-getlogin.patch new file mode 100644 index 0000000..35b0f8d --- /dev/null +++ b/meta-ids/recipes-ids/mtree/mtree/mtree-getlogin.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Handle NULL return from getlogin. | ||
4 | |||
5 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
6 | --- | ||
7 | diff --git a/create.c b/create.c | ||
8 | index e2d24d3..583af9b 100644 | ||
9 | --- a/create.c | ||
10 | +++ b/create.c | ||
11 | @@ -77,6 +77,29 @@ static void output(int, int *, const char *, ...) __attribute__ ((__format__ | ||
12 | static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); | ||
13 | static void statf(int, FTSENT *); | ||
14 | |||
15 | +char *my_getlogin() | ||
16 | +{ | ||
17 | + const char *s = getlogin(); | ||
18 | + if (s && *s) | ||
19 | + return s; | ||
20 | + | ||
21 | + struct passwd *p = getpwuid(geteuid()); | ||
22 | + char *ss; | ||
23 | + if (p && p->pw_name) { | ||
24 | + if (asprintf(&ss,"(no controlling terminal) %s",p->pw_name) < 0) { | ||
25 | + perror("asprintf"); | ||
26 | + return NULL; | ||
27 | + } | ||
28 | + } else { | ||
29 | + if (asprintf(&ss,"(no controlling terminal) #%d",geteuid()) < 0) { | ||
30 | + perror("asprintf"); | ||
31 | + return NULL; | ||
32 | + } | ||
33 | + } | ||
34 | + | ||
35 | + return ss; | ||
36 | +} | ||
37 | + | ||
38 | void | ||
39 | cwalk(void) | ||
40 | { | ||
41 | @@ -92,7 +115,7 @@ cwalk(void) | ||
42 | (void)gethostname(host, sizeof(host)); | ||
43 | (void)printf( | ||
44 | "#\t user: %s\n#\tmachine: %s\n", | ||
45 | - getlogin(), host); | ||
46 | + my_getlogin(), host); | ||
47 | (void)printf( | ||
48 | "#\t tree: %s\n#\t date: %s", | ||
49 | fullpath, ctime(&cl)); | ||
diff --git a/meta-ids/recipes-ids/mtree/mtree_git.bb b/meta-ids/recipes-ids/mtree/mtree_git.bb new file mode 100644 index 0000000..27fae3c --- /dev/null +++ b/meta-ids/recipes-ids/mtree/mtree_git.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | SUMMARY = "BSD directory hierarchy mapping tool" | ||
2 | DESCRIPTION = "mtree compares a file hierarchy against a specification, creates a specification for a file hierarchy, or modifies a specification." | ||
3 | |||
4 | SECTION = "utils" | ||
5 | |||
6 | LICENSE = "BSD" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=bb19ea4eac951288efda4010c5c669a8" | ||
8 | |||
9 | PV = "1.0.3+git${SRCPV}" | ||
10 | |||
11 | SRC_URI = "git://github.com/archiecobbs/mtree-port.git \ | ||
12 | file://mtree-getlogin.patch \ | ||
13 | file://configure.ac-automake-error.patch \ | ||
14 | " | ||
15 | SRCREV = "4f3e901aea980fc9a78ac8692fa12a22328b1d4a" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | DEPENDS = "openssl" | ||
20 | |||
21 | inherit autotools | ||