scshitole / vault_doc

0 stars 0 forks source link

s1 #1

Open scshitole opened 3 years ago

scshitole commented 3 years ago
{{ with secret "pki/issue/web-certs" "common_name=www.demof5.com" }}
[
    {
        "op": "replace",
        "path": "/Demof5/HTTPS/webcert/remark",
        "value": "Updated on {{ timestamp }}"
    },
    {
        "op": "replace",
        "path": "/Demof5/HTTPS/webcert/certificate",
        "value": "{{ .Data.certificate | toJSON | replaceAll "\"" "" }}"
    },
    {
        "op": "replace",
        "path": "/Demof5/HTTPS/webcert/privateKey",
        "value": "{{ .Data.private_key | toJSON | replaceAll "\"" "" }}"
    },
    {
        "op": "replace",
        "path": "/Demof5/HTTPS/webcert/chainCA",
        "value": "{{ .Data.issuing_ca | toJSON | replaceAll "\"" "" }}"
    }
]
{{ end }}
scshitole commented 3 years ago
[
    {
        "op": "replace",
        "path": "/Demof5/HTTPS/webcert/remark",
        "value": "Updated on 2020-10-02T19:05:53Z"
    },
    {
        "op": "replace",
        "path": "/Demof5/HTTPS/webcert/certificate",
        "value": "-----BEGIN CERTIFICATE-----\nMIIDSDCCAjCgAwIBAgIUaMgYXdERwzwU+tnFsSFld3DYrkEwDQYJKoZIhvcNAQEL\nBQAwEzERMA8GA1UEAxMIZGVtby5jb20wHhcNMjAxMDAyMTkwNTIzWhcNMj
scshitole commented 3 years ago
pid_file = "./pidfile"

vault {
   address = "http://127.0.0.1:8200"
}

auto_auth {
   method "approle" {
       mount_path = "auth/approle"
       config = {
           role_id_file_path = "roleID"
           secret_id_file_path = "secretID"
           remove_secret_id_file_after_reading = false
       }
   }

   sink "file" {
       config = {
           path = "approleToken"
       }
   }
}

template {
  source      = "./certs.tmpl"
  destination = "./certs.json"
  #command = "bash updt.sh"
}

template {
    source = "./https.tmpl"
    destination = "./https.json"
}