-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind TEE attestations to nodes and enforce freshness #4926
Conversation
de5bac5
to
de331d6
Compare
e729284
to
d80da34
Compare
72fc693
to
3a3dddc
Compare
Codecov Report
@@ Coverage Diff @@
## master #4926 +/- ##
==========================================
+ Coverage 66.64% 66.76% +0.11%
==========================================
Files 464 464
Lines 51204 51221 +17
==========================================
+ Hits 34127 34199 +72
+ Misses 12891 12845 -46
+ Partials 4186 4177 -9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 💯 Just left some minor observations, not sure if we need to address them.
Didn't test this though as I'm not sure if I can without the SGX.
@@ -95,6 +103,11 @@ func (sc *SGXConstraints) ValidateBasic(cfg *TEEFeatures) error { | |||
if !cfg.SGX.PCS && sc.V != 0 { | |||
return fmt.Errorf("unsupported SGX constraints version: %d", sc.V) | |||
} | |||
// Sanity check version (should never fail as deserialization already checks this). | |||
if sc.V > LatestSGXConstraintsVersion { | |||
return fmt.Errorf("unsupported SGX constraints version: %d", sc.V) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could merge with previous if
since both errors are the same (could also change the error). Same below.
regSt.Parameters.TEEFeatures = &node.TEEFeatures{} | ||
} | ||
regSt.Parameters.TEEFeatures.SGX.SignedAttestations = true | ||
regSt.Parameters.TEEFeatures.SGX.DefaultMaxAttestationAge = 1200 // ~2 hours at 6 sec per block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value 1200 could also be moved to a constant as we are using it on 3 places.
3a3dddc
to
f6ce0d6
Compare
Based on #4922