Commit Graph

5442 Commits

Author SHA1 Message Date
Topi Miettinen 25f29bcfa4
gennetfilter: generate nft tables with --nft
Optionally generate Netfilter NFT tables. Sample output:

```#!/usr/sbin/nft -f
flush ruleset
table inet security {
        secmark default_input_packet {
                "system_u:object_r:server_packet_t:s0"
        }
        secmark default_output_packet {
                "system_u:object_r:client_packet_t:s0"
        }
        secmark afs_bos_input {
                "system_u:object_r:afs_bos_server_packet_t:s0"
        }
        secmark afs_bos_output {
                "system_u:object_r:afs_bos_client_packet_t:s0"
        }
...
        chain INPUT {
                type filter hook input priority 0; policy accept;
                ct state new meta secmark set "default_input_packet"
                ct state new udp dport 7007 meta secmark set "afs_bos_input"
...
                ct state new ct secmark set meta secmark
                ct state established,related meta secmark set ct secmark
        }
        chain FORWARD {
                type filter hook forward priority 0; policy accept;
        }
        chain OUTPUT {
                type filter hook output priority 0; policy accept;
                ct state new meta secmark set "default_output_packet"
                ct state new udp dport 7007 meta secmark set "afs_bos_output"
...
                ct state new ct secmark set meta secmark
                ct state established,related meta secmark set ct secmark
        }
}
```

The labels are applied to TCP and/or UDP as needed. MCS and MLS are
not really handled.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-04-16 23:46:02 +03:00
Chris PeBenito 766dedecdd
Merge pull request #227 from topimiettinen/python-string-fix
Python string fix
2020-04-16 16:32:52 -04:00
Chris PeBenito f028ac96fc dbus, dpm2: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-16 16:27:55 -04:00
Chris PeBenito ea9901968b Merge pull request #208 from dsugar100/tpm2_labeling 2020-04-16 16:27:30 -04:00
Dave Sugar 8f5cbc7779 Setup domain for tpm2_* binaries
The various /bin/tpm2_* binaries use dbus to communicate
with tpm2-abrmd and also can directly access /dev/tpmrm0.  This
seems like a way to help limit access to the TPM by running the
tpm_* binaries in their own domain.

I setup this domain because I have a process that needs to use
tpm2_hmac to encode something, but didn't want that domain to
have direct access to the TPM.  I did some basic testing to verify
that the other tpm2_* binaries have basically the same access needs.
But it wasn't through testing of all the tpm2_* binaries.

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-04-16 15:40:09 -04:00
Chris PeBenito 551a61d3ee
Merge pull request #226 from dsugar100/master
fix require from 5b78c1c86b
2020-04-16 11:23:16 -04:00
Chris PeBenito 91e55bf200
Merge pull request #219 from fishilico/vagrantfile-remove-older-modules-before-make-install
Vagrantfile: remove older installed modules before "make install"
2020-04-16 11:02:39 -04:00
Chris PeBenito 78b3e6654d
Merge pull request #222 from cgzones/ign_doc_tmp
Ignore temporary documentation file directory in git
2020-04-16 11:01:18 -04:00
Topi Miettinen fb120dd8df
Python string fix
Use raw string constants to avoid errors from python3.8:
    NETPORT = re.compile("^network_port\(\s*\w+\s*(\s*,\s*\w+\s*,\s*\w+\s*,\s*\w+\s*)+\s*\)\s*(#|$)")
                         ^
