OSPS-AC-01.01 is always ERROR on a user-owned repository (owner-type detection, follow-up to #467)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with the OSPS-AC-01.01 control definition (its TOML) and the gh_api handler path that calls /orgs/<owner> and /user, then reproduce with darnit audit -f openssf-baseline --include OSPS-AC-01.01 on a user-owned repository. Find where owner.type from /repos/{owner}/{repo} is already fetched and how it could reach this control. The issue leaves the resulting status for user-owned repos as a design decision, so settle that with the maintainers first. Done means a user-owned owner skips the org call and gives a clear needs-confirmation result, and a missing read:user scope is reported as such.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
On a repository owned by a user account, OSPS-AC-01.01 is always ERROR, and the message reads like a failed API call:
$ darnit audit -f openssf-baseline --include OSPS-AC-01.01 <checkout of Marc-cn/SSI>
WARNING: OSPS-AC-01.01: gh_api handler could not complete (error_class=unavailable): Platform API call /orgs/Marc-cn could not be measured (unavailable): HTTP 404
WARNING: OSPS-AC-01.01: gh_api handler could not complete (error_class=evaluation): Could not evaluate expr over the response from /user: CEL evaluation failed: ("no such member in mapping: 'two_factor_authentication'", ...
Total: 1 | Pass: 0 | Fail: 0 | Warn: 0 | N/A: 0 | Error: 1 | Pending: 0
! OSPS-AC-01.01: ERROR [unavailable] - Platform API call /orgs/Marc-cn could not be measured (unavailable): HTTP 404
gh api /repos/Marc-cn/SSI --jq .owner.type returns User.
What is by design
The control's TOML says "404 (a user, not an org) and 401/403 are ERROR, never FAIL", and the /user step is evidence only, so that the auditor's own 2FA can never produce a PASS. That is the fix for #467 and it should stay.
What is missing
This is the follow-up #467 describes: PR #271 "promised a follow-up issue for owner-type detection; none was filed", and #467's suggested direction includes "Gate the /user fallback on the owner being a User account (owner.type from /repos/{owner}/{repo} is already fetched elsewhere in the audit)".
Without it, on a user-owned repository:
- The org step asks
/orgs/<user>, which can only 404. The result is ERROR with a message about an unreachable platform. Nothing says "this owner is a user, so there is no organization setting to check". - The help text says "a person confirms the control for a user-owned repository", but the audit result does not lead there. An agent reading the result (Claude Code, in my case) reported it as an API error and suggested confirming MFA by hand, which is the right conclusion reached by guessing.
- With a default
gh auth login, the/userstep errors as well, because the token has noread:userscope and the field is absent. So even the evidence is not recorded unless the user knows to rungh auth refresh -s read:user.
Suggested direction
- Detect the owner type once (from
/repos/{owner}/{repo}) and make it available to the control. - For a
Userowner: do not call/orgs/<owner>. Conclude a "needs confirmation by a person" result (WARN, or whatever fits the result-authority contract), with the/userresponse as evidence when the field is visible, and a message that says the repository is user-owned. - For an
Organizationowner: unchanged. - When
/userhas notwo_factor_authenticationfield, say that theread:userscope is missing instead of reporting a CEL evaluation error.
Which status a user-owned repository should get is a design decision for this control, so I have not sent a PR.
Environment
darnit main at 24a4fed, RHEL 10.2, gh 2.102.0 logged in with scopes gist, read:org, repo, workflow.
Drafted with Claude; reviewed and filed by me.
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 27
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 39
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của darnitdevorg/darnit
-
`darnit validate` crashes on openssf-baseline.toml summarising levelsCó thể đã có người làm @i-am-paradox đã nhận 1 ngày trước. Đang mởneeds triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
darnitdevorg/darnit#589 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
darnitdevorg/darnit#587 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
darnitdevorg/darnit#585 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
darnitdevorg/darnit#523 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
darnitdevorg/darnit#516 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của darnitdevorg/darnit
Issue tương tự
-
Path subtraction removes repeated suffix characters instead of one suffixCó thể đã có người làm @Gwerdonatus đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
joke2k/django-environ#671 ·
-
good first issue help wanted windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
test_pgbouncer deploys the server under test from Charmhub instead of the local build (track/1.31)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
canonical/temporal-k8s-operator#195 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
`burr` fails to start when the Python path has a space in itCó thể đã có người làm @enekoreto đã nhận hôm nay. Đang mởstatus/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
device support request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zigpy/zha-device-handlers#5461 ·
Maintainer thường phản hồi trong vòng 4 ngày