Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The debate rages on: Is PL/I Bachtrian or Dromedary?


devel / comp.arch.embedded / Re: Linux devices and root password

SubjectAuthor
* Linux devices and root passwordpozz
`* Re: Linux devices and root passwordTheo
 `* Re: Linux devices and root passwordpozz
  `* Re: Linux devices and root passwordTheo
   `- Re: Linux devices and root passwordpozz

1
Linux devices and root password

<ucngqo$2of1d$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1639&group=comp.arch.embedded#1639

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Linux devices and root password
Date: Wed, 30 Aug 2023 15:39:36 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <ucngqo$2of1d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 30 Aug 2023 13:39:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f77facf7be3bd18696b3d3b4084bedba";
logging-data="2898989"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18stVHiT9D9o/CcuQX38P1USnJtXuuUL3w="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:SA+2jr3Rvw9M1Q+wAavHBsQat6E=
 by: pozz - Wed, 30 Aug 2023 13:39 UTC

This is the first time I release an embedded device based on Linux OS
(it runs on iMX6ULL CPU).

This device will be produced in a medium scale (100-1000 pieces). I'm
thinking about root password: should it be the same on all the devices,
or should it be different?

Each device has a different 4 bytes serial number. I could use it to
scramble an unencrypted password and obtain an enctrypted password that
will be the normal root password.

I could disable SSH service at all to be safer, but anyway the board has
a console over UART that I don't want to disable.

Any suggestions?

Re: Linux devices and root password

<Otj*0Q9oz@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1640&group=comp.arch.embedded#1640

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: theom+n...@chiark.greenend.org.uk (Theo)
Newsgroups: comp.arch.embedded
Subject: Re: Linux devices and root password
Date: 30 Aug 2023 17:14:08 +0100 (BST)
Organization: University of Cambridge, England
Message-ID: <Otj*0Q9oz@news.chiark.greenend.org.uk>
References: <ucngqo$2of1d$1@dont-email.me>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="30614"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Wed, 30 Aug 2023 16:14 UTC

pozz <pozzugno@gmail.com> wrote:
> This is the first time I release an embedded device based on Linux OS
> (it runs on iMX6ULL CPU).
>
> This device will be produced in a medium scale (100-1000 pieces). I'm
> thinking about root password: should it be the same on all the devices,
> or should it be different?

If it's the same and network accessible, it'll get added to databases of
root passwords that get used for exploits. Doing that is also forbidden by
law in some jurisdictions (eg UK).

> Each device has a different 4 bytes serial number. I could use it to
> scramble an unencrypted password and obtain an enctrypted password that
> will be the normal root password.
>
> I could disable SSH service at all to be safer, but anyway the board has
> a console over UART that I don't want to disable.
>
> Any suggestions?

Having a fixed root password that's only accessible via a UART inside the
case is safe, but not if via network.

Disabling SSH if the customer doesn't need it is generally a good idea, since
it's just another channel for attacks (or, even if not vulnerable, it
creates noise in your logs/IDS).

Standard best-practice is to provision a unique password but to print it on
a label on the device (eg on the back or underneath) so physical access is
needed to discover it.

Do you have a provisioning flow where new devices get loaded with their
firmware, MAC address and similar identifiers? Could you set the password
there?

Theo

Re: Linux devices and root password

<ucpsed$38prj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1641&group=comp.arch.embedded#1641

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Re: Linux devices and root password
Date: Thu, 31 Aug 2023 13:10:05 +0200
Organization: A noiseless patient Spider
Lines: 85
Message-ID: <ucpsed$38prj$1@dont-email.me>
References: <ucngqo$2of1d$1@dont-email.me>
<Otj*0Q9oz@news.chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 31 Aug 2023 11:10:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="154d85a70f92878edc74018aaf03850d";
logging-data="3434355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+66xqKGL7fN88TUFOEZpee2OjwfDQpE/8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:CYhn26NLyRlltRW49FmY97gT+4I=
In-Reply-To: <Otj*0Q9oz@news.chiark.greenend.org.uk>
 by: pozz - Thu, 31 Aug 2023 11:10 UTC

