Automated Testing / CI

Abierto
#63 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
android, github-actions, kotlin

Línea de trabajo

Comienza con .github/workflows/test-integration.yml y la configuración del emulador gestionada por Gradle descrita en la issue. Investiga cómo las imágenes de emulador de Android 12 y posteriores generan y rotan las raíces de atestación, y después define un enfoque reproducible de CI que evite construir cadenas manualmente y preserve el comportamiento de la lista negra de atestación de software.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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…

Lenguaje dominante
Kotlin
Estrellas
159
Forks
47
Merge medio
3 d 14 h
PR fusionados (30 d)
3

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de android/keyattestation

Todos los issues de android/keyattestation

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.