Skip to content

Conversation

@nesitor
Copy link
Member

@nesitor nesitor commented Jun 4, 2024

Problem: Now isn't possible as a VM operator to get the client session certificates to initialize a confidential VM.

Solution: Create an operator start endpoint that receive the confidential session files and starts the QEMU VM to continue with the certificate exchange methods.

nesitor added 7 commits May 28, 2024 21:01
…ficates generated by sevctl.

Solution: Set that directory field on settings class and ensure to create the folder on initialization step.
…atform certificates to start the VM key exchange.

Solution: Create that endpoint and return the platform certificates generated by the `sevctl` command.
…n certificates to initialize a confidential VM.

Solution: Create an operator start endpoint that receive the confidential session files and starts the qemu VM to continue with the certificate exchange methods.
@nesitor nesitor requested review from hoh and olethanh June 4, 2024 17:42
@nesitor nesitor self-assigned this Jun 4, 2024
@github-actions
Copy link

github-actions bot commented Jun 4, 2024

As an AI model, I can provide explanations and guidance on the code review process and the role of the CRC in it. However, I can't directly interact with GitHub or other code-based systems. I can help analyze the code changes in the PR, identify potential risks, and suggest improvements based on the rules provided.

Please note that my responses are based on the information provided, and I don't have the ability to provide specific feedback on the codebase or the review process. My primary function is to assist with the analysis and categorization of code changes based on the provided indicators.

@nesitor nesitor changed the base branch from main to andres-feature-endpoint_platform_certificates June 4, 2024 17:44
@codecov
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 93.01075% with 13 lines in your changes missing coverage. Please review.

Project coverage is 59.30%. Comparing base (b1ca017) to head (e3259f7).
Report is 1 commits behind head on dev-confidential.

Files Patch % Lines
src/aleph/vm/orchestrator/views/operator.py 79.31% 3 Missing and 3 partials ⚠️
src/aleph/vm/orchestrator/supervisor.py 40.00% 3 Missing ⚠️
src/aleph/vm/conf.py 85.71% 1 Missing ⚠️
src/aleph/vm/models.py 66.66% 1 Missing ⚠️
src/aleph/vm/pool.py 0.00% 1 Missing ⚠️
src/aleph/vm/sevclient.py 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           dev-confidential     #627      +/-   ##
====================================================
+ Coverage             57.95%   59.30%   +1.35%     
====================================================
  Files                    60       62       +2     
  Lines                  5406     5588     +182     
  Branches                601      618      +17     
====================================================
+ Hits                   3133     3314     +181     
+ Misses                 2133     2130       -3     
- Partials                140      144       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@hoh hoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I cannot test this yet ?

@nesitor nesitor requested a review from hoh June 5, 2024 10:55
@nesitor
Copy link
Member Author

nesitor commented Jun 5, 2024

I guess I cannot test this yet ?

Yes, you can test it manually, but I need also to add automatic tests on that PR as I commented on the chat.

nesitor added 4 commits June 5, 2024 13:10
…s' into andres-feature-endpoint_start_confidential

# Conflicts:
#	tests/supervisor/test_views.py
…certificates

# Conflicts:
#	src/aleph/vm/conf.py
…s' into andres-feature-endpoint_start_confidential

# Conflicts:
#	src/aleph/vm/conf.py
Base automatically changed from andres-feature-endpoint_platform_certificates to main June 6, 2024 11:30
@olethanh
Copy link
Collaborator

I'm merging in my branch so I can test further but I have two remarks, not linked to code quality but with the architecure

  1. Not too fond about naming this /start, it only works with Confidential and the VM isn't really started, only the qemu process is launched. So it will probably not do what the user expect. I think you had suggested init_encrypted_sessions or maybe provide_session_certificates ?
  2. The number of directory in the Settings are starting to explode, so do really need this configurable by the user? Can't we just have a folder by VM and put everything in there ? Eventually in a sub directory.

