gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connect to Unix domain socket instead of host:port


From: Pinnacle Systems Group
Subject: Re: Connect to Unix domain socket instead of host:port
Date: Thu, 19 Dec 2024 17:51:21 -0500

Hi Gary,

Thanks for your reply.

It’s not immediately clear to me—perhaps you have additional insight into the guy’s host and network setup—what “host” he’s on or how his host connected to the local network.

Given this uncertainty, and considering cgpsd isn’t inherently designed with robust security in mind, isn't it prudent to disable the default TCP listener and use a UNIX domain socket instead? The idea here is an ounce of prevention is worth a pound of cure...

Disabled TCP approach offers several significant security and performance advantages:

1. Enhanced Security

TCP sockets are accessible over the network, making them a potential target for unauthorized access or exploitation.

On the other hand, UNIX domain sockets are confined to the local system, and access can be tightly controlled through userland file permissions, ensuring only authorized users or processes can connect.

2. Reduced Overhead and Faster 

TCP communication involves network stack processing, which can introduce latency and consume additional system resources.

UNIX domain sockets bypass the network stack, allowing faster and more efficient local inter-process communication.

3. Simplified Access Control

With UNIX domain sockets, access permissions can be managed using filesystem ACLs, making it straightforward to define which users or groups have access to gpsd.


4. No Network Dependency

Using a UNIX domain socket eliminates reliance on network interfaces, reducing the risk of issues caused by network misconfigurations or outages.

For example, in a setup like gpsd -F /path/to/gpsd.sock, clients connect to the specified socket path instead of a TCP port. 

It’s important to ensure that file permissions on the socket are properly configured to allow client access without compromising security.

This configuration is generally a more secure and efficient option, especially when network exposure isn’t required. Let me know if this aligns with what you’ve seen or if there’s any additional context I should consider!

 UNIX domain sockets are confined to the local machine and can be secured with appropriate file permissions in the userland of his host.

Additionally, UNIX domain sockets can offer performance benefits by reducing network stack overhead, leading to more efficient inter-process communication on the same host.

Therefore, in scenarios where gpsd does not require remote network access, (and whether or not he "trust" his host machine)  configuring it to use UNIX domain sockets is a prudent choice to enhance security and efficiency.

Do you disagree? 

Best regards,


Riley 






On Thu, Dec 19, 2024, 4:31 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Pinnacle!

On Thu, 19 Dec 2024 08:58:17 -0500
Pinnacle Systems Group <pinnaclesystemsgroup@gmail.com> wrote:

> It's possible to configure gpsd to use a UNIX domain socket instead
> of the typical TCP host:port setup.

Not "instead of" but "in addition to".

> If your GNSS receiver communicates via a UNIX domain socket, you can
> specify the device using its path. For example:

OP says he wants to client conenct, not receiver conenct.

>    2. Client Connection to gpsd via a UNIX Domain Socket
>
> To allow clients to connect to gpsd through a UNIX domain socket, you
> can specify the socket path when starting gpsd. Use the -S flag to
> disable the default TCP listener and instead specify a UNIX socket
> path with the -F flag:

Dunno why you want to disable TCP clients.

>    This approach is often used to improve security and reduce
> overhead by avoiding TCP communication.

If you don't trust your host, you should not run gpsd on it.  The code
path's is the same for both, so no "efficiency" argument can be made.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]