oxidecomputer / oxidecomputer/omicron
need better testing around minimum privileges
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
We've had a number of issues where certain operations checked the wrong privileges and this was not identified by the test suite.
- In #743, I found a bug where we weren't checking a "delete" privilege but the "unauthorized" test succeeded by coincidence because the implementation happened to check the "read" privilege. So the unprivileged user still got a 403/404 (I don't remember which).
- During the lead up to the July demo, we found cases where unprivileged users couldn't see global images or their own ssh keys (#1341). We didn't notice because we'd been doing all our happy-path testing (both automated and otherwise) using "test-privileged", which has all privileges.
The "unauthorized.rs" test verifies that totally unauthenticated or unprivileged users are not able to do things. And the happy path tests verify that superusers are able to do everything. We don't have tests for anything in between. I'll record more thoughts on this below.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the unauthorized.rs tests and compare them with the happy-path tests that use test-privileged. Identify operations covered only for unauthenticated or fully privileged users, then define tests for intermediate privilege levels; done means incorrect privilege checks and access to a user's own or global resources are detected by the suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, authorization, security, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100