Managing SSH keys with Vault requires 3 steps:
- Setting up Vault
- Setting up the host
- Setting up the client / using the signed client keys
For a full documentation, see this HashiCorp Blog Post
| #!/bin/sh | |
| # | |
| # Perform certificate updates in Vault. | |
| set -eo pipefail | |
| if ! vault token lookup > /dev/null; then | |
| echo "Login to Vault first." | |
| exit 1 | |
| fi |
| #!/bin/bash | |
| # start vault | |
| VAULT_UI=true vault server -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8200 | |
| # login as root - DO NOT DO THIS IN PRODUCTION | |
| vault login root | |
| # write some secrets | |
| vault kv put secret/test color=blue number=eleventeen |
| #!/usr/bin/env python | |
| # | |
| # (c) Krzysztof Magosa | |
| # License: MIT | |
| # Use at your own risk. | |
| # | |
| # https://gist.github.com/krzysztof-magosa/d9d96c8864a20dc3b47fd1eee1cfcc4f | |
| # |
| version: '2.4' | |
| services: | |
| target: | |
| privileged: true | |
| network_mode: "host" | |
| ipc: "host" | |
| restart: always | |
| volumes: | |
| - '/etc/localtime:/etc/localtime:ro' | |
| - '/edgefs/var/run:/opt/nedge/var/run:z' |
Managing SSH keys with Vault requires 3 steps:
For a full documentation, see this HashiCorp Blog Post
| #cloud-config | |
| hostname: host-0815 | |
| ssh_authorized_keys: | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA61LSHA7iU+82Z2qypYLx2gB9uHydUOoDON30ceAKl5dSgzShtF5XS5sqABYBMowDcvdkNyUDdt1Druv82iu/scATLFmxTQ8R2XIL33dMO6IpBg0d3WQcU5Xqeor9s5LTpln7F0V+9vaYG/nXqQtnz4PEnZGA+f9ddHuvcDajqKLNTDyriL87E6HAfjNU+1ShI2Qv8Zqhq8rYW0zkn2C+4vVKpgzq8B91R7hSXZwUTU9+bIq3uqTfe/t9/5hFNZEUo/ezV25DFvWDmvKcXt1QRoLxL/NI7h00fEJY7QVh2eevtiA9BdthI2LHx2tm2LoMYHQVZUVljm033xh2UISx | |
| runcmd: | |
| - echo "true" > /home/rancher/provisioned | |
| write_files: | |
| - path: /etc/docker/certs.d/private-registry.internal/ca.crt |
| import org.sonatype.nexus.repository.storage.Component | |
| import org.sonatype.nexus.repository.storage.StorageFacet; | |
| def retentionCount = 15 | |
| def repositoryName = 'releases' | |
| def dryRun = true | |
| log.info("Cleanup script started! Dry Run Mode: $dryRun"); | |
| def repo = repository.repositoryManager.get(repositoryName); | |
| def tx = repo.facet(StorageFacet.class).txSupplier().get(); |
| apiVersion: rook.io/v1alpha1 | |
| kind: Cluster | |
| metadata: | |
| name: rook | |
| namespace: rook | |
| spec: | |
| versionTag: master | |
| dataDirHostPath: /var/lib/rook-config | |
| # toggle to use hostNetwork | |
| hostNetwork: true |
| #version=RHEL7 | |
| # Action | |
| install | |
| cdrom | |
| lang en_US.UTF-8 | |
| keyboard us | |
| text | |
| firewall --service=ssh |
| # I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor. | |
| # The unifi default port is 8443 running on localhost. | |
| # License: CC0 (Public Domain) | |
| server { | |
| # SSL configuration | |
| # | |
| listen 443 ssl default_server; | |
| listen [::]:443 ssl default_server; |