]> gitweb.fluxo.info Git - padrao.git/commitdiff
Geracao e atualizacao de certificados
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 20 Mar 2015 14:05:02 +0000 (11:05 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 20 Mar 2015 14:05:02 +0000 (11:05 -0300)
certs.mdwn [new file with mode: 0644]

diff --git a/certs.mdwn b/certs.mdwn
new file mode 100644 (file)
index 0000000..6542471
--- /dev/null
@@ -0,0 +1,110 @@
+[[!toc levels=4]]
+
+Geração e renovação de certificados
+===================================
+
+TODO
+----
+
+* Procedimento para salvar contratos, invoices, etc no repositório de documentação.
+* Onde for possível, substituir "SSL" por "TLS", "x509", "certs" ou "Certificados" quando aplicável.
+* Traduzir [Certificates](https://help.riseup.net/pt/security/network-security/certificates) e usar como referência de protocolo.
+
+Começando
+---------
+
+    HYDRA="nome-do-grupo"
+    FOLDER="`hydra $HYDRA folder`"
+    MAIN_DOMAIN="`hydra $HYDRA config domain`"
+    DOMAIN="$MAIN_DOMAIN" # ou outro domínio
+
+Branch SSL
+----------
+
+Mudando para o branch `certs` da configuracao do puppet:
+
+    cd $FOLDER/puppet
+    git pull
+    git checkout certs # "checkout -b" se o branch nao existe
+    git merge master
+
+Gerando novas chaves
+--------------------
+
+Proceda usando o [keyringer](https://keyringer.pw):
+
+    keyringer $HYDRA genpair ssl ssl/$DOMAIN *.$DOMAIN $FOLDER/puppet/keys/ssl/$DOMAIN
+
+No caso da chave snakeoil (fornecida quando um atacante acessa https://IP), use
+
+    keyringer $HYDRA genpair ssl-self ssl/example.org example.org $FOLDER/puppet/keys/ssl/example.org
+
+Chaves também podem ser geradas em massa. No caso de certificados simples (não-wildcard):
+
+    for domain in $DOMAINS; do
+      keyringer $HYDRA genpair ssl ssl/$domain $domain $FOLDER/puppet/keys/ssl/$domain
+    done
+
+Registrando mudancas parciais
+-----------------------------
+
+    keyringer $HYDRA git commit
+    keyringer $HYDRA git push
+    git commit -a -m "Nova chave SSL"
+    git push
+
+Comprando um certificado
+------------------------
+
+Em seguida, compre um certificado no registrar, envie a requisição de certificado (arquivo `CSR`) e proceda com a validação.
+
+Após a renovação
+----------------
+
+    mv  /path/to/$DOMAIN.crt               keys/ssl/$DOMAIN.crt
+    echo ""                             >> keys/ssl/$DOMAIN.crt # adiciona linefeed, caso preciso
+    cat keys/ssl/gandi.crt              >> keys/ssl/$DOMAIN.crt # baixe o intermediario para este caminho
+    cat keys/ssl/$DOMAIN.pem             > keys/ssl/$DOMAIN-concat.pem
+    cat keys/ssl/$DOMAIN.crt            >> keys/ssl/$DOMAIN-concat.pem
+    cat keys/ssl/$DOMAIN.crt             | keyringer $HYDRA encrypt ssl/$DOMAIN.crt
+
+    # Registrando e enviando mudancas finais
+    keyringer $HYDRA git commit
+    keyringer $HYDRA git push
+    git commit -a -m "Novo certificado"
+    git push
+
+    # Aplicando as mudancas no branch principal
+    git checkout master
+    git merge certs
+    git push
+
+Informações de fingerprint:
+
+    openssl x509 -noout -text        -in keys/ssl/$DOMAIN.crt
+    openssl x509 -noout -fingerprint -in keys/ssl/$DOMAIN.crt
+    openssl x509 -noout -fingerprint -in keys/ssl/$DOMAIN.crt -md5
+
+Verificando os certificados assinados:
+
+    openssl verify -verbose -CAfile keys/ssl/gandi.crt keys/ssl/$DOMAIN.crt
+
+Comunicação ao público:
+
+  * Modelos de mensagens de email disponível em `templates/certs`.
+  * Notificação para `https://www.$DOMAIN/pt-br/certs` dispínvel em `notices/certs*`.
+
+Assine as comunicações com a [chave do grupo](https://protocolos.sarava.org/trac/wiki/Comunicacao/OpenPGP), por exemplo:
+
+    GPG_AGENT_INFO="" gpg -b --armor --default-key $KEY_FINGERPRINT -s $FOLDER/doc/notices/certs/$DOMAIN.pt-br.txt
+    GPG_AGENT_INFO="" gpg -b --armor --default-key $KEY_FINGERPRINT -s $FOLDER/doc/notices/certs/$DOMAIN.en.txt
+
+Copie as notificações para ser incluída em `https://$DOMAIN/certs`:
+
+    cp $FOLDER/doc/notices/certs/* $FOLDER/puppet/modules/site_apache/files/htdocs/$MAIN_DOMAIN/certs/
+    cd $FOLDER/puppet
+    git add modules/site_apache/files/htdocs/$DOMAIN/certs/
+    git commit -m "Atualizando info sobre certificados"
+    git push
+
+Por fim, atualize os `postfix::tlspolicy_snippet` do `$DOMAIN`, caso aplicável.