I am working with a Java app that has been labeled with its own SELinux type. Java executes it as unconfined_t instead of the labeled type.

Java is labeled as bin_t (ls -Z /usr/lib/jvm/java-1.8.0-openjdk-

However ps -efZ | grep java shows it running as unconfined_t.

How can I get java to run as bin_t? How can I get the java app to runwith the correct context?

The goal is to have the application run in it's own context or at least as bin_t as it is launched by Java.

Distribution is CentOS 7.


bin_t is a file type, not a process domain. A process enters confined domain via entry point, which often is an executable labeled with an entry point file type, for example httpd_exec_t for httpd daemon.

Entry points are defined in the policy. If you have policy which defines a process domain, it likely also defines the entry point. Label the executable (script etc) you use to start your application with correct entry point label.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.