Automated Testing / CI

未关闭
#63 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
android, github-actions, kotlin

调研方向

从 .github/workflows/test-integration.yml 以及 issue 中描述的由 Gradle 管理的模拟器设置开始。调查 Android 12 及更高版本的模拟器镜像如何生成和轮换 attestation root,然后定义一种可复现的 CI 方案,避免手动构建链,并保留 software-attestation blacklist 行为。

由索引模型根据 Issue 内容生成。

描述

Hi!

I've realized that the (old) SW attestation root is hardwired in the code as explicitly blacklisted.
How would I then test inside a CI without having to manually construct an attestation certificate chain to a custom root? After all, I don't want to be inadvertently testing whether I correctly constructed an attestation chain, but just use an emulator to make sure the chain is representative of a real chain. (See also our GitHub action that spins up an emulator to attest against a service running on localhost).

On a related note:
This approach for CI only works up to Android 12, because more recent Images seem to rotate(?) the root certificate. I can only guess that it might have something to do with also emulating RKP (Android 13+ emulators can also "run out of keys" just like a real RKP-capable device).
This begs the question: how is CI supposed to be done?

  • Use Android 12 images and patch out the hardwired blacklist for the SW-certificate?
  • Use newer emulator images, create a chain, extract the root, configure that as trust anchor before each test?

Full disclosure: I have yet to wrap my head around how the rotation/rollover of emulator root certificates works, because in the GitHub CI pipeline that use the same Gradle-managed emulator for testing uses different roots than on my local machine and (other) post-Android-12 emulators on other build hosts use yet other certificates. Are those root certs dynamically created on first boot of the emulator on each host?

All that being said, blacklisting the SW attestation root does not affect us so far, but should any future refactor pull the "SW attestation root = bad" logic into the PKIX cert chain validator, it would break not only our CI but also those downstream who use Warden Supreme in production and rely on emulators for testing on T stages, etc…

主要语言
Kotlin
星标
159
派生
47
平均合并
3 天 14 小时
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

android/keyattestation 的其他 Issue

查看 android/keyattestation 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。