Il 30/08/2023 18:14, Theo ha scritto:
> pozz <pozzugno@gmail.com> wrote:
>> This is the first time I release an embedded device based on Linux OS
>> (it runs on iMX6ULL CPU).
>>
>> This device will be produced in a medium scale (100-1000 pieces). I'm
>> thinking about root password: should it be the same on all the devices,
>> or should it be different?
>
> If it's the same and network accessible, it'll get added to databases of
> root passwords that get used for exploits. Doing that is also forbidden by
> law in some jurisdictions (eg UK).

The device will be connected to Internet, but I'm going to disable SSH,
because the application and the user won't need it.

The password here is the **root** password, where root is the Linux root
user, not an admin user.

The device runs a web server and the user can interact with it with a
standard web browser. The web application is protected by a login
(username and password), but the "web users" are different from Linux
root user.

The default web user will be admin/admin and hopefully the user will
change the password at the first login.

This post refers to Linux root user that isn't normally exposed to the
end-users, mostly if I disable SSH service.

My concerns are for someone with sufficient technical skills that wants
to enter the Linux system. The first thing he would do is finding the
console UART, connect/soldering a USB/UART converter, open putty and try
to login guessing the root password.

The original question was for this scenario.

>> Each device has a different 4 bytes serial number. I could use it to
>> scramble an unencrypted password and obtain an enctrypted password that
>> will be the normal root password.
>>
>> I could disable SSH service at all to be safer, but anyway the board has
>> a console over UART that I don't want to disable.
>>
>> Any suggestions?
>
> Having a fixed root password that's only accessible via a UART inside the
> case is safe, but not if via network.

So in my case is safe, because via network SSH will be disabled and web
application uses different credentials.

> Disabling SSH if the customer doesn't need it is generally a good idea, since
> it's just another channel for attacks (or, even if not vulnerable, it
> creates noise in your logs/IDS).
>
> Standard best-practice is to provision a unique password but to print it on
> a label on the device (eg on the back or underneath) so physical access is
> needed to discover it.

It's useless in my application. The end-user will never need the Linux
root password, only an hacker would need it and I wouldn't show him the
password well printed on a label.

> Do you have a provisioning flow where new devices get loaded with their
> firmware, MAC address and similar identifiers? Could you set the password
> there?

Yes, in case I choose to set a different Linux root password for each
device, the choice of password will be done during programming of
firmware and so on.

In this case I can generate a random password, saving it in a database
of devices. However, the time I need to enter the system (if something
goes wrong and I need to read logs or issue commands), I need the serial
number and the database.

If I generate the password from the serial number using a well-known
algorithm, I could always recover the Linux root password from the
serial number only.

I'm wondering if there was a standard or typical approach here.

Re: Linux devices and root password

<Ptj*lycpz@news.chiark.greenend.org.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1642&group=comp.arch.embedded#1642

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!callisto.xs3.de!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: theom+n...@chiark.greenend.org.uk (Theo)
Newsgroups: comp.arch.embedded
Subject: Re: Linux devices and root password
Date: 31 Aug 2023 14:39:57 +0100 (BST)
Organization: University of Cambridge, England
Message-ID: <Ptj*lycpz@news.chiark.greenend.org.uk>
References: <ucngqo$2of1d$1@dont-email.me> <Otj*0Q9oz@news.chiark.greenend.org.uk> <ucpsed$38prj$1@dont-email.me>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="1717"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Thu, 31 Aug 2023 13:39 UTC

pozz <pozzugno@gmail.com> wrote:
> This post refers to Linux root user that isn't normally exposed to the
> end-users, mostly if I disable SSH service.
>
> My concerns are for someone with sufficient technical skills that wants
> to enter the Linux system. The first thing he would do is finding the
> console UART, connect/soldering a USB/UART converter, open putty and try
> to login guessing the root password.
>
> The original question was for this scenario.

It depends whether the customer is your adversary or not.

If you want to prevent the customer having access, eg because hacking the
device would cause them to get free service or similar, then preventing root
access is a roadblock for this. Or if the device has users whose motives
aren't aligned with the customer (eg it's installed in a public place where
people might tamper with it).

