Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add DVLS Ansible Module to create/update secrets #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

PatrickEPG
Copy link

I've added a module to upload secrets to dvls.

When the a secret already exists, it will be updated. When the secret does not yet exist, a new entry will be created.
I also added some documentation.

This is my first Open-Source contribution so any feedback is very welcome.

@richerlariviere
Copy link

Hello Patrick,

I wanted to sincerely thank you for your contribution, especially since it's your first one. Our society needs more generous people like you, and I wanted to highlight your effort.

By the way, I wanted to clarify with you the mission of the Ansible module for DVLS. To facilitate the maintenance of our various integrations with DVLS, we have decided that these integrations should be used to consume DVLS in read-only mode (we're avoiding write and configuration operations). With read-write management comes inherent complexity, and since DVLS supports multiple entry types, it is unrealistic for us to support all these use cases across our different integrations. Considering that I cannot merge this PR unfortunately.

I'm still interested to know about your specific use-case though. What are the advantages of creating/updating DVLS secrets outside of DVLS UI? I'd really appreciate your feedback regarding that.

Have a nice day,
Richer

@PatrickEPG
Copy link
Author

Hi Richer,
thank you for the information.

We want to fully automate the deployment of some of our software. So when we deploy the database, users/passwords will be created, which need to be stored somewhere.
Since these Credentials will be consumed by following deployments (software that uses the database) as well as Admins/Support Agents, we figured DVLS is the place to store them.

If I understand correctly, the PowerShell Module https://github.com/Devolutions/SecretManagement.DevolutionsServer allows the creation of secrets and the API allows it as well, which is what I used to implement. Is there a difference in using the PowerShell Module/API directly instead of utilizing Ansible?

Kind regards
Patrick

@richerlariviere
Copy link

Hey @PatrickEPG I think you'll be happy. I just had a talk with our CEO David and we decided to consider your use-case. We are now open to support simple entry types. We will review your PR shortly.

Stay tuned!

Copy link
Contributor

@DannyBedard DannyBedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm good job! I requested some changes for the format and the documentation.

README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe write a usage with non-required options since there is many of them?

Also I'd write the possible options for type and subtype. As of today, we support only Credentials for type and for subtype we support

  • "AccessCode"
  • "ApiKey"
  • "AzureServicePrincipal"
  • "ConnectionString"
  • "Passkey"
  • "PrivateKey"
  • "Default"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options such as secret_path, secret_type, secret_subtype and secret_description could be in the secret object

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, this would open up the possibility to change the secret Object to a list, that way the module could support uploading multiple secrets in one run.
My initial though was to loop the module inside ansible.

I have an idea:
The variables are moved inside the secret Object and I change the secret Object to a list to support the upload of multiple secrets.
Additionally the return Object logic is changed to always return the name and the ID of the secret, that way if 2 Secrets are created and 1 is updated there will always be 3 Names/IDs returned which can be identified.

Do you think this is a better approach?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep it simple for this release since it's the first implementation of this feature. The loop in Ansible should cover most cases, and if future use cases show a need for this (from you or others), we can adjust accordingly.

Returning the ID/name of the secrets is a good idea, since it can be useful for further operation in a playbook.

plugins/modules/create_secret.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants