incubator-teaclave-sgx-sdk
incubator-teaclave-sgx-sdk copied to clipboard
support kvdb for enclave?
I want to support memdb
for rust-sgx-sdk and at the same time writing a sample which works in the following ways:
- If we start the encalve, it will initialize a memdb.
- when we call
set
function, it will write the data into thememdb
- when we call
get
function, it will read the data frommemdb
.
Is this feasible in theory? If true, I'd like to be reviewed and merged. :smile:
Really good idea!
I think it's a pretty good start of a protected db. The sample code will be a fantastic proof-of-concept.
To use it in production, one needs to consider about authentication and authorization.
yeah!it's may be more useful if we consider the persistence of protected db.:beers:
Maybe we could directly try to support kvdb
in enclave? It includes kvdb-memdb
and kvdb-rocksdb
which from paritytech/parity-commons
.
At the same time we would provide two examples:
memdb
This is used to show how to save some data which we want to be reused for a long time, such as the tls keypair.
rocksdb
This is used to show how to use rocksdb as protected db, we may need to solve the following problems:
- encryption at rest
- authentication and authorization.
@bradyjoestar @dingelish for the persistent (e.g. rocksdb) backend, one additional problem would be freshness -- one could overwrite the db state with an old authentic and encrypted state. As this is for "cloud" web apps (https://github.com/baidu/rust-sgx-sdk/issues/110 ) Intel ME functionality (like monotonic counters) that could help may not be available.
I guess a more "cloud-friendly" alternative for persistent db freshness would be some fault-tolerant enclave kvdb replication?
https://www.usenix.org/system/files/conference/usenixsecurity17/sec17-matetic.pdf
Just noticed that parity’s kvdb-memorydb is under GPLv3. Do we really need to depend on this?
I think I need to fork parity-common to another repo instead of place them in this repo.
- [ ] fork and port elastic-array to elastic-array-sgx
- [ ] fork and port parity-common to parity-common-sgx
- [ ] remove parity-common from third_party directory
- [ ] fix the sample code kvdb-memdb
Assigned to myself.
Sure!
I guess a more "cloud-friendly" alternative for persistent db freshness would be some fault-tolerant enclave kvdb replication?
@tomtau I'm not proficient in database so give me some time to learn :smile: Thanks to your suggestion and I will read the paper carefully.