├── lab10-systemd
├── testprog.if
├── testprog.fc
├── testprog.te
└── README.md
├── lab11-interfaces
├── testcat.if
├── testcat.fc
├── testcat.te
└── README.md
├── .gitignore
├── lab09-putting-it-all-together
├── testprog.if
├── testprog.fc
├── testprog.te
└── README.md
├── testprog
├── testprog.conf
├── testprog.service
├── Makefile
└── testprog.c
├── lab05-file-contexts
├── testprog.fc
├── testprog.te
└── README.md
├── lab12-interfaces-part-2
├── testcat.fc
├── testprog.fc
├── testprog.if
├── testcat.te
├── testprog.te
└── README.md
├── lab13-interfaces-part-3
├── testcat.fc
├── testprog.fc
├── testprog.if
├── testcat.te
├── testprog.te
└── README.md
├── testprog-net
├── testprog-net.conf
├── testprog-net.service
├── Makefile
└── testprog-net.c
├── lab16-booleans
├── testprog.fc
├── testprog.if
├── testprog.te
└── README.md
├── lab14-networking
├── testprog.fc
├── testprog.if
├── testprog.te
└── README.md
├── lab15-allowing-networking
├── testprog.fc
├── testprog.if
├── testprog.te
└── README.md
├── LICENSE
├── lab04-targeting-testprog
├── testprog.te
└── README.md
├── lab02-the-testprog
└── README.md
├── lab01-up-and-running
└── README.md
├── README.md
├── CODE_OF_CONDUCT.md
├── lab08-about-macros
└── README.md
├── lab07-finding-examples
└── README.md
├── lab06-sealert-and-audit-log
└── README.md
└── lab03-running-testprog-for-the-first-time
└── README.md
/lab10-systemd/testprog.if:
--------------------------------------------------------------------------------
1 | ##
2 |
--------------------------------------------------------------------------------
/lab11-interfaces/testcat.if:
--------------------------------------------------------------------------------
1 | ##
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | testprog/testprog
2 | testprog-net/testprog-net
3 |
4 |
--------------------------------------------------------------------------------
/lab09-putting-it-all-together/testprog.if:
--------------------------------------------------------------------------------
1 | ##
2 |
--------------------------------------------------------------------------------
/lab11-interfaces/testcat.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testcat -- system_u:object_r:testcat_exec_t:s0
2 |
--------------------------------------------------------------------------------
/testprog/testprog.conf:
--------------------------------------------------------------------------------
1 | OUTPUTFILE=/var/testprog/testprg.txt
2 | LOOPCOUNT=-1
3 |
4 |
--------------------------------------------------------------------------------
/lab05-file-contexts/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog -- system_u:object_r:testprog_exec_t:s0
2 |
--------------------------------------------------------------------------------
/lab12-interfaces-part-2/testcat.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testcat -- system_u:object_r:testcat_exec_t:s0
2 |
--------------------------------------------------------------------------------
/lab13-interfaces-part-3/testcat.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testcat -- system_u:object_r:testcat_exec_t:s0
2 |
--------------------------------------------------------------------------------
/testprog-net/testprog-net.conf:
--------------------------------------------------------------------------------
1 | OUTPUTFILE=/var/testprog/testprg-net.txt
2 | LOOPCOUNT=-1
3 | NETWORKPORT=0
4 |
--------------------------------------------------------------------------------
/lab10-systemd/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog -- system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog.conf -- system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/lab12-interfaces-part-2/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog -- system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog.conf -- system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/lab13-interfaces-part-3/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog -- system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog.conf -- system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/lab09-putting-it-all-together/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog -- system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog.conf -- system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog.pid -- system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/lab16-booleans/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog(.*)? system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog(.*)?.conf system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog(.*).pid system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog(.*).pid system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/lab14-networking/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog(.*)? system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog(.*)?.conf system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog(.*).pid system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog(.*).pid system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/lab15-allowing-networking/testprog.fc:
--------------------------------------------------------------------------------
1 | /usr/bin/testprog(.*)? system_u:object_r:testprog_exec_t:s0
2 | /etc/testprog(.*)?.conf system_u:object_r:testprog_conf_t:s0
3 | /var/run/testprog(.*).pid system_u:object_r:testprog_var_run_t:s0
4 | /run/testprog(.*).pid system_u:object_r:testprog_var_run_t:s0
5 | /var/testprog(/.*)? system_u:object_r:testprog_data_t:s0
6 |
--------------------------------------------------------------------------------
/testprog/testprog.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=SELinux Test Program
3 |
4 | [Service]
5 | #Type=forking
6 | # The PID file is optional, but recommended in the manpage
7 | # "so that systemd can identify the main process of the daemon"
8 | PIDFile=/var/run/testprog.pid
9 | ExecStart=/usr/bin/testprog /etc/testprog.conf /var/run/testprog.pid
10 |
11 | [Install]
12 | WantedBy=multi-user.target
13 |
--------------------------------------------------------------------------------
/testprog-net/testprog-net.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=SELinux Test Program with Networking
3 |
4 | [Service]
5 | #Type=forking
6 | # The PID file is optional, but recommended in the manpage
7 | # "so that systemd can identify the main process of the daemon"
8 | PIDFile=/var/run/testprog-net.pid
9 | ExecStart=/usr/bin/testprog-net /etc/testprog-net.conf /var/run/testprog-net.pid
10 |
11 | [Install]
12 | WantedBy=multi-user.target
13 |
--------------------------------------------------------------------------------
/lab14-networking/testprog.if:
--------------------------------------------------------------------------------
1 | ########################################
2 | ###
3 | ### Read testprog data files.
4 | ###
5 | ###
6 | ###
7 | ### Domain allowed to read the data files.
8 | ###
9 | ###
10 | ##
11 | interface(`testprog_read_data',`
12 | gen_require(`
13 | type testprog_data_t;
14 | ')
15 |
16 | # Allow the domain passed as argument 1 to access the testprog data
17 | allow $1 testprog_data_t:dir { search add_name };
18 | allow $1 testprog_data_t:file { open read getattr };
19 | ')
20 |
--------------------------------------------------------------------------------
/lab16-booleans/testprog.if:
--------------------------------------------------------------------------------
1 | ########################################
2 | ###
3 | ### Read testprog data files.
4 | ###
5 | ###
6 | ###
7 | ### Domain allowed to read the data files.
8 | ###
9 | ###
10 | ##
11 | interface(`testprog_read_data',`
12 | gen_require(`
13 | type testprog_data_t;
14 | ')
15 |
16 | # Allow the domain passed as argument 1 to access the testprog data
17 | allow $1 testprog_data_t:dir { search add_name };
18 | allow $1 testprog_data_t:file { open read getattr };
19 | ')
20 |
--------------------------------------------------------------------------------
/lab12-interfaces-part-2/testprog.if:
--------------------------------------------------------------------------------
1 | ########################################
2 | ###
3 | ### Read testprog data files.
4 | ###
5 | ###
6 | ###
7 | ### Domain allowed to read the data files.
8 | ###
9 | ###
10 | ##
11 | interface(`testprog_read_data',`
12 | gen_require(`
13 | type testprog_data_t;
14 | ')
15 |
16 | # Allow the domain passed as argument 1 to access the testprog data
17 | allow $1 testprog_data_t:dir { search add_name };
18 | allow $1 testprog_data_t:file { open read getattr };
19 | ')
20 |
--------------------------------------------------------------------------------
/lab13-interfaces-part-3/testprog.if:
--------------------------------------------------------------------------------
1 | ########################################
2 | ###
3 | ### Read testprog data files.
4 | ###
5 | ###
6 | ###
7 | ### Domain allowed to read the data files.
8 | ###
9 | ###
10 | ##
11 | interface(`testprog_read_data',`
12 | gen_require(`
13 | type testprog_data_t;
14 | ')
15 |
16 | # Allow the domain passed as argument 1 to access the testprog data
17 | allow $1 testprog_data_t:dir { search add_name };
18 | allow $1 testprog_data_t:file { open read getattr };
19 | ')
20 |
--------------------------------------------------------------------------------
/lab15-allowing-networking/testprog.if:
--------------------------------------------------------------------------------
1 | ########################################
2 | ###
3 | ### Read testprog data files.
4 | ###
5 | ###
6 | ###
7 | ### Domain allowed to read the data files.
8 | ###
9 | ###
10 | ##
11 | interface(`testprog_read_data',`
12 | gen_require(`
13 | type testprog_data_t;
14 | ')
15 |
16 | # Allow the domain passed as argument 1 to access the testprog data
17 | allow $1 testprog_data_t:dir { search add_name };
18 | allow $1 testprog_data_t:file { open read getattr };
19 | ')
20 |
--------------------------------------------------------------------------------
/testprog/Makefile:
--------------------------------------------------------------------------------
1 | # References:
2 | # http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
3 | # http://nuclear.mutantstargoat.com/articles/make/
4 |
5 | CC=gcc
6 | PREFIX = /usr
7 |
8 | testprog: testprog.c
9 | $(CC) -o testprog testprog.c
10 |
11 | clean:
12 | rm -f testprog
13 |
14 | install:
15 | mkdir -p $(DESTDIR)$(PREFIX)/bin
16 | cp testprog $(DESTDIR)$(PREFIX)/bin/testprog
17 | cp testprog.conf /etc/testprog.conf
18 | mkdir -p /var/testprog
19 | cp testprog.service /etc/systemd/system/testprog.service
20 |
21 | uninstall:
22 | rm -f $(DESTDIR)$(PREFIX)/bin/testprog
23 | rm -f /etc/testprog.conf
24 | rm -f /etc/systemd/system/testprog.service
25 | rm -rf /var/testprog
26 |
27 |
--------------------------------------------------------------------------------
/testprog-net/Makefile:
--------------------------------------------------------------------------------
1 | # References:
2 | # http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
3 | # http://nuclear.mutantstargoat.com/articles/make/
4 |
5 | CC=gcc
6 | PREFIX = /usr
7 |
8 | testprog-net: testprog-net.c
9 | $(CC) -o testprog-net testprog-net.c
10 |
11 | clean:
12 | rm -f testprog-net
13 |
14 | install:
15 | mkdir -p $(DESTDIR)$(PREFIX)/bin
16 | cp testprog-net $(DESTDIR)$(PREFIX)/bin/testprog-net
17 | cp testprog-net.conf /etc/testprog-net.conf
18 | mkdir -p /var/testprog-net
19 | cp testprog-net.service /etc/systemd/system/testprog-net.service
20 |
21 | uninstall:
22 | rm -f $(DESTDIR)$(PREFIX)/bin/testprog-net
23 | rm -f /etc/testprog-net.conf
24 | rm -f /etc/systemd/system/testprog-net.service
25 | rm -rf /var/testprog-net
26 |
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 James Freeman
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/lab11-interfaces/testcat.te:
--------------------------------------------------------------------------------
1 | #
2 | # Useful references for building this policy:
3 | #
4 | # https://www.redhat.com/archives/fedora-selinux-list/2008-June/msg00076.html
5 | # https://serverfault.com/questions/628344/selinux-cannot-confine-firefox-process-to-mozilla-t-domain
6 | #
7 | #
8 | policy_module(testcat, 0.1)
9 |
10 | # Require all the types, attributes and classes we reference in this policy
11 | require {
12 | type unconfined_t;
13 | role unconfined_r;
14 | class file { ioctl getattr setattr create read write unlink open relabelto };
15 | class process transition;
16 | }
17 |
18 | # Define our new types that testcat will use, and ensure that we tell the policy that testcat_exec_t is a file
19 | type testcat_t;
20 | domain_type(testcat_t);
21 | type testcat_exec_t;
22 | files_type(testcat_exec_t);
23 |
24 | # Allow the testcat_t type under the unconfined_r role
25 | role unconfined_r types testcat_t;
26 |
27 | # Tell SELinux that testcat_exec_t is an entrypoint to the testprog_t domain
28 | allow testcat_t testcat_exec_t : file { ioctl read getattr lock execute execute_no_trans entrypoint open } ;
29 | # Make the type transition from unconfined_t (i.e. user shell) to testcat_t
30 | type_transition unconfined_t testcat_exec_t : process testcat_t;
31 | # Explicitly allow the type transition we have just created
32 | allow unconfined_t testcat_t : process transition ;
33 |
34 |
--------------------------------------------------------------------------------
/lab05-file-contexts/testprog.te:
--------------------------------------------------------------------------------
1 | #
2 | # Useful references for building this policy:
3 | #
4 | # https://www.redhat.com/archives/fedora-selinux-list/2008-June/msg00076.html
5 | # https://serverfault.com/questions/628344/selinux-cannot-confine-firefox-process-to-mozilla-t-domain
6 | #
7 | #
8 | policy_module(testprog, 0.1)
9 |
10 | # Require all the types, attributes and classes we reference in this policy
11 | require {
12 | type unconfined_t;
13 | role unconfined_r;
14 | class file { ioctl getattr setattr create read write unlink open relabelto };
15 | class process transition;
16 | }
17 |
18 | # Define our new types that testprog will use, and ensure that we tell the policy that testprog_exec_t is a file
19 | type testprog_t;
20 | domain_type(testprog_t);
21 | type testprog_exec_t;
22 | files_type(testprog_exec_t);
23 |
24 | # Allow the testprog_t type under the unconfined_r role
25 | role unconfined_r types testprog_t;
26 |
27 | # Tell SELinux that testprog_exec_t is an entrypoint to the testprog_t domain
28 | allow testprog_t testprog_exec_t : file { ioctl read getattr lock execute execute_no_trans entrypoint open } ;
29 | # Make the type transition from unconfined_t (i.e. user shell) to testprog_t
30 | type_transition unconfined_t testprog_exec_t : process testprog_t;
31 | # Explicitly allow the type transition we have just created
32 | allow unconfined_t testprog_t : process transition ;
33 |
34 |
--------------------------------------------------------------------------------
/lab04-targeting-testprog/testprog.te:
--------------------------------------------------------------------------------
1 | #
2 | # Useful references for building this policy:
3 | #
4 | # https://www.redhat.com/archives/fedora-selinux-list/2008-June/msg00076.html
5 | # https://serverfault.com/questions/628344/selinux-cannot-confine-firefox-process-to-mozilla-t-domain
6 | #
7 | #
8 | policy_module(testprog, 0.1)
9 |
10 | # Require all the types, attributes and classes we reference in this policy
11 | require {
12 | type unconfined_t;
13 | role unconfined_r;
14 | class file { ioctl getattr setattr create read write unlink open relabelto };
15 | class process transition;
16 | }
17 |
18 | # Define our new types that testprog will use, and ensure that we tell the policy that testprog_exec_t is a file
19 | type testprog_t;
20 | domain_type(testprog_t);
21 | type testprog_exec_t;
22 | files_type(testprog_exec_t);
23 |
24 | # Allow the testprog_t type under the unconfined_r role
25 | role unconfined_r types testprog_t;
26 |
27 | # Tell SELinux that testprog_exec_t is an entrypoint to the testprog_t domain
28 | allow testprog_t testprog_exec_t : file { ioctl read getattr lock execute execute_no_trans entrypoint open } ;
29 | # Make the type transition from unconfined_t (i.e. user shell) to testprog_t
30 | type_transition unconfined_t testprog_exec_t : process testprog_t;
31 | # Explicitly allow the type transition we have just created
32 | allow unconfined_t testprog_t : process transition ;
33 |
34 |
--------------------------------------------------------------------------------
/lab12-interfaces-part-2/testcat.te:
--------------------------------------------------------------------------------
1 | #
2 | # Useful references for building this policy:
3 | #
4 | # https://www.redhat.com/archives/fedora-selinux-list/2008-June/msg00076.html
5 | # https://serverfault.com/questions/628344/selinux-cannot-confine-firefox-process-to-mozilla-t-domain
6 | #
7 | #
8 | policy_module(testcat, 0.1)
9 |
10 | # Require all the types, attributes and classes we reference in this policy
11 | require {
12 | type unconfined_t;
13 | role unconfined_r;
14 | class file { ioctl getattr setattr create read write unlink open relabelto };
15 | class process transition;
16 | type console_device_t;
17 | type user_devpts_t;
18 | class unix_dgram_socket { create connect sendto };
19 | class chr_file { append read write open getattr ioctl };
20 | class capability sys_tty_config;
21 | }
22 |
23 | # Define our new types that testcat will use, and ensure that we tell the policy that testcat_exec_t is a file
24 | type testcat_t;
25 | domain_type(testcat_t);
26 | type testcat_exec_t;
27 | files_type(testcat_exec_t);
28 |
29 | # Allow the testcat_t type under the unconfined_r role
30 | role unconfined_r types testcat_t;
31 |
32 | # Tell SELinux that testcat_exec_t is an entrypoint to the testprog_t domain
33 | allow testcat_t testcat_exec_t : file { ioctl read getattr lock execute execute_no_trans entrypoint open map } ;
34 | # Make the type transition from unconfined_t (i.e. user shell) to testcat_t
35 | type_transition unconfined_t testcat_exec_t : process testcat_t;
36 | # Explicitly allow the type transition we have just created
37 | allow unconfined_t testcat_t : process transition ;
38 |
39 | allow testcat_t console_device_t:chr_file { open write getattr ioctl };
40 | allow testcat_t self:capability sys_tty_config;
41 | allow testcat_t user_devpts_t:chr_file { append read write getattr };
42 |
--------------------------------------------------------------------------------
/lab13-interfaces-part-3/testcat.te:
--------------------------------------------------------------------------------
1 | #
2 | # Useful references for building this policy:
3 | #
4 | # https://www.redhat.com/archives/fedora-selinux-list/2008-June/msg00076.html
5 | # https://serverfault.com/questions/628344/selinux-cannot-confine-firefox-process-to-mozilla-t-domain
6 | #
7 | #
8 | policy_module(testcat, 0.1)
9 |
10 | # Require all the types, attributes and classes we reference in this policy
11 | require {
12 | type unconfined_t;
13 | role unconfined_r;
14 | class file { ioctl getattr setattr create read write unlink open relabelto };
15 | class process transition;
16 | type console_device_t;
17 | type user_devpts_t;
18 | class unix_dgram_socket { create connect sendto };
19 | class chr_file { append read write open getattr ioctl };
20 | class capability sys_tty_config;
21 | }
22 |
23 | # Define our new types that testcat will use, and ensure that we tell the policy that testcat_exec_t is a file
24 | type testcat_t;
25 | domain_type(testcat_t);
26 | type testcat_exec_t;
27 | files_type(testcat_exec_t);
28 |
29 | # Allow the testcat_t type under the unconfined_r role
30 | role unconfined_r types testcat_t;
31 |
32 | # Tell SELinux that testcat_exec_t is an entrypoint to the testprog_t domain
33 | allow testcat_t testcat_exec_t : file { ioctl read getattr lock execute execute_no_trans entrypoint open map } ;
34 | # Make the type transition from unconfined_t (i.e. user shell) to testcat_t
35 | type_transition unconfined_t testcat_exec_t : process testcat_t;
36 | # Explicitly allow the type transition we have just created
37 | allow unconfined_t testcat_t : process transition ;
38 |
39 | allow testcat_t console_device_t:chr_file { open write getattr ioctl };
40 | allow testcat_t self:capability sys_tty_config;
41 | allow testcat_t user_devpts_t:chr_file { append read write getattr };
42 |
43 | # Use the interface defined for testprog data to allow us to access it's files from our confined domain
44 | testprog_read_data(testcat_t);
45 |
--------------------------------------------------------------------------------
/lab02-the-testprog/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | Welcome to testprog! This is a little C program that was designed to perform a series of common functions on an EL9/Fedora 41 system to help you learn SELinux. It is by it's nature very simple and also at this stage quite crude. If anyone wants to help improve the code I would be very grateful - however for now it meets my original goals:
4 |
5 | * A native binary (as opposed to a script requiring another binary to run it)
6 | * Can be controlled by systemd
7 | * Write to syslog and the terminal
8 | * Writes output data to a known unique data directory on the system
9 | * Reads its configuration data from a unique config file in /etc
10 |
11 | In time additional functionality may be added, especially network connectivity - however at this stage it touches enough parts of the system to learn the fundamentals of SELinux on an EL9/Fedora 41 system operating the `targeted` policy in `enforcing` mode.
12 |
13 | If you get a **Segmentation Fault**, this is almost certainly because of one of these things:
14 |
15 | * The configuration isn't correct (the default config should work though as it has been tested on a plain EL9 and Fedora 41 system)
16 | * The configuration is correct but the binary cannot perform an operation it needs to
17 |
18 | Error handling is currently limited resulting in **Segmentation Faults** - this may be improved if time allows or someone can contribute to the code.
19 |
20 | # Build and install
21 |
22 | To build and install testprog exactly as it is, run the following commands:
23 |
24 | ```
25 | [james@selinux-dev testprog]$ cd ~/selinux-hands-on-labs/testprog
26 | [james@selinux-dev testprog]$ sudo dnf -y install gcc make
27 | ...
28 |