Bug 3867 - Add Bastille Linux Support to Yocto
Summary: Add Bastille Linux Support to Yocto
Status: VERIFIED WORKSFORME
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: High enhancement
Target Milestone: 1.5 M4
Assignee: mulhern
QA Contact:
URL:
Whiteboard:
: 4208 (view as bug list)
Depends on:
Blocks: 4660
  Show dependency tree
 
Reported: 2013-02-07 21:46 UTC by Scott Garman
Modified: 2013-10-01 14:21 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Garman 2013-02-07 21:46:26 UTC
This is a feature request to add Bastille Linux support to Yocto. Bastille includes a set of (perl) scripts to analyze and report recomended best security practices.

This is a matter of adding a recipe for Bastille to Yocto - assuming it may not make it into oe-core, I've filed this bug against meta-yocto.
Comment 1 Saul Wold 2013-04-08 14:31:04 UTC
*** Bug 4208 has been marked as a duplicate of this bug. ***
Comment 2 Dave Stewart 2013-04-08 14:43:08 UTC
I'm adding the comments I made on 4208, so it's clear that the work is more than adding a recipe.

We should adopt a tool like Bastille Linux as part of the build system (perhaps an optional part).

Bastille can be run against a running Linux system to identify common backdoors and security holes.

A recipe probably needs to be developed plus a method for running it as part of the sanity test. Then there should be an easy way for developers using Yocto to run Bastille as a QA pass on their device.

This enhancement should be marked HIGH (P1) for the 1.5 release
Comment 3 Andrei Dinu 2013-07-25 14:47:51 UTC
Bastille can be found in :

http://git.yoctoproject.org/cgit/cgit.cgi/meta-security

under /recipes-security/bastille
Comment 4 Stoicescu Cornel 2013-07-31 14:19:20 UTC
At the moment Bastille does not work. When trying to use the file permissions modifying module, /var/log/Bastille/error-log reports:

{Wed Jul 31 15:21:08 2013} ERROR Didn't carry out general permissions
         modifications as they are very specific to Red Hat / Mandrake
Comment 5 Stoicescu Cornel 2013-08-06 10:03:59 UTC
This needs more work:
- Distribution checker must be disabled
- Poky Irrelevant questions must be removed from the form (bastille -c). We should make it contain only changes relevant to poky's features. This can be done through a patch and scaled to contain new features by adding a patch for Bastille in the layers that add that feature.

Reopening.
Comment 6 Stoicescu Cornel 2013-08-20 14:58:25 UTC
"Distribution checker must be disabled" refers to the error described in the second above comment:

{Wed Jul 31 15:21:08 2013} ERROR Didn't carry out general permissions
         modifications as they are very specific to Red Hat / Mandrake
Comment 7 mulhern 2013-08-26 14:09:06 UTC
Some of these problems and also #4660 problems addressed in:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=mulhern/bastille-final.

Comment 5
The config file is used as a reference indicating what are the relevant poky questions. Now, editing the config file before a build will automatically update Bastille's questions files so that the questions it believes are required will
exactly match those in the config file.

At the moment Bastille itself, i.e., the code that is downloaded, continues to be
comprehensively broken. The comment (4) problem is probably just one of very many.
Comment 8 mulhern 2013-08-30 20:18:07 UTC
CCB has approved decision not to fix because of low quality of Bastille source.
Comment 9 mulhern 2013-08-30 21:23:47 UTC
http://git.yoctoproject.org/cgit/cgit.cgi/meta-security/commit/?id=5ec81ec5b117de41ed56eb05df271f103213d7be

The changes have been committed and are at the URL above.
Comment 10 Stoicescu Cornel 2013-09-12 12:03:27 UTC
Cannot install bastille using:
poky master:bd76847d867f9f76f76f033439cfb834cf59380f
meta-security master:23815f300174ce6cab48356e3fffba9868b626d4

Error as follows:
DEBUG: Executing shell function do_install
Fatal error reading config file: [Errno 13] Permission denied: '/home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/Bastille/Questions/AccountSecurity.txt'
WARNING: /home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/temp/run.do_install.12528:1 exit 1 from
  /home/cornel/work/poky/meta-security/recipes-security/bastille/files/set_required_questions.py /home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/config Questions
ERROR: Function failed: do_install (log file is located at /home/cornel/work/poky/build/tmp/work/qemux86_64-poky-linux/bastille/3.2.1-r0/temp/log.do_install.12528)

Even though this is marked as WONTFIX, should I reopen or open a new bug?
Comment 11 mulhern 2013-09-13 00:05:55 UTC
It should install, so if it is not installing it is a bug and should be taken care of.

The error [Errno 13] is pretty specific. The program found the Account Security.txt file, but could not open it for reading. I can't reproduce the problem, because the necessary r bit is set for that file on my machine.

So, either it's a transient problem, or something exciting and new is happening to permission bits in the work directory, or you're using a variant of Python that takes a different view of file permissions.

If you can reproduce please make sure to find out as much as you can about the actual permission bits of the file and of the version of Python you're using.
Hopefully, it will turn out to be a transient problem, though.
Comment 12 Stoicescu Cornel 2013-09-13 07:54:26 UTC
Bug 5177 opened for install issue. Because of this bug, I was not able to Verify this in 1.5 M4.
Comment 13 Stoicescu Cornel 2013-10-01 14:21:02 UTC
Install issues cleared. The bastille package has seen some improvements. Setting this to VERIFIED as per comments in bug 4660.