Automated Testing / CI

Đang mở
#63 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
android, github-actions, kotlin
Lĩnh vực
ci-cd, security, testing

Hướng nghiên cứu

Bắt đầu với .github/workflows/test-integration.yml và thiết lập emulator do Gradle quản lý được mô tả trong issue. Điều tra cách các image emulator của Android 12 và mới hơn tạo và xoay vòng các attestation root, sau đó xác định một phương pháp CI có thể tái lập, tránh việc tự xây dựng các chain và giữ nguyên hành vi blacklist của software attestation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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…

Ngôn ngữ chính
Kotlin
Star
159
Fork
47
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của android/keyattestation

Tất cả issue của android/keyattestation

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.