Skip to content
New issue

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

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

Already on GitHub? # to your account

Created REST Service for smartctl Access #1

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Created REST Service for smartctl Access #1

merged 1 commit into from
Jun 18, 2024

Conversation

blinkdog
Copy link
Contributor

This PR creates a REST service for access to smartctl.

GET /smartctl
GET /smartctl/search?device=<device path>

This second route uses smartctl --scan to get an allow-list, and if the provided does not match an entry on the list of allowed devices, an empty object {} will be returned instead.

smartctl can scan for devices as a user, but information about a specific device requires elevated permissions.
This service can be run with elevated permissions, and ensure only well-formed commands are issued.

@blinkdog blinkdog self-assigned this Jun 18, 2024
@blinkdog blinkdog merged commit df9b1cc into main Jun 18, 2024
8 checks passed
@blinkdog blinkdog deleted the smartrest branch June 18, 2024 23:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant