Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
RE-implemented starlord + vault#649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
8115b6e8d6e6859bbc130084f934ada2d632a90780fa6fdbd9163d32daf8b10754973d53f3a4cf757a017632b90d759c1c50ccb43fe44f9789f0b2fee103bd4a943d86db539aee564ddFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: starlord | ||
| container_image: "{{ registry_host }}/runnable/{{ name }}" | ||
| container_tag: "{{ git_branch }}" | ||
| inject_ca: false | ||
| repo: git@github.com:CodeNow/{{ name }}.git | ||
| node_version: "6.10.2" | ||
| container_envs: | ||
| - name: NODE_ENV | ||
| value: "{{ node_env }}" | ||
| - name: VAULT_ENDPOINT | ||
| value: "http://{{ user_vault_host_address }}:{{ user_vault_port }}" | ||
| - name: VAULT_TOKEN | ||
| value: "{{starlord_vault_token}}" | ||
| - name: RABBITMQ_HOSTNAME | ||
| value: "{{ rabbit_host_address }}" | ||
| - name: RABBITMQ_PASSWORD | ||
| value: "{{ rabbit_password }}" | ||
| - name: RABBITMQ_PORT | ||
| value: "{{ rabbit_port }}" | ||
| - name: RABBITMQ_USERNAME | ||
| value: "{{ rabbit_username }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: user-vault | ||
| container_image: vault | ||
| container_tag: 0.7.0 | ||
| hosted_ports: ["{{ user_vault_port }}"] | ||
| volume_mounts: | ||
| - name: "{{ name }}" | ||
| path: /config | ||
| kind: configMap | ||
| container_run_args: > | ||
| vault server | ||
| -log-level=warn | ||
| -config=/config/vault.hcl | ||
| add_capabilities: | ||
| - IPC_LOCK |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Configuring Vault | ||
| Vault is specifically designed to be manually setup. This is not automated for a reason. | ||
| ``` | ||
| kubectl port-forward INSTERT_VAULT_ID 8300:8200 | ||
| export VAULT_ADDR=http://localhost:8300 | ||
| ``` | ||
| The first time you setup vault we need to manually configure a bunch | ||
| of things so we don't pass around the root token. | ||
| `vault init` | ||
| Grab the keys, put them in 1password | ||
| `vault unseal $key1` | ||
| `vault unseal $key2` | ||
| `vault unseal $key3` | ||
| Verify the vault unsealed | ||
| `vault auth` | ||
| Paste in the $rootToken | ||
| Now to setup the policies: | ||
| ``` | ||
| vault policy-write organizations-writeonly roles/vault/additional-files/user-vault/policies/organizations-writeonly.hcl | ||
| vault policy-write organizations-readonly roles/vault/additional-files/user-vault/policies/organizations-readonly.hcl | ||
| vault policy-write dock-user-creator roles/vault/additional-files/user-vault/policies/dock-user-creator.hcl | ||
| ``` | ||
| Now to setup the roles | ||
| `vault write auth/token/roles/organizations-readonly allowed_policies="organizations-readonly"` | ||
| Now to setup new token for starlord: | ||
| `vault token-create -policy="organizations-writeonly" -ttl="8760h"` | ||
| Take the response of this and save it in the configuration for the environment you want as the `starlord_vault_token` | ||
| Create a new token for the docks, so they can create readonly tokens. | ||
| `vault token-create -policy="dock-user-creator" -ttl="8760h"` | ||
| Save that token as the `dock_vault_user_creation_access_token` | ||
| This allows the vault user to create a new user using: | ||
| vault write -f auth/token/create/organizations-readonly |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| path "auth/token/create/organizations-readonly" { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like these files are not currently on the host and have to be manually uploaded. Can we turn this into config map and load it into vault as a volume? (Make installation easier) Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, you run these locally against the host. Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using the README above Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This if fine for now, but we'll have to automate everything after the init + unseal of the vault in order to make installation easier. Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't automate it unless we have the scripts modify devops-scripts repo directly itself. | ||
| capabilities = ["create", "update"] | ||
| } | ||
| path "sys/policy" { | ||
| capabilities = ["create", "update"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| path "secret/organization/*" { | ||
| capabilities = ["read"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| path "secret/organization/*" { | ||
| capabilities = ["create","update"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ name }} | ||
| data: | ||
| vault.hcl: | | ||
| storage "s3" { | ||
| access_key = "{{ user_vault_s3_access_key }}" | ||
| secret_key = "{{ user_vault_s3_secret_key }}" | ||
| bucket = "{{ user_vault_s3_bucket }}" | ||
| region = "{{ aws_region }}" | ||
| } | ||
| listener "tcp" { | ||
| address = "0.0.0.0:{{ user_vault_port }}" | ||
| tls_disable = 1 | ||
| } | ||
| max_lease_ttl = "8760h" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| - hosts: starlord | ||
| vars_files: | ||
| - group_vars/alpha-starlord.yml | ||
| roles: | ||
| - role: notify | ||
| - role: builder | ||
| - role: k8-deployment |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| - hosts: user-vault | ||
| vars_files: | ||
| - group_vars/alpha-user-vault.yml | ||
| roles: | ||
| - role: notify | ||
| - role: vault | ||
| - role: k8-deployment | ||
| - role: k8-service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we should move all of these to kuberentes secrets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And probably use: https://www.vaultproject.io/docs/auth/approle.html