summaryrefslogtreecommitdiff
path: root/certs.mdwn
blob: ee823f58a4fd5a19de412d7376c65d3f6d428dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[[!toc levels=4]]

Geração e renovação de certificados
===================================

Começando
---------

Proceda com a [configuração do ambiente de trabalho administrativo](/install).

Gerando novas chaves
--------------------

Proceda usando o [keyringer](https://keyringer.pw):

    keyringer $HYDRA genpair ssl ssl/$DOMAIN *.$DOMAIN

No caso da chave snakeoil (fornecida quando um atacante acessa https://IP), use

    keyringer $HYDRA genpair ssl-self ssl/example.org 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
    done

Registrando mudancas parciais
-----------------------------

    keyringer $HYDRA git commit
    keyringer $HYDRA 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
----------------

    cat /path/to/registrar.crt >> /path/to/$DOMAIN.crt
    cat /path/to/$DOMAIN.crt    | keyringer $HYDRA encrypt ssl/$DOMAIN.crt

    # Registrando e enviando mudancas finais
    keyringer $HYDRA git commit
    keyringer $HYDRA git push

Informações de fingerprint:

    openssl x509 -noout -text        -in /path/to/$DOMAIN.crt
    openssl x509 -noout -fingerprint -in /path/to/$DOMAIN.crt
    openssl x509 -noout -fingerprint -in /path/to/$DOMAIN.crt -md5

Verificando os certificados assinados:

    openssl verify -verbose -CAfile /path/to/registrar.crt /path/to/$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.fluxo.info/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.

Instalando
----------

Para instalar o certificado num nodo:

    hydra $HYDRA import-certs <nodename>