SyntaxError: invalid escape sequence \(

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-04-16 13:04:30 +03:00
Dave Sugar fd19ce9e91 fix require from 5b78c1c86b
Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-04-15 22:59:07 -04:00
Christian Göttsche 988eb4d690 Ignore temporary documentation file directory in git
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2020-04-15 11:56:29 +02:00
Nicolas Iooss 2b2b5bad06
Vagrantfile: remove older installed modules before "make install"
When testing issues in older versions of refpolicy (for example when
git-bisecting a regression), the newer policy modules are kept in
/usr/share/selinux/refpolicy/ and trigger errors when they fail to be
loaded by "semodule -s refpolicy -i /usr/share/selinux/refpolicy/*.pp".

Avoid this situation by removed old modules from
/usr/share/selinux/refpolicy/ before running "make install".

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2020-04-14 22:09:54 +02:00
Chris PeBenito acd45b66b4 mozilla, mailman, init, modutils: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-14 14:16:49 -04:00
Chris PeBenito 782cd81a4b Merge pull request #217 from bauen1/init-confined-keyring 2020-04-14 14:08:18 -04:00
Chris PeBenito 504f931980 Merge pull request #216 from bauen1/fix-modutils-nnp 2020-04-14 14:08:16 -04:00
Chris PeBenito 499c73dc95 Merge pull request #215 from bauen1/fix-unescaped-dot 2020-04-14 14:08:14 -04:00
Chris PeBenito 4a791a08b8 Merge pull request #214 from bauen1/firefox 2020-04-14 14:08:11 -04:00
Chris PeBenito 56d02b82d0 Merge pull request #213 from cgzones/make_clean 2020-04-14 14:08:03 -04:00
Christian Göttsche 82a8b7bfb7 Makefile: generate temporary documentation files in separate directory
Use a separate directory for files generated my 'make conf', so the clean targets from Rules.* do not remove them.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2020-04-14 19:42:41 +02:00
bauen1 f6ca80e336
allow init_t to link kernel_t key
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-04-14 19:37:57 +02:00
bauen1 67f1b6b455
allow init_t access to own keyring
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-04-14 19:37:53 +02:00
bauen1 69a05282df
fix unescaped dot introduced by 47b44a0fc7
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-04-14 19:36:25 +02:00
bauen1 2e4ac459fa
modutils: allow init to execute kmod with nnp
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-04-14 19:35:35 +02:00
bauen1 a4903dbf5b
mozilla: allow firefox to use user namespaces for sandboxing
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-04-14 19:34:54 +02:00
Chris PeBenito 41963e7116 init, devicekit: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 10:12:38 -04:00
Chris PeBenito eb5fa6e1eb Merge pull request #212 from topimiettinen/deny-generic-files-in-dev 2020-04-09 10:12:01 -04:00
Chris PeBenito 5a9e52f328 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 09:41:05 -04:00
Chris PeBenito 5dbdce80f5 pulseaudio: Drop call to nonexistant interface.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 09:40:22 -04:00
Chris PeBenito d823a4c661 spamassassin: Remove unnecessary brackets in type alias.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 09:34:57 -04:00
Chris PeBenito 5b78c1c86b spamassassin: Add missing class requires in systemd interfaces.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 09:34:02 -04:00
Chris PeBenito 4cff02edd2 spamassassin: Rename systemd interfaces.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 09:33:07 -04:00
Chris PeBenito b2b385891d spamassassin: Move systemd interfaces.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 09:32:25 -04:00
Russell Coker 47b44a0fc7 latest ver of trivial mail server patch
Yes mmap is the standard way of accessing the mail spool.

Removed spamd_gpg_t because there's no point to it, the separation doesn't
provide an actual benefit.

Made the other requested changes.

Signed-off-by: Russell Coker <russell@coker.com.au>
2020-04-09 09:29:10 -04:00
Russell Coker 886aa39bfb pulseaudio patch
Patch for pulseaudio against latest GIT

Signed-off-by: Russell Coker <russell@coker.com.au>
2020-04-09 09:26:31 -04:00
Topi Miettinen 8982ce5945
Don't allow creating regular files in /dev
Init, init scripts and udisks don't need to be able to create regular
files in /dev.

Thanks to Jarkko Sakkinen for the idea.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-04-07 23:03:16 +03:00
Chris PeBenito a2ec18d2a3 dbus, systemd: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-06 11:40:56 -04:00
Chris PeBenito ba3818ebcc dbus: Rename tunable to dbus_pass_tuntap_fd.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-06 11:40:02 -04:00
Chris PeBenito 85f3e8efe6 Merge pull request #210 from bauen1/fixup-systemd-user-runtime-dir 2020-04-06 10:50:57 -04:00
Chris PeBenito f5646b7e75 Merge pull request #209 from dsommers/dbus-can-tuntap-2 2020-04-06 10:50:26 -04:00
bauen1 ca0bcb0b51
systemd-user-runtime-dir: add required permissions
systemd-user-runtime-dir reads /proc/sys/kernel/osrelease and the
selinux config
2020-04-04 16:56:19 +02:00
David Sommerseth 79c7859a48
dbus: Add tunable - dbus_can_pass_tuntap_fd
D-Bus services wanting to pass file descriptors for
tun/tap devices need to read/write privileges to /dev/tun.

Without this privilege the following denial will happen:

    type=AVC msg=audit(1582227542.557:3045): avc:  denied  { read write } for  pid=1741 comm="dbus-daemon" path="/dev/net/tun" dev="devtmpfs" ino=486 scontext=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tun_tap_device_t:s0 tclass=chr_file permissive=0

This is needed by OpenVPN 3 Linux, where an unprivileged
process (openvpn3-service-client) requests a tun device
from a privileged service (openvpn3-service-netcfg) over
the D-Bus system bus.

GitHub-Issue: #190
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-04-02 22:40:00 +02:00
Chris PeBenito d38afda010 Makefile: Remove shell brace expansion in ctags target.
This doesn't work on dash, the default shell on Debian.

Closes #110

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-01 15:01:50 -04:00
Chris PeBenito eff4494519 corecommands, init, lvm, systemd: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-01 13:15:28 -04:00
Chris PeBenito a78ba97105 Merge pull request #197 from dsugar100/generator 2020-04-01 13:14:03 -04:00
Dave Sugar ea2dc052c7 Setup generic generator attribute and change generator types.
I'm seeing problems on RHEL7 with lvm2-activation-generator that are
coming from recent changes to put systemd-fstab-generator into it's
own domain.  I resolved the issues by creaing this generator attribute
to grant common generator permissions and move all generators into
a single systemd_generator_t domain.

Then setup specific types for the following generators:
lvm2-activation-generator - needs to read lvm2 config
systemd-sysv-generator - needs to read stuff in init_t that other generators don't.
systemd-efi-boot-generator -  needs to read stuff on the EFI boot partition labeled boot_t

For fstab generator allow it to write /sys

[   19.482951] type=1400 audit(1584548691.268:7): avc:  denied  { write } for  pid=1638 comm="systemd-fstab-g" name="/" dev="sysfs" ino=1 Allow scontext=system_u:system_r:systemd_fstab_generator_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1

audit(1585500099.139:6): avc:  denied  { read } for  pid=1635 comm="systemd-cryptse" path="/run/systemd/generator/dev-mapper-luks\x2d6a613af0\x2d0a61\x2d462f\x2d8679\x2d1b0d964fbc88.device.d/.#90-device-timeout.confsOskdU" dev="tmpfs" ino=12243 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:init_runtime_t:s0 tclass=file permissive=1
audit(1585500099.139:7): avc:  denied  { setattr } for  pid=1635 comm="systemd-cryptse" name=".#90-device-timeout.confsOskdU" dev="tmpfs" ino=12243 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:init_runtime_t:s0 tclass=file permissive=1
audit(1585500099.139:8): avc:  denied  { rename } for  pid=1635 comm="systemd-cryptse" name=".#90-device-timeout.confsOskdU" dev="tmpfs" ino=12243 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:init_runtime_t:s0 tclass=file permissive=1

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-03-31 22:54:41 -04:00
Chris PeBenito 07c77bf481 Merge pull request #202 from cgzones/build_misc 2020-03-31 14:08:48 -04:00
Chris PeBenito 2effe84e27 systemd: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-03-31 14:06:26 -04:00
Chris PeBenito 581062e28d Merge pull request #206 from cgzones/genfs_seclabel_symlinks 2020-03-31 14:05:59 -04:00
Chris PeBenito 991b366047 Merge pull request #205 from dburgener/template-to-interface 2020-03-31 14:05:47 -04:00
Chris PeBenito 4a5d656ee6 Merge pull request #204 from dburgener/systemd-coredump-mountpoint 2020-03-31 14:05:32 -04:00