Security
March 31, 2023

LXD Password and Token Security

We share some security tips for working with LXD's password and token.

Low-code tools are going mainstream

Purus suspendisse a ornare non erat pellentesque arcu mi arcu eget tortor eu praesent curabitur porttitor ultrices sit sit amet purus urna enim eget. Habitant massa lectus tristique dictum lacus in bibendum. Velit ut viverra feugiat dui eu nisl sit massa viverra sed vitae nec sed. Nunc ornare consequat massa sagittis pellentesque tincidunt vel lacus integer risu.

  1. Vitae et erat tincidunt sed orci eget egestas facilisis amet ornare
  2. Sollicitudin integer  velit aliquet viverra urna orci semper velit dolor sit amet
  3. Vitae quis ut  luctus lobortis urna adipiscing bibendum
  4. Vitae quis ut  luctus lobortis urna adipiscing bibendum

Multilingual NLP will grow

Mauris posuere arcu lectus congue. Sed eget semper mollis felis ante. Congue risus vulputate nunc porttitor dignissim cursus viverra quis. Condimentum nisl ut sed diam lacus sed. Cursus hac massa amet cursus diam. Consequat sodales non nulla ac id bibendum eu justo condimentum. Arcu elementum non suscipit amet vitae. Consectetur penatibus diam enim eget arcu et ut a congue arcu.

Vitae quis ut  luctus lobortis urna adipiscing bibendum

Combining supervised and unsupervised machine learning methods

Vitae vitae sollicitudin diam sed. Aliquam tellus libero a velit quam ut suscipit. Vitae adipiscing amet faucibus nec in ut. Tortor nulla aliquam commodo sit ultricies a nunc ultrices consectetur. Nibh magna arcu blandit quisque. In lorem sit turpis interdum facilisi.

  • Dolor duis lorem enim eu turpis potenti nulla  laoreet volutpat semper sed.
  • Lorem a eget blandit ac neque amet amet non dapibus pulvinar.
  • Pellentesque non integer ac id imperdiet blandit sit bibendum.
  • Sit leo lorem elementum vitae faucibus quam feugiat hendrerit lectus.
Automating customer service: Tagging tickets and new era of chatbots

Vitae vitae sollicitudin diam sed. Aliquam tellus libero a velit quam ut suscipit. Vitae adipiscing amet faucibus nec in ut. Tortor nulla aliquam commodo sit ultricies a nunc ultrices consectetur. Nibh magna arcu blandit quisque. In lorem sit turpis interdum facilisi.

“Nisi consectetur velit bibendum a convallis arcu morbi lectus aecenas ultrices massa vel ut ultricies lectus elit arcu non id mattis libero amet mattis congue ipsum nibh odio in lacinia non”
Detecting fake news and cyber-bullying

Nunc ut facilisi volutpat neque est diam id sem erat aliquam elementum dolor tortor commodo et massa dictumst egestas tempor duis eget odio eu egestas nec amet suscipit posuere fames ded tortor ac ut fermentum odio ut amet urna posuere ligula volutpat cursus enim libero libero pretium faucibus nunc arcu mauris sed scelerisque cursus felis arcu sed aenean pharetra vitae suspendisse ac.

LXD has many ways of handling authentication. You can use passwords or you can use tokens, you can even use something called Candid for handling authentication with advanced RBAC capabilities. In this post we will cover some best practices for setting up LXD and how to make sure your cluster is secure.

Password Authentication

When you initialize your LXD cluster there is one option where it asks you if you want to setup a password for your cluster. For the most part I would recommend choosing ‘no’ for this. What this option does is it sets up password authentication for the cluster.

When you need to add trusted clients to the cluster you are able to use this password. For simple setups this should be ok. What the official LXD documentation recommends is once you’ve added all the clients you unset the trust password.

You can unset the password by running the following command:

lxc config unset core.trust_password

If you want to set the password to something else you can also do:

lxc config set core.trust_password someSecret

However LXD offers a much better authentication option which is simple and secure.

Token Based Authentication

My recommendation is if you’re using LXD version > 4.23 you have the option of dropping password authentication altogether. You can switch to completely using token based authentication.

Generating a Trust Token

If you wish to add a trusted client to LXD using tokens you can do so by using the following command:

lxc config trust add

Please provide client name: example

If you want to add a token and specify the name without waiting for the prompt you can do so in this way:

lxc config trust add --name example

This will spit out the token right away without a prompt asking for a name.

Once you type the name in LXD will generate a token. You can then give this token to the client who is trying to access your cluster. When they’re asked for the password they can use the token in place of the password.

At this point you may ask, how is this different from passwords. The main difference is the following:

  • Tokens are 1 time use which means once they’re consumed they can’t be used again
  • This inherently means they cannot be shared
  • Because tokens are not persistent the cluster is not suseptible to brute-force attack

Viewing a List of Tokens

If you wish to see a list of issued tokens you can use the following command:

lxc config trust list-tokens

This will spit out all the tokens you’ve issued. If you name your tokens correctly you can easily see who they’re issued to. You can also revoke the token by using the following:

lxc config trust revoke-token example

As you can see tokens offer much better control over how your LXD cluster is accessed.

Managing Clients

Once a client is authenticated to access your cluster you can view a list of clients using the following:

lxc config trust list

This should spit out a list of clients that your LXD cluster trusts. You can also remove clients by using the following:

lxc config trust remove [name]

This post is designed to give you a quick understanding of how authentication works in LXD and how you can have control over who accesses your cluster. We hope you enjoyed it!

OpsMaru is a no code end-to-end deployment platform builder. It's made for freedom, flexibility, speed and simplicity.

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.