Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice to authenticate 2 machines in a M2M environment

I have multiple tiny Linux embedded servers on Beaglebone Black (could by a RaspberryPi, it makes no difference) that need to exchange information with a main server (hosted on the web).

Ideally, each system talks to each other by simple RESTful commands - for instance, the main server sends out new configurations to the embedded servers - and the servers send back data. Commands could be also issued by a human user from the main server or directly to the embedded servers.

What would it be the most "standard" way of authentication of each server against each other? I'm thinking OAuth, assuming that each machine has its own OAuth user - but I'm not sure if that is the correct pattern to follow.

like image 645
Roberto Avatar asked Oct 06 '13 12:10

Roberto


People also ask

What is M2M authentication?

Machine authentication is the authorization of an automated human-to-machine or machine-to-machine (M2M) communication through verification of a digital certificate or digital credentials.

Which OAuth 2.0 Grant types you will use in case of M2M machine to machine communication?

Auth0 Docs For these cases, OAuth 2.0 provides the client credentials grant flow. In this post, we will take a look at how the client credentials grant from OAuth 2.0 can be used with Auth0 for machine to machine (M2M) communications. "Learn to use machine to machine authorization with Auth0!"

How does machine authentication work?

About Machine AuthenticationWhen a Windows device boots, it logs onto the network domain using a machine account. Within the domain, the device is authenticated before computer group policies and software settings can be executed; this process is known as machine authentication.

What is service service authentication?

The Service to Service (S2S) authentication framework provides a means for a trusted partner application to establish user sessions with a trusting provider application on behalf of its users, without having to supply any credentials for the users individually.


2 Answers

What would it be the most "standard" way of authentication of each server against each other? I'm thinking OAuth, assuming that each machine has its own OAuth user - but I'm not sure if that is the correct pattern to follow.

Authenticating machines is no different than authenticating users. They are both security principals. In fact, Microsoft made machines a first-class citizen in Windows 2000. They can be a principal on securable objects like files and folders, just like regular users can.

(There is some hand waving since servers usually suffer from the Unattended Key Storage problem described by Gutmann in his Engineering Security book).

I would use a private PKI (i.e., be my own Certification Authority) and utilize mutual authentication based on public/private key pairs like SSL/TLS. This has the added benefit of re-using a lot of infrastructure, so the HTTP/HTTPS/REST "just works" as it always has.

If you use a Private PKI, issue certificates for the machines that include the following key usage:

  • Digital Signature (Key Usage)
  • Key Encipherment (Key Usage)
  • Key Agreement (Key Usage)
  • Web Client Authentication (Extended Key Usage)
  • Web Server Authentication (Extended Key Usage)

Or, run a private PKI and only allow communications between servers using a VPN based on your PKI. You can still tunnel your RESTful requests, and no others will be able to establish a VPN to one of your servers. You get the IP filters for free.

Or use a Kerberos style protocol with a key distribution center. You'll need the entire Kerberos infrastructure, including a KDC. Set up secure channels based on the secrets proctored by the KDC.

Or, use a SSH-like system, public/private key pairs and sneaker-net to copy the peer's public keys to one another. Only allow connections from machines whose public keys you have.

I probably would not use an OAuth-like system. In the OAuth-like system, you're going to be both the Provider and Relying Party. In this case, you might as well be a CA and reuse everything from SSL/TLS.

like image 160
jww Avatar answered Oct 17 '22 18:10

jww


I think you need to Implement Mutual Authentication between servers using SSL for your requirement.
I do not know much about M2M environment , but using OAuth for Authenticating your Servers is OverKill .

https://security.stackexchange.com/questions/34897/configure-ssl-mutual-two-way-authentication


Also Encrypting your Communication Channel while Sending commands would make it more safe from Attacks

like image 25
spetzz Avatar answered Oct 17 '22 19:10

spetzz