Skip to contentSkip to conversation

Menu locks / password authentication

DISCUSSION Robert Millan 4 participants 9 messages Feb 27, 2009 – Mar 9, 2009

lore
Share & tools
lore
#0 lore raw

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Perhaps this would be a good time to retake the discussion on implementing an equivalent to "lock" and "password" commands. I think I even sent a patch a while ago!

Vesa, do you still think we should design an extensible framework for authentication before we do anything else? I think it'd be interesting if we could implement the lock/password paradigm, even if later it would be replaced, since our users commonly need this, and it's blocking the transition from GRUB Legacy.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#1 lore raw
Quoted 8 lines · Robert Millan

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Perhaps this would be a good time to retake the discussion on implementing an equivalent to "lock" and "password" commands. I think I even sent a patch a while ago!

Quoted 5 lines

Vesa, do you still think we should design an extensible framework for authentication before we do anything else? I think it'd be interesting if we could implement the lock/password paradigm, even if later it would be replaced, since our users commonly need this, and it's blocking the transition from GRUB Legacy.

I think that most important thing at this time is to match needed functionality with GRUB legacy. So just make it clean and perhaps think a bit about how it can be easily extended :).

I think there was some hash algorithms posted previously that could be used for this.

#2 lore raw
Quoted 15 lines · Vesa Jääskeläinen
Quoted 8 lines · Robert Millan

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Perhaps this would be a good time to retake the discussion on implementing an equivalent to "lock" and "password" commands. I think I even sent a patch a while ago!

Quoted 5 lines

Vesa, do you still think we should design an extensible framework for authentication before we do anything else? I think it'd be interesting if we could implement the lock/password paradigm, even if later it would be replaced, since our users commonly need this, and it's blocking the transition from GRUB Legacy.

Quoted 6 lines

I think that most important thing at this time is to match needed functionality with GRUB legacy. So just make it clean and perhaps think a bit about how it can be easily extended :).

I think there was some hash algorithms posted previously that could be used for this.

Hashing is nice, but basic password support can work without hash. If you give grub.cfg the proper perms, that is.

Anyway, for those interested:

http://www.mail-archive.com/[email protected]/msg05350.html

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#3 lore raw
In reply to Robert Millan
Quoted 5 lines · Robert Millan

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Actualy... I'm working on password command...

At this moment I have plain password checking and
almost finished MD5 support.

Signature · 3 lines
- -  (_ _) Regards                                       -----,  (_ _)  - -
-     ','  |  Michał Radomski <ezzo (at) poczta (dot) pl>     |   ','     -
- -  vv-   `---                                                    -vv  - -
#4 lore raw
Quoted 9 lines · Michał Radomski
Quoted 4 lines · Robert Millan

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Actualy... I'm working on password command...

At this moment I have plain password checking and almost finished MD5 support.

What is your design? Is it expandable? Flexible?

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
#5 lore raw
Quoted 6 lines · phcoder
Quoted 5 lines · Michał Radomski
Quoted 4 lines · Robert Millan

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Quoted 7 lines
Quoted 5 lines

Actualy... I'm working on password command...

At this moment I have plain password checking and almost finished MD5 support.

What is your design? Is it expandable? Flexible?

Flexible Yes, expandable I think yes.

Password checking is implemented as grub module, which blocks grub execution until user supply a valid password. Take a look at 2 sample configs:

# this config will wait for valid password 
# after that it will show grub menu 
set timeout=5
password --plain qwerty 

menuentry "Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda1 ro
initrd /kernel26.img
}

# this config will show menu, but if user would like to boot os,
# it will ask for a password.  
set timeout=5

menuentry "Linux" {
password --md5 md5_hash
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda1 ro
initrd /kernel26.img
}

md5 algoritm is implemented as a library(grub2/lib), So it can by easy used in other source files.

I've also think about more complex solution (password file) And I think that it is possible to add, without many changes.

Signature · 3 lines
- -  (_ _) Regards                                       -----,  (_ _)  - -
-     ','  |  Michał Radomski <ezzo (at) poczta (dot) pl>     |   ','     -
- -  vv-   `---                                                    -vv  - -
#6 lore raw
Quoted 38 lines · Michał Radomski
Quoted 6 lines · phcoder
Quoted 5 lines · Michał Radomski
Quoted 4 lines · Robert Millan

It's funny, we're all discussing about performing security measurements in GRUB and nobody mentioned that our user interface lacks even the most basic lock mechanism :-)

Quoted 6 lines
Quoted 4 lines

Actualy... I'm working on password command...

At this moment I have plain password checking and almost finished MD5 support.

What is your design? Is it expandable? Flexible?

Flexible Yes, expandable I think yes.

Password checking is implemented as grub module, which blocks grub execution until user supply a valid password. Take a look at 2 sample configs:

# this config will wait for valid password # after that it will show grub menu set timeout=5
password --plain qwerty 

menuentry "Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda1 ro
initrd /kernel26.img
}

# this config will show menu, but if user would like to boot os,
# it will ask for a password.  set timeout=5

menuentry "Linux" {
password --md5 md5_hash set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda1 ro
initrd /kernel26.img
}

Quoted 7 lines

md5 algoritm is implemented as a library(grub2/lib), So it can by easy used in other source files.

I've also think about more complex solution (password file) And I think that it is possible to add, without many changes.

What prevents an attacker from simply pressing 'e' or 'c' in menu? I personally would prefer the architecture with users as I described. Also I would recommend using other hashes that md5 (e.g. whirlpool or sha-2) because it's been depreceated And blocking is a bad idea because if a legitimate user accidently chooses wrong entry he can't press ESC to go back.
Do you already have a copyright assignment?

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
#7 lore raw
Quoted 2 lines · phcoder

I would recommend using other hashes that md5 (e.g. whirlpool or sha-2) because it's been depreceated

I chose md5 because it is in grub2 wiki (see command list) It is not a problem to add sha-2 or whirlpool.

Quoted 1 line

Do you already have a copyright assignment?

You mean license? GPL3

md5 code is based on grub-legacy. Some code is mine, some is from old grub. I hope that this is not a problem...

Signature · 3 lines
- -  (_ _) Regards                                       -----,  (_ _)  - -
-     ','  |  Michał Radomski <ezzo (at) poczta (dot) pl>     |   ','     -
- -  vv-   `---                                                    -vv  - -
#8 lore raw
Quoted 4 lines · Michał Radomski
Quoted 1 line · phcoder

I would recommend using other hashes that md5 (e.g. whirlpool or sha-2) because it's been depreceated

I chose md5 because it is in grub2 wiki (see command list) It is not a problem to add sha-2 or whirlpool.

grub1 has been depreceated and command list has been provided as a feature comparison.

Quoted 4 lines
Quoted 2 lines

Do you already have a copyright assignment?

You mean license? GPL3

No if you want to code for grub2 you have to sign the copyright assignment. look at "contributing changes"

Quoted 2 lines

md5 code is based on grub-legacy. Some code is mine, some is from old grub. I hope that this is not a problem...

I think that your design really has to be discussed

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko