Your First Guide to ”secure Linux”
August 12, 2010 Toshiharu Harada haradats@nttdata.co.jp NTT DATA CORPORATION
Your First Guide to secure Linux August 12, 2010 Toshiharu Harada - - PowerPoint PPT Presentation
Your First Guide to secure Linux August 12, 2010 Toshiharu Harada haradats@nttdata.co.jp NTT DATA CORPORATION Abstract There are two types of people in the world. Those who are security
August 12, 2010 Toshiharu Harada haradats@nttdata.co.jp NTT DATA CORPORATION
There ¡are ¡two ¡types ¡of ¡people ¡in ¡the ¡world. ¡Those ¡who ¡are ¡ security ¡experts, ¡and ¡the ¡remainder ¡of ¡the ¡world. ¡In ¡most ¡cases, ¡ security ¡experts ¡are ¡willing ¡to ¡provide ¡technical ¡assistance ¡to ¡ people, ¡but ¡this ¡does ¡not ¡always ¡work ¡as ¡the ¡information ¡can ¡be ¡ highly ¡technical ¡and ¡confusing ¡if ¡you ¡are ¡not ¡comfortable ¡with ¡ the ¡fundamentals ¡of ¡Linux ¡security. Toshiharu ¡Harada, ¡Project ¡Manager ¡for ¡TOMOYO ¡Linux ¡at ¡NTT ¡ DATA ¡CORPORATION ¡will ¡share ¡the ¡fundamental ¡concepts ¡of ¡ "secure ¡Linux" ¡for ¡managers ¡and ¡end ¡users ¡who ¡have ¡little ¡or ¡no ¡ familiarity ¡with ¡security. ¡This ¡session ¡does ¡not ¡require ¡any ¡ special ¡skills ¡or ¡knowledge, ¡and ¡is ¡*not* ¡designed ¡for ¡security ¡ experts.
"Whenever people agree with me, I always feel I must be wrong”
“secure Linux” is a Linux version of “OS with enhanced security”
What is “OS with enhanced security”?
You can Google it as always, but what you get will be much more than you want (and hard to understand)
If you ask “security people” ... You’ll get the same results in 3D
What’s the missing link?
Maybe the missing link is the “concept” of “secure Linux” So, here I am
Who Am I?
“secure Linux” extensions part of the upstream
started investing of the existing projects
incorporated in the mainline Linux kernel
This presentation is intended to provide you the fundamental concepts of
What You Get Understanding the underlying concepts of “secure Linux” should help you
and experience
you need it
(operating system)”
SELinux, SMACK and TOMOYO currently, and AppArmor (to be merged for 2.6.36)
Linux system when it gets exploited
"Give me a place to stand on, and I will move the Earth.”
From Wikipedia (as of July 15th, 2010)
data, or sequence of commands that take advantage of a bug, glitch or vulnerability in
behavior to occur on computer software, hardware, or something electronic (usually computerised).
control of a computer system or allowing privilege escalation or a denial of service attack.
From “10 Immutable Laws of Security by Microsoft” Law #1
science: when a computer program runs, it will do what it’s programmed to do, even if it’s programmed to be harmful.”
client
and other technique
(DAC, for short)
permissions through “chmod” command
root
to connect through opened ports
attacks and vulnerabilities
Linux security are not quite dependable
approach of attacks, can we prevent them causing “buffer overflow”?
gain control and execute /bin/sh
invented, but not guarantee safe
"Although the world is full of suffering, it is full also of the
(TRUSTED COMPUTER SYSTEM EVALUATION CRITERIA) “Discretionary Protection” and “Mandatory Protection” and “Verified Protection”
between named users and named objects in the ADP* system.”
users to specify and control sharing of those
groups or both.”
( you don’t have to remember these terms, I think)
user (self)
group execute read write
user (self)
group execute % chmod 600 my_file read write
control policy over all subjects and storage
sensitivity labels that are a combination of hierarchical classification levels and non- hierarchical categories, and the labels shall be used as the basis for mandatory access control decisions.”
subject A
B label for A label for B
security correctness of the kernel
privileged applications
MAC
security correctness of the kernel security policy
Unchanged (Things you cannot change)
logging in Changed (Things you can change with MAC)
privilege (MAC introduced a new layer of security)
God, give us grace to accept with serenity the things that cannot be changed, Courage to change the things which should be changed, and the Wisdom to distinguish the one from the other.
accesses, not a “brain”
system about good and bad accesses by defining a “policy” (AppArmor calls it “profile”)
The goal is very simple
If you make mistakes in your policy
O God, give us grace to accept with serenity the things that cannot be changed, Courage to change the things which should be changed, and the Wisdom to distinguish the one from the other
(with my deepest respects for Reinhold Niebuhr)
O God, give us grace to accept with serenity the things that are needed, Courage to reject the things which are not necessary, and the Wisdom to distinguish the one from the other
SELinux has a “reference policy”
the years about what accesses are in fact required for a large body of software”
power users can maintain their own foundation TOMOYO and SMACK
security contexts (conditions)
“domains” (AppArmor call them “profiles”)
“Granularity” of MAC policy is determined by two factors
domain Both live in the kernel space, not in the userspace
kernel userspace
What and When
unnecessary How
Cautions
access occurs but its definition is missing among policy rules
policy, in fact transforming it into policy rule, so that the same error will not occur anymore
lose control
What is it?
TOMOYO How it works?
audit2allow does for SELinux)
Results of policy auto learning
Auto learning feature can be used as an analysis tool or an educational tool
Live as if you were to die tomorrow. Learn as if you were to live forever.
Ideal reference by James Morris, who is the Linux kernel security subsystem maintainer; author of the kernel cryptographic API; and a leading contributor to the SELinux, Linux Security Module, Netfilter and IPsec projects.
Best place to find Linux kernel security related projects
http://lwn.net/Articles/383260/
https://lists.ubuntu.com/archives/loco-contacts/ 2007-August/001510.html
www.debian-administration.org/articles/417
is ISO/IEC 15408
described as “protection profile”
succeeds MAC in TCSEC
5200.28-STD Trusted Computer System Evaluation Criteria
protection profile
protection profile
Characteristics of embedded devices
resources
millions, for instance)
available Linux has been spreading for embedded devices
Google’s Android and Chromium OS are adding unique modifications to improve security
Linux security, “understanding the concept”
find it as an invaluable tool
“Loving can cost a lot, but not loving always costs more.”
Why not starting today?
The Serenity Prayer by Reinhold Niebuhr (1892-1971) God, give us grace to accept with serenity the things that cannot be changed, Courage to change the things which should be changed, and the Wisdom to distinguish the one from the other. Living one day at a time, Enjoying one moment at a time, Accepting hardship as a pathway to peace, Taking, as Jesus did, This sinful world as it is, Not as I would have it, Trusting that You will make all things right, If I surrender to Your will, So that I may be reasonably happy in this life, And supremely happy with you forever in the next. Amen
Contact Information
I would like to make these slides useful for future readers, so please send your comments and corrections to haradats@gmail.com Open source is a mutual benefit society, so I’m sharing my own experiences as TOMOYO Linux project manager as well as selected technical slides
The latest version of these slides can be found at SlideShare Acknowledgements Special thanks to Giuseppe La Tona, Tetsuo Handa for reviewing and Stephen Smalley for correcting SELinux related information Trademarks Linux is a registered trademark of Linus Torvalds in the United States and other countries TOMOYO is a registered trademark of NTT DATA CORPORATION in Japan