All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: SELinux for embedded devices...
@ 2005-07-29  4:47 Sriram, Kannan
  2005-07-29  6:09 ` Lorenzo Hernández García-Hierro
  2005-07-29  8:44 ` Luke Kenneth Casson Leighton
  0 siblings, 2 replies; 10+ messages in thread
From: Sriram, Kannan @ 2005-07-29  4:47 UTC (permalink / raw)
  To: Lorenzo Hernández García-Hierro; +Cc: SELinux Mail List


Lorenzo,

 First of all, thanks for the tip and insights!

> Also, what do you mean my "tamper-proof" in this context? Physically
> protecting the chip which serves as storage for it? That sounds strange.

By tamper-proofing, I mean that the kernel image that is on the flash device cannot be altered - any image on the flash (bootloader, kernel, etc) carries a cryptographically signed certificate (by the OEM of the phone, using private key, of a public/ private pair), and the system does not boot up if the certificate of the image is invalid. A "trust chain" is constructed this way - boot ROM (not alterable) authenticates the boot loader, boot loader then authenticates the kernel and so on...

> Under SELinux root is just another user with access to certain roles. Be
> them user_r or sysadm_r, doesn't matter, it's all your choice and you
> can turn root into a non privileged user.

Are their any caveats to this? If I can make the root to be a non-privileged user, how can kernel modules be insmod'ed? Sorry, I know I can dig through the sources and find out how this is handled, but any handholding at this study stage (for me) would be very helpful. Should I be creating one more privilege level and assign it to a "central authority", purely for dealing with the setup and configuration of the security policies itself (for example, the network operator/carrier or some such entity)? Pls note that we are trying to make the person with "physical access to the system" to be able to do whatever a "privileged user" can do, but at the same time, just not give enough power for configuration of the security policy itself, without authorization.

> The problem of NAND flash chips and other flash memory components is
> that they have a limited writable times. Hence, the use of specific file
> systems is needed in order to *not* reach such limit in a short period
> of time.
Does SELinux require a writeable filesystem always? What if I want to use CRAMFS which is a ReadOnly system? Also, do you think that filesystem related issues will be the most important issues to live with? I'm asking this because there are only a countable number of FS variants for embedded systems AFAIK, so we can *maybe* take them on one at a time.

Thanks,
Sriram.




--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: SELinux for embedded devices...
@ 2005-07-29  6:30 Sriram, Kannan
  0 siblings, 0 replies; 10+ messages in thread
From: Sriram, Kannan @ 2005-07-29  6:30 UTC (permalink / raw)
  To: Lorenzo Hernández García-Hierro; +Cc: SELinux Mail List



> -----Original Message-----
> From: Lorenzo Hernández García-Hierro [mailto:lorenzo@gnu.org]
> Sent: Friday, July 29, 2005 3:09 PM
> To: Sriram, Kannan
> Cc: SELinux Mail List
> Subject: RE: SELinux for embedded devices...
> 
> El vie, 29-07-2005 a las 10:17 +0530, Sriram, Kannan escribió:
> > Lorenzo,
> >
> >  First of all, thanks for the tip and insights!
> 
> My pleasure.
> 
> > > Also, what do you mean my "tamper-proof" in this context? Physically
> > > protecting the chip which serves as storage for it? That sounds
> strange.
> >
> > By tamper-proofing, I mean that the kernel image that is on the flash
> >  device cannot be altered - any image on the flash (bootloader, kernel,
> >  etc) carries a cryptographically signed certificate (by the OEM of the
> >  phone, using private key, of a public/ private pair), and the system
> >  does not boot up if the certificate of the image is invalid. A "trust
> >  chain" is constructed this way - boot ROM (not alterable)
> >  authenticates the boot loader, boot loader then authenticates the
> >  kernel and so on...
> 
> Well, I have some doubts on this. I'll try to organize the questions
> from most trivial ones to others with more complexity.
> 
>  1) What type of firmware, engine or booting system you can use that:
> reads a key (even PKI-inspired/based), checks boot media integrity, boot
> loader turns control over the real boot loader which loads kernel at
> memory, and then you're done? Apart of the complexity of such approach,
> I seriously doubt it's reliable both technically and in terms of
> available resources. That is, how do you want to do this in a embedded
> device such a smart-phone or those with a very limited memory and
> processing capability? Simple things tend to be less prone to errors...
> 

We have a hardware + software mechanism that actually does this job, and actually has cryptographic accelerators on the SoC.

>  2) On the other hand, we have a certificate which is stored in the same
> "image" (the term sounds quite confusing to me in this context) as the
> kernel being loaded. What about poisoning the certificate?  Also,
> against what you will certify the trustworthiness of the certificate
> itself? If it relies on internal data it might as well accessible for
> poisoning.
> 
>  3) How do you separate firmware, kernel image, file-system data and
> integrity verification engine + data?
>

Firmware -- bootROM, on chip (SoC)
Bootloader -- u-boot, on the flash chip. We calculate the digest of u-boot, sign it with the private key (the certificate) and append it to the u-boot image. Same for kernel image as well.
 
> 
> > Are their any caveats to this? If I can make the root to be a
> >  non-privileged user, how can kernel modules be insmod'ed?
> 
> They shouldn't be introduced in kernel space after initialization.
> Loadable kernel modules are weak by design and common target of a wide
> range of infection/injection techniques which go from redirection
> (hijacking) internal functions to other weird things like run-time
> kernel patching.
> 

But what if the insmod (and friends) were designed to counter this? For example, insmod will first look for the certificate and authorize the module before loading it into the kernel proper?

