Skip to content

feat(uat): stored logins with TOTP, secret scrubbing, and giving up on a bot check - #25

Open
unohee wants to merge 1 commit into
masterfrom
feat/uat-unattended-login
Open

unohee wants to merge 1 commit into
masterfrom
feat/uat-unattended-login

Conversation

@unohee

@unohee unohee commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

무엇

  • credentials·TOTP 저장소: spec 의 credentials 는 이름별로 비밀이 있는 위치(env 변수 또는 파일)만 적고, 비밀 자체는 적지 않는다. 페르소나는 fill_credential(name, field, selector, submit) 를 쓰고, field 는 username/password/totp 다. 서버가 값을 해석해 type_text 의 본체를 거쳐 입력하므로 동의·가드·audit redaction 이 그대로 적용된다. 입력은 credential 의 origin 에서만 하고, 다른 곳에서는 wrong_origin 을 돌려주며 아무것도 입력하지 않는다. 비밀을 읽을 수 없으면 credential_unavailable 이다. TOTP 는 stdlib 로 구현했다(lyra_browser/totp.py, RFC 6238, 의존성 추가 없음).
  • 비밀 scrub: spec 의 password·TOTP seed 를 원문, URL 인코딩, JSON 형태 모두 <secret> 으로 바꾼다. 적용 대상은 trace/events 쓰기, 모델이 받는 도구 결과, network.jsonl(캡처된 POST body)이다.
  • challenge 봉투 정리: navigate 의 challenge 응답에 attempts·max_attempts 를 붙인다. 같은 검사(vendor×origin)를 LYRA_BROWSER_CHALLENGE_MAX_ATTEMPTS(기본 3) 번째로 만나면 challenge_abandoned 를 낸다. UAT run 에서는 이후 브라우저 도구를 모두 거부하고 policy event 를 남기며, exit reason challenge_abandoned(incomplete)로 끝난다. 이 exit reason 은 feat(uat): disposable profiles, retries, start limiter, SIGKILL sweeper #22 의 재시도 대상이 아니다.
  • captcha_solver 훅: LYRA_BROWSER_CAPTCHA_SOLVER / target.captcha_solver = module:function. 아무도 보지 않을 때 interactive 검사에만 호출한다. lyra 는 solver 를 하나도 싣지 않는다. solver 의 답은 믿지 않고 페이지를 다시 관찰해서, 검사가 사라졌을 때만 ok + challenge_solved 로 돌려준다.
  • PR feat(browse): name a bot check and hand it over instead of guessing #3 미완분: navigate challenge 분기 단위 테스트와, 같은 검사 2~3회 실패 시 중단하는 규칙.
  • scripts/verify_unattended_e2e.py 를 추가하고, 데모 사이트에 /login → /2fa → /account 를 더했다.
  • 문서: README Bot checks 절, env 표 2행, docs/UAT.md "Logins, one-time codes and bot checks".

왜

무인 실행에서 로그인, 2FA, 봇 검사를 처리해야 한다. 비밀은 모델, trace, 리포트 어디에도 남지 않아야 한다.

검증

  • pytest -q: 2002 passed, 5 failed. 실패 5건(test_uat_llm_brains.py)은 이 venv 에 SDK 가 없어서 나며, origin/master 에서도 똑같이 실패한다.
  • 새 테스트:
    • test_totp.py: RFC 6238 부록 B 벡터 18개(sha1/256/512) 포함.
    • test_challenge.py 7개: 분기, 3회 포기, vendor 별 카운트, solver 성공/실패, attended·blocked 일 때 solver 미호출, 로더.
    • tests/uat/test_uat_credentials.py 5개: 실제 입력, origin·누락·미지 거부, run 디렉터리 전체에서 canary 0건, 페이지가 비밀을 echo 해도 scrub, challenge_abandoned 로 run 종료.
  • 실제 Chrome (scripts/verify_unattended_e2e.py, headless, 2026-11-15): native·playwright 모두 ALL PASS.
    • username + password + TOTP 로 로그인해 /account 에 도달.
    • /gate 3회에서 상태가 challenge, challenge, challenge_abandoned 순으로 나왔고, 이후 호출은 거부됨.
    • 두 run 의 모든 파일에서 password·seed 0건. 캡처된 로그인 POST 에는 <secret> 이 들어 있음.

남은 것 / 범위 밖

…n a bot check

fill_credential(name, field, selector) types a username, password or the
current RFC 6238 code from a credential the spec names by reference (an env
var or a file), only on the credential's own origin and through type_text's
own gates. The value is in no argument, result, trace row or report; every
password and seed is also scrubbed from what a run writes and returns, in
plain, URL-encoded and JSON forms.

navigate counts each bot check per vendor and site and answers
challenge_abandoned at challenge_max_attempts (3); in a UAT run that ends
the browsing and the report's exit reason. captcha_solver (module:function)
is an operator hook for interactive checks when nobody watches; none ships,
and the page is observed again rather than the solver believed.

scripts/verify_unattended_e2e.py signs in on the demo site (password + TOTP)
in real Chrome, meets the gate three times, and finds neither canary in any
file of either run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant