2014-12-04 7 views
13

В примечаниях к версии Git 2.2.0, он описывает новую опцию git push, --signed:Зачем нужно подписывать Git?

"git push" learned "--signed" push, that allows a push (i.e. 
request to update the refs on the other side to point at a new 
history, together with the transmission of necessary objects) to be 
signed, so that it can be verified and audited, using the GPG 
signature of the person who pushed, that the tips of branches at a 
public repository really point the commits the pusher wanted to, 
without having to "trust" the server. 

Так это звучит, как данные отправляются на сервер во время толчка подписан так, что сервер может проверить и журнал, который сделал толчок. В man pages Вы можете подтвердить это:

--signed 
    GPG-sign the push request to update refs on the receiving side, 
    to allow it to be checked by the hooks and/or be logged. See 
    git-receive-pack[1] for the details on the receiving end. 

Вы смотрите в man pages for git-receive-pack под pre-receive и post-recieve крючков, чтобы увидеть, как проверить подписанный толчок.

Кажется, что все это помогает серверу проверить, кто именно делает то, что они говорят.

Как git push --signed поможет вам (толкателю) не «доверять» серверу? Все, что я видел до сих пор, похоже, указывает, что это помогает серверу доверять вам. Что еще более важно, Почему подписываются коммиты и подписанные теги, которых недостаточно, чтобы нажать на ненадежный сервер? Почему нам даже нужны подписные подталкивания?

ответ

7

Вот отрывок из commit message, который представил подписанные толчки:

While signed tags and commits assert that the objects thusly signed 
came from you, who signed these objects, there is not a good way to 
assert that you wanted to have a particular object at the tip of a 
particular branch. My signing v2.0.1 tag only means I want to call 
the version v2.0.1, and it does not mean I want to push it out to my 
'master' branch---it is likely that I only want it in 'maint', so 
the signature on the object alone is insufficient. 

The only assurance to you that 'maint' points at what I wanted to 
place there comes from your trust on the hosting site and my 
authentication with it, which cannot easily audited later. 

Таким образом, даже несмотря на то, коммят будет подписан, вы не можете быть уверены, что автор Подразумевается, что обязательство быть прижат к ветви master или филиал super-experimental-feature. Подписанные нажатия позволяют серверу хранить запись каждого события push и его подписи. Затем этот журнал можно проверить, чтобы убедиться, что каждая фиксация действительно предназначена для определенной ветви.

Смежные вопросы