Skip to content

Automated Testing / CI #63

@JesusMcCloud

Description

@JesusMcCloud

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…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions