comrade-coop / apocryph

A decentralized compute marketplace for running pods securely and confidentially
https://apocryph.network/
GNU General Public License v3.0
40 stars 8 forks source link

Spike/remote verification #42

Closed revoltez closed 3 weeks ago

revoltez commented 2 months ago

Overview

This PR introduced image signing, verification, and policy enforcement & tpod application remote verification. It also includes various organizational enhancements to the codebase in an attempt to Fix #35.

Key Features:

  1. Image Signing & Verification:

    • Add Image Signing: Implemented support for signing images, in deploy & upload commands. Signatures are stored locally (so that they could also be verified locally without requiring to fetch them from the registry) but they could also be uploaded with the --upload-signatures flag
    • Verification of Images: Added Image verification of pods, remote image in a registry or remote application.
    • Remote Application verification: Anyone can query an application endpoint to retrieve informations about all the images used in the running application and verify them using the Verify Command. the verify Command can take either an image name directly or a URL.
  2. Control over Verification Settings:

    • Added VerificationDetails Field For images: Publisher can specify the following details that will be later used for image verification:

      • Issuer: certificate issuer
      • Identity: certificate Identity
    • Added VerificationSettings field: has the following options:

      • ForcePolicy: when set to true, the application namespace will create a policy per image and enforce that the supplied image matches its policy otherwise deployment will fail. the policy will be configured with the VerificationDetails field for keyless verification.
      • PublicVerifiability: When set to true, the application will be available to be remotely verified by anyone
      • VerificationHost: Manually Set the Verification Host which will be used to access the application for remote verification
  3. Various Codebase enhancements: (re-organized and decoupled scripts for better maintainability and better flow during development)

How it works

Remote application verification

Tests

In both tests you must specify the identity and issuer for the images.

Libraries

bojidar-bg commented 3 weeks ago

Added a few changes after reviewing the code. Looking good!

(Note: changes are untested. Hopefully I didn't break anything.. too bad! :smiling_face_with_tear:)