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

Accept strings and lists for ssh_allow_users #850

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schurzi
Copy link
Contributor

@schurzi schurzi commented Feb 9, 2025

This makes our ssh_hardening role accept both strings and lists for ssh_allow_users.

@rndmh3ro WDYT?

Initially I thought this may be a good idea to allow more flexible use. But there is also an overlap with our documentation that states this should be a string since a long time. Also if we allow two types to be passed here we cannot use argument spec to check the variable anymore.

The alternative would be to add a type check to argument spec and simply fail before executing.

closes #838

@rndmh3ro
Copy link
Member

It would be more flexible, yes. If we could do it in a backwards compatible way, it would be best.

Also if we allow two types to be passed here we cannot use argument spec to check the variable anymore.

We could use an assert-task for this, but I'm not really a fan.

We could also introduce a new variable ssh_allow_users_list and use this, if it exists, otherwise the string.. However this could also be complicated, e.g. what happens when both are set.

The alternative would be to add a type check to argument spec and simply fail before executing.

Can you expand on what you mean with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ssh_hardening] AllowUsers passing user with brackets
2 participants