-
Notifications
You must be signed in to change notification settings - Fork 803
Add API to manage SSH authorized keys on Home Assistant OS #7039
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
f82109d
8ab0fe2
bd04e62
a39f211
9e567b1
dbe711c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,7 @@ class _AppSecurityPatterns: | |
| r"|/multicast/.+" | ||
| r"|/network/.+" | ||
| r"|/observer/.+" | ||
| r"|/os/(?!datadisk/wipe).+" | ||
| r"|/os/(?!datadisk/wipe|ssh/authorized_keys).+" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we make this a core only endpoint rather then a manager one? Putting it in manager would give many apps the ability to call it. I know its hardly the only attack avenue if you consider the idea of a malicious app but it still just doesn't seem like capability we want to allow apps to do. The downside would be the SSH app also can't call it which is probably the one app we'd prefer to allow. But as long as we make the proposed UI this seems like an acceptable situation to only allow host ssh key management from HA UI and the host shell itself. |
||
| r"|/refresh_updates" | ||
| r"|/resolution/.+" | ||
| r"|/security/.+" | ||
|
|
@@ -226,7 +226,7 @@ class _AppSecurityPatterns: | |
| r"|/multicast/.+" | ||
| r"|/network/.+" | ||
| r"|/observer/.+" | ||
| r"|/os/(?!datadisk/wipe).+" | ||
| r"|/os/(?!datadisk/wipe|ssh/authorized_keys).+" | ||
| r"|/reload_updates" | ||
| r"|/resolution/.+" | ||
| r"|/security/.+" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we truly want this endpoint to replace the entire authorized keys file with this new set of keys and not add a key to the set we should use
PUThere notPOSTimo. Per mozilla guidelines:As defined this is idempotent and replaces the resource (authorized key file in this case) so PUT is the better fit. But personally I would prefer this use
POST, not be idempotent, and just append one or more keys to the existing file.