If the customer has bought the equipment and there is nothing the customer
or their users can illicitly gain access to, I'd suggest leaving a default
root password on there - it enables the customer full access to a device
they own and have physical access to, and gives them options for extending
the use of the device once its original purpose is ended (eg if you stop
supporting it). If they choose to break their device, that's their problem.

(some devices set a 'warranty void' bit if unauthorised firmware is loaded,
to avoid having to handle warranty claims on modified devices. Only some
SoCs have such non-resettable 'e-fuses')

I'm also assuming there are no other interfaces which might render any
password protection moot - like being able to unplug the flash storage and
change the password in another machine, or being able to use JTAG to
reprogram the flash chip. If so, it may be simply a matter of difficulty -
pulling an SD card is easy, soldering to testpoints to access JTAG lines
less so.

One other thing, though. If you have a fixed root password, make sure you
ensure that regular user processes can't 'su' to root. Otherwise any
networked user who is able to inject shell commands can get root.

Theo

Re: Linux devices and root password

<ucrvsf$3lu60$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1644&group=comp.arch.embedded#1644

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pozzu...@gmail.com (pozz)
Newsgroups: comp.arch.embedded
Subject: Re: Linux devices and root password
Date: Fri, 1 Sep 2023 08:21:03 +0200
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <ucrvsf$3lu60$1@dont-email.me>
References: <ucngqo$2of1d$1@dont-email.me>
<Otj*0Q9oz@news.chiark.greenend.org.uk> <ucpsed$38prj$1@dont-email.me>
<Ptj*lycpz@news.chiark.greenend.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 1 Sep 2023 06:21:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d50c6c7d197e7c7552de6b4b2897f3ad";
logging-data="3864768"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/hknibhuCCpenVjvjVAg0eSMqReikr7w="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
Cancel-Lock: sha1:vIDnGp+sxvOeJJfuGhfCH/O3k1M=
In-Reply-To: <Ptj*lycpz@news.chiark.greenend.org.uk>
 by: pozz - Fri, 1 Sep 2023 06:21 UTC

Il 31/08/2023 15:39, Theo ha scritto:
> pozz <pozzugno@gmail.com> wrote:
>> This post refers to Linux root user that isn't normally exposed to the
>> end-users, mostly if I disable SSH service.
>>
>> My concerns are for someone with sufficient technical skills that wants
>> to enter the Linux system. The first thing he would do is finding the
>> console UART, connect/soldering a USB/UART converter, open putty and try
>> to login guessing the root password.
>>
>> The original question was for this scenario.
>
> It depends whether the customer is your adversary or not.

It isn't... usually :-)

> If you want to prevent the customer having access, eg because hacking the
> device would cause them to get free service or similar, then preventing root
> access is a roadblock for this. Or if the device has users whose motives
> aren't aligned with the customer (eg it's installed in a public place where
> people might tamper with it).
>
> If the customer has bought the equipment and there is nothing the customer
> or their users can illicitly gain access to, I'd suggest leaving a default
> root password on there - it enables the customer full access to a device
> they own and have physical access to, and gives them options for extending
> the use of the device once its original purpose is ended (eg if you stop
> supporting it). If they choose to break their device, that's their problem.
>
> (some devices set a 'warranty void' bit if unauthorised firmware is loaded,
> to avoid having to handle warranty claims on modified devices. Only some
> SoCs have such non-resettable 'e-fuses')

I simply don't want some "smart" users with sufficient technical skills
would be able to understand how the device does the things it does.
For example, sniffing the code of Linux scripts or Python code of
proprietary software.

Maybe some "users" that work in competitors.

> I'm also assuming there are no other interfaces which might render any
> password protection moot - like being able to unplug the flash storage and
> change the password in another machine, or being able to use JTAG to
> reprogram the flash chip. If so, it may be simply a matter of difficulty -
> pulling an SD card is easy, soldering to testpoints to access JTAG lines
> less so.

If there was infinite technical knowledge and money, it would be
impossible to protect the device. Here I would like to stop only
"medium/low" hackers.

> One other thing, though. If you have a fixed root password, make sure you
> ensure that regular user processes can't 'su' to root. Otherwise any
> networked user who is able to inject shell commands can get root.

Good point. Anyway, I think it's valid if the root password isn't fixed.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor