From the course: Mastering Security-Enhanced Linux (SELinux)

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Lesson 9: Lab solution running any application on an SELinux system

Lesson 9: Lab solution running any application on an SELinux system - Linux Tutorial

From the course: Mastering Security-Enhanced Linux (SELinux)

Lesson 9: Lab solution running any application on an SELinux system

- Okay, so we don't have to install all the stuff, we don't have to compile anything. We just have to look at myapp and myapp.service. So what's going on? Well, myapp is a simple shell script that is writing to TMP app file .txt, and myapp.service is running this simple shell script. So we need to copy the files into the appropriate location. So myapp is going to /user/local/bin/, and myapp.service is going into /etc/systemd/system/. And next we can generate the policy using sepolicy generate --init /user/local/bin/myapp. And as you can see it has created a couple of files, so that is looking good. And let me use myapp.sh to compile everything that was just created. There is the expected error message about rpmbuild. We can ignore that, and that is not a problem. So at this point, we should be able to use systemctl restart myapp to start it. Now how about ps Zaux grep myapp? And there we can see that myapp is running with myapp_t. That is as expected. So, so far, so good. We just need…

Contents