MatthewKing / DeviceId

A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer.
MIT License
785 stars 118 forks source link

Question: Linux support and VM/AWS #9

Closed ykil closed 4 years ago

ykil commented 5 years ago

Looks interesting! Does this support VM and AWS? Or plans for it? And Would this work in .NET Core (sorry, still new to C#).

MatthewKing commented 5 years ago

Hello,

Yes, it definitely works in .NET Core.

In general, it won't work in Linux because a lot of the components are using WMI to obtain the system information. The non-WMI components should work, and you could write alternative Linux-friendly components and use those.

There's nothing that would stop it running on a VM, or AWS, but I'm not quite sure what the use case would be. Most other use cases are for uniquely identifying computers that are running a desktop application.

Hope this helps!

ykil commented 5 years ago

Thank you. Good to know about Linux.

I'm looking to make a simple in-house licensing (alternative to E.g. Flexera). We also run our desktop in VM/AWS and want to provide some level of license enforcement/protection. What I need to make sure is that each VM/AWS instance has a unique device id. Otherwise someone could clone an image and use that across multiple instances.

MatthewKing commented 5 years ago

It's hard to say, as it completely depends on your particular environments. I assume the OS is Windows?

I recommend experimenting with the various components, working out which ones are available on your instance, and then building a composite device ID using those components. Maybe start by looking at AddProcessorId, AddMotherboardSerialNumber, AddSystemDriveSerialNumber, AddSystemUUID, and AddFileToken, and then working from there.

developervariety commented 5 years ago

I'm looking for a solution for my Linux customers too. The only "solution" that worked for me out of this library were AddMachineName, AddUserName, AddOSVersion, and AddFileToken. I don't think it's much as all of it can be spoofed easily unlike CPU ID which is harder to do.

Any other method did not work due to being locked by WMI.

MatthewKing commented 5 years ago

Yeah, DeviceId was designed as a Windows-centric library first and foremost. I'm currently in the process of building some Linux components, but I don't have a timeline for their release yet.

There's some good options for Linux here - many of which can be wrapped into a DeviceId component.

developervariety commented 5 years ago

Perfect, thank you for your dedication towards this library. Can't wait to see what awaits in the future

developervariety commented 5 years ago

With the arrival of .NET Core 3.0 sometime in September some information might work with this library a bit more. In 2020 with the arrival of .NET 5 everything will be combined AIO so let's see where Microsoft takes us!

klyse commented 5 years ago

Hi Matthew, do you have a update on this?

I'm currently in the process of building some Linux components, but I don't have a timeline for their release yet.

daniel-scatigno commented 4 years ago

I Confirm that AddProcessorId() AddMotherboardSerialNumber() on iinux are not working

those would be a great improvement

MatthewKing commented 4 years ago

The next release will add some Linux support. Feel free to check out the most recent commits. I should be releasing it in the next few days.