@olethanh olethanh changed the base branch from main to dev-confidential June 10, 2024 14:13
@nesitor nesitor requested a review from olethanh June 12, 2024 14:34
@olethanh olethanh merged commit 2b30a6a into dev-confidential Jun 12, 2024
olethanh added a commit that referenced this pull request Jul 5, 2024
* Implement Start Confidential endpoint (#627)

* Problem: The server don't have a directory to save the platform certificates generated by sevctl.

Solution: Set that directory field on settings class and ensure to create the folder on initialization step.

* Problem: The aren't an endpoint to be able to get the confidential platform certificates to start the VM key exchange.

Solution: Create that endpoint and return the platform certificates generated by the `sevctl` command.

* Fix: Solved code quality issues.

* Fix: Added 2 test cases for that endpoint.

* Fix: Added PR suggestions.

* Fix: Modified test mock to let the tests work

* Problem: Now isn't possible as a VM operator to get the client session certificates to initialize a confidential VM.

Solution: Create an operator start endpoint that receive the confidential session files and starts the qemu VM to continue with the certificate exchange methods.

* Fix: Remove useless aiofiles import

* Fix: Solve test issues after code quality fixes

* Fix: Solve code quality issues.

* Fix: Solve code quality issues.

* Fix: Write file in sync mode to avoid adding a new dependency. Files to write should be so small, so any blocking issue should be here.

* Fix: Solved PR comments and wrong conditionals.

* Fix: Solved more PR comments.

* Fix: Removed unexisting import

* Fix: Added useless command requested on the PR review.

* Fix: Changed endpoint path and added automatic tests for that endpoint.

* Fix: Solved settings singleton issue with testing, adding an `initialize_settings` method.

* Fix: Just disable the setting that is failing and remove previous method to initialize the singleton.

* Fix: CI Droplet cleanup failed when same name was used

When there were multiple Droplets with the same name, cleanup using doctl compute droplet delete -f $NAME would not work.

Error: There are 3 Droplets with the name "aleph-vm-ci-XXX"; please provide a specific Droplet ID. [425559566, 425702949, 425703724]
(cherry picked from commit b824503)

* Problem: Could not install on Python 12 via pip install -e

because of deps problem.
Solution : upgrade aiohttp version

* Problem: Crash in log when VM was printing control char

* Raise log level for VM termination in controller so we always display when it finish

* comment

* Problem: Error were not properly returned in allocation endpoint

* Add Qemu confidential controler implementation

* remove duplicate endpoint

* fix test in test_about_certificates

* Add TODO comment

Co-authored-by: nesitor <[email protected]>

* Only run Confidentifial if is_confidential

* Add script to build OVMF file for confidential VMs (#636)

* Rename the confidential endpoints (#641)

* Rename confidential endpoints

* Rename the function too and reorder

* isort

* Use unified logging system for confidential

* Provide an example confidential image construction script and instruction

* Prevent the cleanup being run twice

but still works with -e

* Problem: sudo command was not working inside the VM

ensure the setuid bit stay preserved when copying the file"

* remove unecesary step

* More example instruction

* Problem: A user cannot specify which OVMF firmware want to use for they instances.

Solution: Use new aleph-message version that includes that data schema and implement it on the qemu confidential resources.

* Adapt example confidential message

* fix host volume for confidential

* Force aleph-message minimal version

* Correct problem in HostVolume code

* Merge both test_operator

* Fix options for HostVolume

* Move `domain` payload field to Operation token instead PubKey one (#647)

* Problem: If a user wants to manage different operations for a different CRNs, they have to sign a new pubkey token for every CRN, and this is so bad for the user experience.

Solution: Move the `domain` field to the operation token payload instead the pubkey one, just to improve the user experience and maintain the security integrity.

* Fix: Solved test error message failing.

---------

Co-authored-by: Andres D. Molins <[email protected]>

* Problem: Failing initialization of AlephQemuConfidentialInstance

due to merge problem

* fix invoking of sevctl

* Update src/aleph/vm/pool.py

---------

Co-authored-by: nesitor <[email protected]>
Co-authored-by: Hugo Herter <[email protected]>
Co-authored-by: Andres D. Molins <[email protected]>
@Psycojoker Psycojoker deleted the andres-feature-endpoint_start_confidential branch July 24, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants