Project Phase 1
Project Phase 1
Contents
Abstract............................................................................................................................................................... 2
Index Terms ........................................................................................................................................................ 2
Introduction ........................................................................................................................................................ 2
Problem Statement.............................................................................................................................................. 3
a) Deprivilege root access of a user application ................................................................................................ 3
b) SELinux .................................................................................................................................................... 3
c) Root filesystem Encryption with Secure Boot............................................................................................... 3
Attacks: ............................................................................................................................................................ 4
a) Some of the Attacks caused without Deprivilege root access of user application ......................................... 4
b) Some of the Attacks caused without SELinux ........................................................................................... 5
c) Some of the Attacks caused without the Root filesystem Encryption .......................................................... 7
Proposed Solution and Implementation:.............................................................................................................. 8
a) Deprivilege Root Access of a user application: ......................................................................................... 8
b) SELinux................................................................................................................................................. 9
c) Root filesystem Encryption with Secure Boot......................................................................................... 11
CONCLUSION.................................................................................................................................................. 17
ACKNOWLEDGMENT.................................................................................................................................... 18
REFERENCES.................................................................................................................................................. 19
2
Abstract
Embedded system security is a critical aspect of designing and deploying devices that are integrated with embedded systems,
such as IoT (Internet of Things) devices, industrial control systems, automotive systems, medical devices, and more. These
systems are often resource-constrained and perform dedicated functions, making them vulnerable to security threats. Therefore,
this project helps to maintain the security of any Linux based embedded system.
Index Terms
SELinux: Security-Enhanced Linux, MAC: Mandatory access control, DAC:
Discretionary Access Control. TZ: TrustZone, OTP: One Time Programmable
Introduction
In this modern world, there are lots of devices getting connected to the internet, which contain highly sensitive data. There is a necessity to
have Multi-pronged Linux Security for filesystem and Process management with principle of least privilege and encrypt the root file
system to prevent unauthorized parties from accessing the filesystem data and inspect offline.
The Multi-Pronged Linux Security for Filesystem and Process Management has the below topics covered under it.
a) Deprivilege root access of a user application:
b) SELinux (Security-Enhanced Linux):
c) Root filesystem Encryption with Secure Boot:
3
Problem Statement
b) SELinux:
Without SELinux, an embedded device will face various security threats due to their unique characteristics, limited resources, and
specialized functions. The common threats faced by an embedded device without SELinux are Denial of Service (DoS), insecure
communication, data leakage, unauthorized access etc.
Boot loaders already support Unified Image Encryption. XBL to Linux Kernel can be encrypted.
But there is no Support for rootfs File Systems. So, we need a solution for this problem.
Therefore, Managing the responsibilities related to deprivileging root access and implementing SELinux and encrypting root filesystem
with secure boot on an embedded device is crucial for enhancing security.
4
Attacks:
a) Some of the Attacks caused without Deprivilege root access of user application:
4) Capability Reduction:
Use capabilities to grant only specific privileges needed by the application. Drop capabilities that the application doesn't require.
Deprivileging root access for a user application on an embedded device is a fundamental security practice. It's essential to strike
a balance between providing the application with the privileges it needs to function correctly and limiting its access to sys tem
resources and capabilities for security purposes.
b) SELinux:
Implementing SELinux (Security-Enhanced Linux) on an embedded device can greatly enhance the security of the device,
helping to enforce access controls, reduce the attack surface, and mitigate the impact of security breaches.
Here's a high-level guide to implementing SELinux on an embedded device:
5) File Labeling:
Label files and directories with their respective security contexts using the "chcon" or "restorecon" commands. This ensures that
the policy is enforced.
When a subject, (for example, an application), attempts to access an object (for example, a file), the policy enforcement server in the
kernel checks an access vector cache (AVC), where subject and object permissions are cached. If a decision cannot be made based on
data in the AVC, the request continues to the security server, which looks up the security context of the application and the file in a
matrix. Permission is then granted or denied, with an avc: denied message detailed in /var/log/messages if permission is denied. The
security context of subjects and objects is applied from the installed policy, which also provides the information to populate the security
server's matrix.
11
Here Secure Boot verifies the signature of each image. First it computes the hash of the image. Then it decrypts the
signature of the image and gets the hash stored in image signature. Now it compared the computed hash with hash
stored in image signature. So Secure Boot will not fix the problem.
Secure Boot enforces only signature verification. Secure Boot helps to verify the image integrity only.
is the image corrupted or is the image really from trusted user?
The signed images can still be inspected offline. The Linux kernel (HLOS) images can have critical data/keys specific
to trusted users.
So, we need a solution for this.
Proposed Solution:
The proposed solution is to encrypt the rootfs images offline, decrypt the rootfs image in device and load it. This way
images downloaded from cloud or extracted from flash chip cannot be extracted by untrusted users. This way the
images are secured from being inspected for exploits. The encryption process ensures that even if an attacker gains
access to the encrypted image, they cannot retrieve the original content without the decryption key.
Boot loaders already support Unified Image Encryption. XBL
The entire process of root filesystem image encryption using the offline generated key, decryption using OTP key,
including key generation, key storage, and key retrieval are discussed here.
We use a Logical partition one to one mapped to a Physical partition. The Logical partition is having decrypted
content and the physical partition is encrypted content.
13
“Logical Partition” is mounted in the system for usage (eg rootfs, data partition etc) and the “Physical partition” is not
exposed as a file system to the system. Any write to “Logical Partition” needs to be encrypted and written into
“Physical partition”. Any read from “Logical Partition” will be read from “Physical partition”, Decrypt the content and
return.
Advantages
• Protection from physical attack.
Limitations
• Key is visible to Linux kernel if the device does not have HW crypto Engine.
• There is a latency which is created due to image decryption which is unavoidable, and device may take more boot time
17
CONCLUSION
In conclusion, deprivileging root access for user applications, implementation of SELinux and Root filesystem encryption
with Secure Boot are essential components of a robust security strategy for embedded devices. These measures not only protect
against unauthorized access and potential vulnerabilities but also demonstrate a commitment to the security and integrity of the
device and its users.
18
ACKNOWLEDGMENT
I would like to express our appreciation for the proactive measures taken to enhance the security of our embedded device by
deprivileging root access for user applications and implementing SELinux. These efforts are crucial for strengthening the
overall security posture of the device and mitigating potential risks.
By deprivileging root access, we have reduced the potential impact of security breaches and vulnerabilities within our user
applications.
In addition to deprivileging root access, the implementation of SELinux further fortifies our device's security. SELinux
enforces mandatory access controls, allowing us to define and enforce fine -grained security policies. This added layer of
security helps prevent unauthorized access, restricts the attack surface, and enhances our ability to control and monitor system
behavior.
The combination of root filesystem encryption with secure boot has significantly reduced the risk of various attacks,
providing a solid foundation for our overall security strategy.
This project is done by Ram Chandra Jangir (CS21M517) and Sneha Maganahalli Rajendranath (CS21M522) under the
guidance of Naresh Mehta (Manager and Sr. Staff Engineer) and Radha Krishna Simha Jiguru (Sr. Staff Engineer).
19
REFERENCES
[1] SELinux https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/deployment_guide/ch-selinux
[2] ARM Trusted Firmware - https://developer.arm.com/tools -and-software/open-source-software/firmware/trusted-firmware/trusted-firmware-a
[3] Trustzone - https://developer.arm.com/documentation/102418/0100/TrustZone-in-the-p