> Anyways, users with access to the sysadm_r role would be allowed to do
> such operations.
> 
> > Sorry, I
> >  know I can dig through the sources and find out how this is handled,
> >  but any handholding at this study stage (for me) would be very
> >  helpful.
> 
> Well, the documentation is maintained at the NSA website section for
> SELinux and it's quite well structured, enough to make it a straight
> forward reading. It's best to read the documentation first and then come
> with concrete questions which we (everyone of us, subscribers of the
> list, etc) can answer properly.
> 
> > Should I be creating one more privilege level and assign it
> >  to a "central authority", purely for dealing with the setup and
> >  configuration of the security policies itself (for example, the
> >  network operator/carrier or some such entity)?
> 
> SELinux is not about a CA-based model, in any case.
> You should just rely on roles. For example, security officer, user,
> admin, operator, etc. I think you should mature your idea a bit more. It
> might be an interesting literature for the case, the Simone
> Fischer-Hübner  privacy model documentation (it's always good to talk
> also about others' projects when they are well-done) already implemented
> by the RSBAC folks. Sidenote: RSBAC hasn't been tested in the embedded
> devices scenarios nor in other scenarios like multi-processor machines
> with a certain level of complexity.
> 
> > Pls note that we are
> >  trying to make the person with "physical access to the system" to be
> >  able to do whatever a "privileged user" can do, but at the same time,
> >  just not give enough power for configuration of the security policy
> >  itself, without authorization.
> 
> Ironically, someone with physical access to the device can do literally
> anything with minimal knowledge on electronics. As I said, everything is
> important when talking about security, and more with the physical
> factor. I would recall on Nokia and Siemens as examples. They don't
> apply the typical obscurity techniques to mobile phones (ie. covering
> the circuits with another layer of black, opaque material. Same as the
> AlphaShield manufacturer did in the past, and maybe still does. It's
> weird but works).
> 
Well, not really. Someone with physical access to the system, but who does not necessarily have, lets say, the device specific key, can be made to do very "restricted things" (leaving out the DoS attacks for now, nobody wants to do that on his own phone!) There's just a new paradigm here, where we don't really have an attacker vs user alone, but in the case of a mobile phone, the end user, the operator and the OEM, all working together, and yet, wanting to do "secure things".. :-)

> You need to truly assure both software-level and hardware-level
> security.
> 

Yes, very true. But assuming we have the hardware resources in place, and assuming that tamperproofing (using software certificates, and not the black/opaque material) is employed effectively, we are trying to study and find out how to best leverage what a great concept like SELinux can offer, for the kernel level security. Basically, we have already (arguably) taken care of the kernel integrity (tamperproof) but just looking at ways to seal it from the loadable modules, and the filesystem perspective.

> > Does SELinux require a writeable filesystem always?
> 
> Try to remount / as read-only in any machine, be it running SELinux or
> not.
> 
> >  What if I want to use CRAMFS which is a ReadOnly system?
> 
> CramFS is not intended for this, nor others like SquashFS. I don't know
> a lot about these file-systems, anyways. I just know they're not for
> your purposes.
> 

Well, embedded devices typically end up having either Cramfs or JFFS2.

> > Also, do you
> >  think that filesystem related issues will be the most important issues
> >  to live with?
> 
> One of the most important ones, definitely.
> 
> > I'm asking this because there are only a countable
> >  number of FS variants for embedded systems AFAIK, so we can *maybe*
> >  take them on one at a time.
> 
> Or end up doing one at our own...

Yes, of course. I'll be glad to, once I know that I'm not reinventing the wheel. Any pointers on whether someone is working on this path?
> 
> Cheers,
> --
> Lorenzo Hernández García-Hierro <lorenzo@gnu.org>
> [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* SELinux for embedded devices...
@ 2005-07-29  2:20 Sriram, Kannan
  2005-07-29  4:12 ` Lorenzo Hernández García-Hierro
  2005-07-29 13:10 ` Stephen Smalley
  0 siblings, 2 replies; 10+ messages in thread
From: Sriram, Kannan @ 2005-07-29  2:20 UTC (permalink / raw)
  To: SELinux Mail List


Hello all,

 I'm a newbie to SELinux, trying to figure out if SELinux is applicable/
suitable to embedded system security, especially mobile terminals/
smartphones. I have the following very basic questions... Pls help me
out, or redirect me to the appropriate forum.

1. Is SELinux applicable and suitable for mobile equipment, where the
end user always has root privileges? Has SELinux been ported to any
embedded device yet (some ARM platform??).

2. Assuming I have made the kernel on the flash to be tamperproof (can't
replace the SElinux image on the flash with the "SE" part disabled),
isn't  it still possible at runtime to disable the security server?

3. Same as above, is it possible to change the security policy files, or
reload a different set of policies (given root access).

And now the big question, is there a way to prevent both (2) and (3)??
Or have I completely misunderstood the whole thing??

Thanks in advance,
Sriram.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-07-29 21:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-29  4:47 SELinux for embedded devices Sriram, Kannan
2005-07-29  6:09 ` Lorenzo Hernández García-Hierro
2005-07-29  8:44 ` Luke Kenneth Casson Leighton
2005-07-29 13:16   ` Stephen Smalley
2005-07-29 21:08     ` Christopher J. PeBenito
  -- strict thread matches above, loose matches on Subject: below --
2005-07-29  6:30 Sriram, Kannan
2005-07-29  2:20 Sriram, Kannan
2005-07-29  4:12 ` Lorenzo Hernández García-Hierro
2005-07-29  8:55   ` Luke Kenneth Casson Leighton
2005-07-29 13:10 ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.