Giter Club home page Giter Club logo

dssp2-minimal's Introduction

Minimal Defensec SELinux Security Policy Version 2

Introduction

Minimal DSSP (Version2) was designed to provide a template to build the widest array of configurations on top of that address custom access control challenges. A delicate balance was struck to provide just enough tooling to allow one to focus on productivity by making as little assumptions as possible about specific use cases.

A comprehensive set of optional templates, class mappings, class permissions and macros are provided by default to encourage efficient, consistent, and self documenting policy configuration.

Leverages Common Intermediate Language

Common Intermediate Language is a language that is native to SELinux and that implements functionality inspired by popular features of Tresys Reference policy without the need for a pre-processor.

The source policy oriented nature of CIL provides enhanced accessibility and modularity. Text-based configuration makes it easier to resolve dependencies and to profile.

New language features allow authors to focus on creativity and productivity. Clear and simple syntax makes it easy to parse and generate security policy.

Requirements

DSSP requires semodule or secilc version 2.4 and higher.

SELinux should be enabled in the Linux kernel, your file systems should support security extended attributes and this support should be enabled in the Linux kernel.

Installation

git clone --recurse https://github.com/defensec/dssp2-minimal
cd dssp2-minimal
make install-semodule
cat > /etc/selinux/config <<EOF
SELINUX=enforcing
SELINUXTYPE=dssp2-minimal
EOF
echo "-F" > /.autorelabel
reboot

Known issues

Various systemd socket units and systemd-tmpfiles configuration snippets may refer to /var/run instead of /run and this causes them to create content with the wrong security context.

Fedora:

cp /usr/lib/tmpfiles.d/pam.conf /etc/tmpfiles.d/ && \
	sed -i 's/\/var\/run/\/run/' /etc/tmpfiles.d/pam.conf

cp /usr/lib/tmpfiles.d/libselinux.conf /etc/tmpfiles.d/ && \
	sed -i 's/\/var\/run/\/run/' /etc/tmpfiles.d/libselinux.conf

Debian:

cp /usr/lib/tmpfiles.d/sshd.conf /etc/tmpfiles.d/
	sed -i 's/\/var\/run/\/run/' /etc/tmpfiles.d/sshd.conf

cp /lib/systemd/system/dbus.socket /etc/systemd/system/
	sed -i 's/\/var\/run/\/run/' /etc/systemd/system/dbus.socket

cp /lib/systemd/system/avahi-daemon.socket /etc/systemd/system/
	sed -i 's/\/var\/run/\/run/' /etc/systemd/system/avahi-daemon.socket

Getting started with Hello World!

echo "Hello World! from: `id -Z`" > /usr/local/bin/helloworld.sh
chmod +x /usr/local/bin/helloworld.sh
cat > helloworld.cil <<EOF
(block helloworld
    (blockinherit system_agent_template)

    (typepermissive subj)

    (filecon "/usr/bin/helloworld\.sh" file cmd_file_context)
)
(in sys
    (call helloworld.auto_subj_type_transition
        (
            isid
        )
    )
)
EOF
semodule -i helloworld.cil
restorecon /usr/local/bin/helloworld.sh
helloworld.sh

Resources

dssp2-minimal's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.