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

Add test for password authentication #1169

Closed
bgilbert opened this issue Aug 18, 2021 · 3 comments · Fixed by #1189
Closed

Add test for password authentication #1169

bgilbert opened this issue Aug 18, 2021 · 3 comments · Fixed by #1189
Assignees
Labels
enhancement New feature or request jira For syncing to Jira. Only works for issues (i.e. not PRs)

Comments

@bgilbert
Copy link
Contributor

Add a test that provisions a user password via Ignition (replicating docs) and checks that the password works for local login. (We should be able to do that from the command line, without adding new functionality to kola.)

Perhaps we should also test that the passwd command creates a yescrypt password hash (i.e., one starting with $y$).

@bgilbert bgilbert added the enhancement New feature or request label Aug 18, 2021
@dustymabe dustymabe added the jira For syncing to Jira. Only works for issues (i.e. not PRs) label Aug 20, 2021
@dustymabe
Copy link
Member

Add a test that provisions a user password via Ignition (replicating docs) and checks that the password works for local login.

This particular part might be a bit tricky if we want to test SSH with password. AFAIU we'd need the sshpass utility. Maybe just verifying via a local su - is enough?

@dustymabe
Copy link
Member

something like: echo 'mypassword' | sudo --stdin -u testuser id

@bgilbert
Copy link
Contributor Author

I was thinking we'd primarily want to test local login, but it probably wouldn't hurt to test SSH for people who want to enable that. For the latter, we could add an internal kola test that uses SSHAgent.NewPasswordClient().

That sudo command will check the password for the core user, not testuser. And since core is in the sudo group, we won't get a password prompt by default. echo password | setsid su - testuser should work.

(su falls back to stdin if there's no controlling terminal, and setsid ensures there isn't one.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jira For syncing to Jira. Only works for issues (i.e. not PRs)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants