The next presentation is about DJSS and SNMP attacks, so I have to say that. Now we can carry on with my presentation about security of the kernel level. This is to explain you that the kernel has something to do with security that when you want to do security, the kernel has its role to play in security policy. I don't see my screen, so I'll have to look at those screens. I have divided my presentation in three parts. The first one is about why doing security in the kernel. Some people might think that kernel is only done for the machine to work and security must be done elsewhere with other applications. But I'll try to explain and convince you that things can and must be done at the kernel level. Then there will be a part about how to achieve such security. And the third part will be about some implementations. So the first part will begin with some context. Then I will introduce some kind of new security model. In fact, it's another way to see security. And I'll conclude on this. So as you all know, there are things, I think, we'd like to be protected from. So all those kind of nasty stuffs. And for that, we must ensure three words you all know well, which are confidentiality, integrity, and availability. And what we do to ensure that is that we define a set of rules that describes the way we handle, protect, and distribute information. And this is what we call a security policy. And to enforce our security policy, we use security software. We use other things, but it is part of the things we use. And some to do integrity checks, some to ensure confidentiality, and some to do authentications. But the real question is that can we trust those softwares? To explain you these things, there is a little analogy. So let's imagine that we have an house with some cookies into this house. And we have mice that will try to eat the cookies. And all that we want is to protect the cookies from the mice. So I propose you two solutions. The first one is to try to prevent mice to get into the house, filling every hole, closing doors and windows. And the second solution is to put the cookies in a metal box. So what I will ask you is to think two minutes about which solution will be secure, which will be not. If you try to think about that, you will quickly find that you can't answer the question easily, and that securing the house is very hard, and you won't be sure that the house is well secured. But the solution with the metal box is quite easily done. In fact, with the solution one, you can't be sure you have filled all the walls, you can't be sure there weren't any mice in the house, you can't be sure about the... you can't trust this solution. And with the solution of the metal box, you have something you can audit, because it's very small, you can grasp it entirely, and this is a better solution. So if you have to choose, I guess you'll choose the solution of putting cookies in the metal box. For the model, that's the same thing. We have, for example, a machine with a big perimeter, which is, in fact, the physical security of the machine. What we have in black and yellow is the last defense we put, usually, on machines. And, for example, if someone can break in using, for example, sunlight, it can attack over a piece of software, and it has gone into our last security perimeter. Now, if we use this model, we have a smaller perimeter, to defend. We have... Of course, we try to prevent something to get into the machine, but once someone has succeeded into getting into the machine, we try to defend kernel 2. And our last defense will be the separation between user space and kernel space. So to use this model, we must patch a kernel, first to protect the kernel itself, so that we reach a state where the kernel space is trustworthy. And then, from the kernel space, we try to enforce security policy. We try to protect everything that is involved in the security policy, or every data that is related to the security policy. Now, how can we do that? In fact, the fact we decide that the kernel space is a good space to... A good place to do that is that in every computer, nowadays computers, we have a memory management unit that will do hardware separation between user space and kernel space. And we will rely on this fact to, in fact, being able to ensure that everything from user space can't go into kernel space. And we will see in the first part that we can enumerate everything going from user space to kernel space, and everything that can be done on the machine can be filtered because it is going through kernel space. Then, we will see in two parts on how to defend kernel space and what we could do to filter in kernel space. So, this is a machine. This is a computer. And we have humans that will try to target some things like storage, FPGAs of the kernel or another application that is running on the computer. To reach a target, you must go through some physical security layers, one which is the real physical access to the machine. If you can do that, I mean, with a screwdriver or anything, here's one, and you don't have to... I mean, the physical security is the first point, but it's not the point of this presentation. The second point is that you can go through an action layer, for example, the keyboard or the network interface card to go through the kernel and give commands to an application that is running in user space. So, you can reach an application like that. From this application, you can reach, for example, a storage media or PROM or FPGAs. But, as you see, we can... we still go through the kernel. Then, we can try to target another application. You see, there are two arrows. The arrow number 10 can't exist on architecture with a real memory management unit because it's not permitted in protected world. You can try to target the kernel because the kernel is a target, too. And we have to protect it. So, we have seen that there are a lot of paths to reach a target. And, in fact, the fact we have a small perimeter to defend makes that we have not so many paths to protect. First, we will rely on an hypothesis is that we have an interface without bugs that does not exist, but it's an hypothesis and we must do that to carry on. And, for example, as an hypothesis, we say that each key you type on your keyboard will go through the kernel before giving an order to an application. And we will have as an hypothesis that typing on the kernel can't make you take the control of the kernel. Then, we have some defense to achieve. Attacks to the kernel can go through devmem or devkmem or insert loading modules into kernel space. There are other ways to do so. We will see later. And then, if you want to filter access to I don't know, to storage media, as you can see, everything goes through the kernel. So, the kernel is a good place to filter that. So, a little parenthesis about the bugless interface is something that's a little my opinion because the mechanism you use to do kernel programming make it harder to do programming, classical programming faults. But bugs are still possible, other classes of bugs. But, in fact, we did not have seen a lot of vulnerabilities on kernels. So, the hypothesis is not true, but valid for us. Then, how to protect the kernel space when there is someone, when there is an intruder in user space? We have to block every to protect every from user space to kernel space. There are few of them and they are all granted by the kernel. So, that's easy to block them. For example, this is some kind of some source code from the Linux kernel. You just have to return minus eperm to block slash dev slash mem slash dev slash kmem or slash dev slash port. So, it's very easy to hack into the code and block this kind of entry points. The same for the module insertion. You just have to return minus eperm and this entry point is blocked. So, that's very easy to do. Or to control. And then, if we want to filter things, we must protect. We have to know what we want to protect. We have a few classes of things we want to protect. It's what's on memory, what's on disks, and every programmable hardware like recent CPUs, PROMs, BIOS. All this kind of stuff can be... must have... must be granted by the kernel to be completed. So, how to protect that? We have to... As every queries are done through the kernel, and through system calls or device calls or sysctls, we have to modify their behavior in a consistent manner to enforce security policy. So, a good way to use is to use modular architecture to control kernel calls because there are a lot of access control policies and our aim is to try to enforce control policies that is... that is... that is... I mean, you have a security policy and the security policy will say you which access control policy you have to implement. As there are a lot, we try to be modular and to, for example, in a system call, we try to put and enforce a code. So, it's a component that will... go into the system call and the enforcer component will ask the decider component if access must... can be granted or not. And it's the decider component that implements the access control policy and you can change it as you want. So, it's a way to do so. And it's a way almost every software that do this kind of stuff works. So, how to add the enforcer code in a system call, for example, because you have to do so in... in device calls, too. You have two ways of doing so. For example, we have... we have the anatomy of system call. You have an application that asks for a specific system call. The instruction pointer will go through a dispatching code that will decide which system call has been called, then give on to the system call that will do its job, and then go back to the dispatching code that will give the on back to the application with the result. So, we have two ways to... to modify things. Either we patch the dispatching code and we go... we catch every calls to a system call in one patch, or we patch every system call, for example, open or kill, or things like that. So, an example of system call interception. It's about... It's... The code comes from Medusa DS9. So, they put some... a small piece of code in the dispatching code that call their own access control method that will try to decide which... if the system calls that have been asked for can be executed or not. So, there are some advantages. It's a very general system. And it's a low-cost patch. As you see, with only these ten lines of assembly, you have intercepted every system call in the kernel. The drawback is that you have some kind of duplication of every system call because each time you... you... an application asks for a syscall, the code of Medusa will be executed. And then, it's another drawback, is that the Medusa function has to know which system call it was, try to decode parameters, try to check if there are no... no... error in the parameters to interpret it correctly. And another problem is that it's architecture dependent, at least on Linux. I think in BSD, it's not so architecture dependent, but it's... it's a drawback on Linux. Another example is about a system call modification. For example, from LIDS, you have a function, and then you just patch it to... to do the check to call the... the decider component. What we can say is that the decider component can take arguments from parameters that have been checked and decode... decoded, so that you don't have to do twice these checks and decoding, and you can put the... the code everywhere you want, so that it's very... more powerful. So, you have great tuning power, because you can alter the code to do almost everything you want, to modify the... even the... you can even modify the behavior of the system call. For example, transform... transforming it to something that's not so compliant, but that's more secure. And... drawback is that you have about 2,000 system calls, and a lot of them have to be patched, and they are have to be patched in a consistent manner to... to reach a consistent security policy. So, something that will be soon in kernel is the Linux security modules. So, in fact, Linux security module is a patch to the Linux kernel, and it's only the... the enforcer component. For example, it's a yellow line. It's... it has been put in a... in a... in a specific part of the system call, and it's just a call to a... to a decider component. And the decider component can be everything. It can be leads. It can be security Linux. It can be everything that... that is conformant to... to the... the way... the... the... the... the way the communication is... has been decided to be in the enforcer component. The name Linux security modules by modules you have to understand modular because that means that... that only means that you can have a... a lot of decider components. Then, we will see some implementations that ex... that exist. So, there are a lot of projects that do security at the kernel level. So, OpenWall is, I think, one of the... the orders. Maybe there are all of them, but I... I don't know. GR Security, LIDS, Medusa DS9, RSBAC, LOMAC, Security Nance Linux, and there are lots too. There are... They all work on Linux kernels. There are others that work on BSD like Systrace. So, OpenWall is not really what I've presented. That is... It's not something to do access control in the... in the kernel. It's only a collection of security-related features. For example, there are some... the famous non-executable user stack array and other things related to security. GR Security, it's... has begun with the patch... passing the patch from OpenWall to 2.4 kernels. And then, the... they added an ACL system, which was called Oblivion. Then, they switched to a process-based system that is very... that looks like an LIDF system, ACL system. They... They also implement PAX, which is another patch for Linux kernel to... to protect user space from buffer overflows and other kind of... of bugs that could occur in user space, like they do stack address randomization, et cetera. Then, there is LIDS. I don't go into details because there will be a presentation tomorrow. So, it does self-protection of the... of the kernel and LIDS itself, process protection, file protection, some special... some special features to do online administration, other special features to do to... to be able to rely only on kernel stuff. For example, a dedicated mailer in the kernel. I mean, if you... if you... someone breaks your send mail, you can't rely on it anymore to send alerts. So, there is a kind of mailer that works only in the kernel and that works for LIDS. So, this is the way it works. I go fast. Then there is Medusa DS9, which has an interesting concept that is there are a lot of layers of abstraction and the decider component is in fact a user space daemon which will decide in fact the enforcer component will ask through a device driver to user space daemon if something must be grounded or not. And the fact it's a user space daemon make implementations of access control policies very easy to do. It's just user space programming. You can do it in shell if you want. But, there is something in user space. And Medusa just... Medusa rely on the system core interception. RSBAC is something that's based on the GFAC which is a generalized framework for access control which is a kind of access control. It's the same that it's equivalent of LSM. And then there are a lot of access control policies that have been implemented that are given in the form of loadable kernel modules. And there are a lot of them like control policy world control functional control. One which I like a lot is that they have been able to implement malware scanner as a decided components that plug into the framework for access control. It's something that will scan every program you execute to check for virus or anything. So in fact the decided component can be very it can do a lot of things. Another interesting thing is is low mark. It's something based on low watermark integrity. It's something I find very cute. It's for you have an initialization and some specified directory are in high level and other directories and socket are low level. In fact you have two conceptual levels which processes will be high which will be low and which processes can do what. So processes are created from high directory will be high. Processes created from low directory will be low. High process can read file in high file it will become low. So that's that's that's that's cute I find. But there are some exceptions because something like that can't work. There must be exceptions for example processes must write to syslog your logs must be high so the syslog daemon must be high but it must read something which is low because the low socket because every process must write into the log socket and so that syslog have to read a socket that is low. There must be some exception to make the model work. Then Security Nance Linux is something that that is I find that Lomax is the little brother of Security Nance Linux and it's based on a very old not old but something that is 10 years old. The Flask architecture is 10 years old. They have worked a lot on it and there is also an where no Security Nance Linux can work on top of the Linux Security modules and not like the other project they have worked on two revocations that is if you change the write of the process that has already been launched the write will be propagated to already running process and they will be propagated right. At last the Linux Security modules they will be included very soon and you can test control policies as you want and you don't have to compile them as modules as the name suggests. You can compile them in the kernel. So that's all. So if you have any questions I think we don't have a lot of time but no I think I was very clear. So thank you.