usage started

pull/10/head
sobolevn 8 years ago
parent e98e70a9d2
commit 36061e6962

@ -1,10 +0,0 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET" "1" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\fR
.
.SH "Usage"
To use this tool you will need only \fBgit\fR and \fBgpg\fR installed\.

@ -1,3 +0,0 @@
## Usage
To use this tool you will need only `git` and `gpg` installed.

@ -0,0 +1,84 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET" "7" "February 2016" "" ""
.
.SH "NAME"
\fBgit\-secret\fR
.
.SH "Intro"
There\'s a known problem in server configuration and deploying, when you have to store your private data such as: database passwords, application secret\-keys, OAuth secret keys and so on, outside of the git repository\. Even if this repository is private, it is a security risk to just publish them into the world wide web\. What are the drawbacks of storing them separately?
.
.IP "1." 4
These files are not version controlled\. Filenames change, locations change, passwords change from time to time, some new information appears, other is removed\. And you can not tell for sure which version of the configuration file was used with each commit\.
.
.IP "2." 4
When building the automated deploing system there will be one extra step: download and place these secret\-configuration files where it needs to be\. So you have to maintain an extra secure location, where everything is stored\.
.
.IP "" 0
.
.SS "How does <code>git\-secret</code> solves these problems?"
.
.IP "1." 4
\fBgit\-secret\fR encrypts files and stores them inside the \fBgit\fR repository, so you will have all the changes for every commit\.
.
.IP "2." 4
\fBgit\-secret\fR doesn\'t require any other deploy operations rather than \fBgit secret reveal\fR, so it will automatically decrypt all the required files\.
.
.IP "" 0
.
.SS "What is <code>git\-secret</code>?"
\fBgit\-secret\fR is a bash tool to store your private data inside a \fBgit\fR repo\. How\'s that? Basically, it just encrypts, using \fBgpg\fR, the tracked files with the public keys of all the users that you trust\. So everyone of them can decrypt these files using only their personal secret key\. Why to deal with all these private\-public keys stuff? Well, to make it easier for everyone to manage access rights\. There are no passwords that change\. When someone is out \- just delete his public key, reencrypt the files, and he won\'t be able to decrypt secrets anymore\.
.
.SH "Installation"
.
.SS "Dependencies"
\fBgit secret\fR relies on two dependecies: \fBgit\fR \fIhttps://git\-scm\.com/\fR and \fBgpg\fR \fIhttps://www\.gnupg\.org/\fR\. Download and install them before using this project\. \fBgit\-secret\fR is tested to work with:
.
.IP "" 4
.
.nf
git version 2\.7\.0
gpg (GnuPG) 1\.4\.20
.
.fi
.
.IP "" 0
.
.SS "Supported platforms"
\fBgit secret\fR works with \fBMac OS X\fR >= 10\.9, \fBUbuntu\fR >= 14\.04 and \fBDebian\fR >= 8\.3 You can add you platform to this list, if all the tests passes for you\. \fBCygwin\fR support is planned\.
.
.SS "Installation process"
There are several ways to install \fBgit\-secret\fR:
.
.P
\fBThe hard way\fR 1\. Clone the repository first: \fBgit clone https://github\.com/sobolevn/git\-secret\.git git\-secret\fR 2\. Run \fBcd git\-secret && make build\fR 3\. Move \fBgit\-secret\fR file and \fBman/\fR folder somewhere inside your \fB$PATH\fR, or extend your \fB$PATH\fR to contain \fBgit\-secret\fR file and \fBman/\fR folder
.
.P
\fB\fBantigen\fR plugin (or any other \fBoh\-my\-zsh\fR\-styled plugin\-systems)\fR 1\. Add line \fBantigen bundle sobolevn/git\-secret\fR to your \fB\.zshrc\fR 2\. Run \fBsource ~/\.zshrc\fR or reopen the terminal
.
.P
\fBbrew\fR and \fBfpm\fR support is planned\.
.
.SH "Usage"
These steps cover the basic process of using \fBgit\-secret\fR: 0\. Before starting, make sure you have created \fBgpg\fR RSA key\-pair: public and secret key identified by your email address\. 1\. Initialize \fBgit\-secret\fR repository by running \fBgit secret init\fR command\. \fB\.gitsecret/\fR folder will be created\. 2\. Add first user to the system by running \fBgit secret tell your@gpg\.email\-id\fR\. 3\. Now it\'s time to add files you wish to encrypt inside the \fBgit\-secret\fR repository\. It can be done by running \fBgit secret add <filenames\.\.\.>\fR command\. Make sure these files are ignored, otherwise \fBgit secret\fR won\'t allow you to add them, as these files will be stored unencrypted\. 4\. When done, run \fBgit secret hide\fR all files, which you have added by \fBgit secret add\fR command will be encrypted with added public\-keys by the \fBgit secret tell\fR command\. Now it is safe to commit your cahnges\. \fBBut\fR\. It\'s recommened to add \fBgit secret hide\fR command to your \fBpre\-commit\fR hook, so you won\'t miss any changes\. 5\. Now decrypt files with \fBgit secret reveal\fR command\. It will ask you for your password\. And you\'re done!
.
.SS "I want to add someone to the repository"
.
.IP "1." 4
Get his \fBgpg\fR public\-key\. \fBYou won\'t need his secret key\.\fR
.
.IP "2." 4
Import this key inside your \fBgpg\fR by running \fBgpg \-\-import KEY_NAME\fR
.
.IP "3." 4
Now add this person to the \fBgit\-secret\fR by running \fBgit secret tell persons@email\.id\fR
.
.IP "4." 4
Reencypt the files, now he will be able to decrypt them with his secret key\.
.
.IP "" 0
.
.P
Note, that it is possible to add yourself to the system without decrypting existing files\. It will possible to decrypt them after reencrypting them with the new key added\. So, if you don\'t want unexpected keys added, make sure to configure some server\-side security policy with the \fBpre\-receive\fR hook\.

