question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

History Rewriting to remove SGX Private Key

See original GitHub issue

Instruction to sync to master after rewrite

If you do not have local changes, you can simply do git reset --hard [HASHTAG-OF-NEW-HEAD]

Please use the following commands

# Add upstream if you have not yet done so
git remote add upstream https://github.com/dmlc/tvm
git remote add prefilter https://github.com/tqchen/tvm
git fetch upstream
git fetch prefilter
# checkout a local branch for safety reason, 
# you can always reset your master to the old head
git checkout -b backup
git checkout master
# Bring your changes on top of the most recent prefilter branch
git rebase prefilter/prefilter
# sync your local changes to master
git rebase --onto upstream/master e316f03d2d2e0c06019b6d026b9696b7d3f67b8d
# force push to your upstream master
git push --force

Here e316f03d2d2e0c06019b6d026b9696b7d3f67b8d is the hashtag of the head before fiilter. The last command will take the commits between ``e316f03``` and your head and apply it to the upstream/master’s HEAD

Context

The history has been rewritten

  • An old history branch is kept at branch prefilter, and we will delete it after 0.4

This is to followup issue on https://github.com/dmlc/tvm/issues/1189

So far in the SGX demo, we introduced private keys into the commit history. Although the private key is only used for demo purposes and poses no security concern, it triggers false alarm of security scanning tools.

Currently, the private keys are shallowed removed. But it can still trigger the alarm due to the fact that the file is still in git history.

I have created https://gist.github.com/tqchen/ca5f1b898e27035621130d87aa9bebaf to deeply filter the history to remove the file. With an example branch here https://github.com/tqchen/tvm/commits/filter that gives the result of filter-branch.

Note that filter-brach causes divergence from the current tree, and in order to bring this change to master, we have to force rewrite the history and push to master – note that commits contributions are preserved, but it indeed will cause troubles for our contributors.

This is a decision that can not be made lightly. So this is an RFC post, to hear opinions from the community on whether we should do this or not. Please express your opinions in this thread.

This thread will remain open for one week before we reach a decision

Pros and Cons

  • Pros: avoid security check alarm in the future, although it is a false alarm.
  • Cons: require contributors to sync up with the master via history rewriting.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mnuyenscommented, Jul 10, 2018

We don’t need to remove a whole file just some lines from apps/sgx/prepare_test_libs.py. I’ll test out changes to the command today and upload one that I think works along with a example branch that I’ve run the command on to confirm that it still keeps everything the way it should be.

0reactions
tqchencommented, Sep 3, 2018

As a note, the prefilter branch is now deleted from the current main repo, it will be kept in my fork https://github.com/tqchen/tvm for a while, instruction has been updated

Read more comments on GitHub >

github_iconTop Results From Across the Web

SGAxe: How SGX Fails in Practice - CacheOut
We then use the retrieved sealing key to unseal the persistent storage of the Quoting Enclave, which contains the private attestation key. We ......
Read more >
Intel SGX Explained - Cryptology ePrint Archive
In SGX, an enclave (secure container) only contains the private data in a computation, and the code that operates on it. For example,...
Read more >
Intel® Software Guard Extensions SDK for Linux* OS - 01.org
Intel(R) Software Guard Extensions SDK Developer Reference for Linux* OS. - 15 - public key. The input signature is gen- erated by an...
Read more >
FORESHADOW: Extracting the Keys to the Intel SGX Kingdom ...
We extract full cryptographic keys from Intel's archi- ... Any attempt to directly access private pages from outside.
Read more >
Secure Programming with Intel SGX and Novel Applications
Intel's Software Guard Extensions (SGX) is a new technology introduced in ... a message that is encrypted by the private-key and therefore.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found