Where do I find SELinux policy in Android?

Where do I find SELinux policy in Android?

A good rule of thumb to remember while writing SELinux policy is: ‘If it ain’t broke, don’t fix it’. By default, Android provides an SELinux policy for the components which are specific to the AOSP platform. You can find these stored in the platform/system/sepolicy repository of AOSP.

Can you change the SELinux kernel security policy?

When compiled, those files comprise the SELinux kernel security policy and cover the upstream Android operating system. In general, you should not modify the system/sepolicy files directly.

How does SELinux work in the enforcing mode?

In Enforcing mode, SELinux actively enforces the given policy which specifies what is allowed (permissions in general). If an initiator wants to perform an action, SELinux will check if it is allowed to do so in the installed policy, and if allowed, it will then permit the requested action to happen.

What happens if you deny a SELinux request?

If denied, it will be logged in the kernel log buffer along with logcat on Android. In Permissive mode, SELinux will only log actions which are explicitly not allowed in the installed policy, and the initiators of those actions. Below is an example of an SELinux denial printed in an android logcat:

How do I change SELinux mode on my Samsung phone?

All you need to do is download the application on to the Android phone, run it and tap the Permissive button but, if the Android phone is a Samsung Android phone with OS 4.3 or above installed which also has Knox running then it will no longer work. Download and install SELinux Mode Changer from the Play Store onto your phone.

How does seandroid add security to Android system?

SELinux does not change any existing security in the Linux environment; instead, SELinux extends the security model to include Mandatory Access Control (e.g., both MAC and DAC are enforced in the SELinux environment). SEAndroid enhances the Android system by adding SELinux support to the kernel and user space to:

Which is the default mode of SELinux in Android?

SELinux can operate in 2 modes which are Enforcing and Permissive. The default mode is Enforcing. In Enforcing mode, SELinux actively enforces the given policy which specifies what is allowed (permissions in general).