@ -0,0 +1,63 @@
## Intro
There's a known problem in server configuration and deploying, when you have to store your private data such as: database passwords, application secret-keys, OAuth secret keys and so on, outside of the git repository. Even if this repository is private, it is a security risk to just publish them into the world wide web. What are the drawbacks of storing them separately?
1. These files are not version controlled. Filenames change, locations change, passwords change from time to time, some new information appears, other is removed. And you can not tell for sure which version of the configuration file was used with each commit.
2. When building the automated deploing system there will be one extra step: download and place these secret-configuration files where it needs to be. So you have to maintain an extra secure location, where everything is stored.
### How does `git-secret` solves these problems?
1. `git-secret` encrypts files and stores them inside the `git` repository, so you will have all the changes for every commit.
2. `git-secret` doesn't require any other deploy operations rather than `git secret reveal`, so it will automatically decrypt all the required files.
### What is `git-secret`?
`git-secret` is a bash tool to store your private data inside a `git` repo. How's that? Basically, it just encrypts, using `gpg`, the tracked files with the public keys of all the users that you trust. So everyone of them can decrypt these files using only their personal secret key. Why to deal with all these private-public keys stuff? Well, to make it easier for everyone to manage access rights. There are no passwords that change. When someone is out - just delete his public key, reencrypt the files, and he won't be able to decrypt secrets anymore.
## Installation
### Dependencies
`git secret` relies on two dependecies: [`git`][1] and [`gpg`][2]. Download and install them before using this project. `git-secret` is tested to work with:
git version 2.7.0
gpg (GnuPG) 1.4.20
### Supported platforms
`git secret` works with `Mac OS X` >= 10.9, `Ubuntu` >= 14.04 and `Debian` >= 8.3
You can add you platform to this list, if all the tests passes for you.
`Cygwin` support is planned.
### Installation process
There are several ways to install `git-secret`:
**The hard way**
1. Clone the repository first: `git clone https://github.com/sobolevn/git-secret.git git-secret`
2. Run `cd git-secret && make build`
3. Move `git-secret` file and `man/` folder somewhere inside your `$PATH`, or extend your `$PATH` to contain `git-secret` file and `man/` folder
**`antigen` plugin (or any other `oh-my-zsh`-styled plugin-systems)**
1. Add line `antigen bundle sobolevn/git-secret` to your `.zshrc`
2. Run `source ~/.zshrc` or reopen the terminal
`brew` and `fpm` support is planned.
## Usage
These steps cover the basic process of using `git-secret`:
0. Before starting, make sure you have created `gpg` RSA key-pair: public and secret key identified by your email address.
1. Initialize `git-secret` repository by running `git secret init` command. `.gitsecret/` folder will be created.
2. Add first user to the system by running `git secret tell your@gpg.email-id`.
3. Now it's time to add files you wish to encrypt inside the `git-secret` repository. It can be done by running `git secret add <filenames...>` command. Make sure these files are ignored, otherwise `git secret` won't allow you to add them, as these files will be stored unencrypted.
4. When done, run `git secret hide` all files, which you have added by `git secret add` command will be encrypted with added public-keys by the `git secret tell` command. Now it is safe to commit your cahnges. **But**. It's recommened to add `git secret hide` command to your `pre-commit` hook, so you won't miss any changes.
5. Now decrypt files with `git secret reveal` command. It will ask you for your password. And you're done!
### I want to add someone to the repository
1. Get his `gpg` public-key. **You won't need his secret key.**
2. Import this key inside your `gpg` by running `gpg --import KEY_NAME`
3. Now add this person to the `git-secret` by running `git secret tell persons@email.id`
4. Reencypt the files, now he will be able to decrypt them with his secret key.
Note, that it is possible to add yourself to the system without decrypting existing files. It will possible to decrypt them after reencrypting them with the new key added. So, if you don't want unexpected keys added, make sure to configure some server-side security policy with the `pre-receive` hook.
[1]: https://git-scm.com/
[2]: https://www.gnupg.org/

@ -0,0 +1,8 @@
#!/usr/bin/env bash
function update_gh_branch {
git checkout gh-pages
make
}
update_gh_branch

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -e

Loading…
Cancel
Save