Step 6: Verify Security & Expose API Endpoints
One of dstack’s key features is verifiable security. Let’s verify your application is running in a genuine TEE and expose secure API endpoints.Get Attestation Quote Using dstack SDK
The dstack JavaScript SDK provides direct access to attestation functionality:Container Setup
To use dstack SDK in your Docker container, mount the dstack socket:Alternative: Direct HTTP API
You can also access attestation via HTTP API:Expose Secure API Endpoints
Create an API endpoint that provides attestation data:Verification Process
For complete security verification:- Verify TDX Quote: Use Intel’s DCAP-QVL to verify the quote signature
- Check Measurements: Validate MRTD and RTMRs against expected values
- Replay Event Log: Use the
replayRtmrs()
method to verify RTMR3 contains correct app information - Validate App Identity: Ensure the app ID matches your deployment
Verify via Web Interface
- In the VMM dashboard, click on your deployment
- Navigate to the “Security” tab
- Click “View Attestation Report”
- Use external TEE verification tools to validate the attestation
Gateway URL Access
Your secure API endpoints will be accessible through dstack gateway URLs:https://<app-id>.example.com/api/attestation
https://<app-id>.example.com/api/info