runtime-parameters.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. server:
  2. command:
  3. - /bin/bash
  4. args:
  5. - -ec
  6. - |
  7. #!/bin/bash
  8. # Perform an initialization of the vault server
  9. vault server -config=/bitnami/vault/config/config.hcl &
  10. # Leave some seconds for the initialization to take place
  11. sleep 10
  12. # We need to manually initialize the Vault and perform the unseal operations.
  13. # https://developer.hashicorp.com/vault/docs/platform/k8s/helm/run#initialize-and-unseal-vault
  14. INIT_OUTPUT="$(vault operator init)"
  15. export VAULT_TOKEN=$(echo "$INIT_OUTPUT" | awk -F: '/Initial Root Token/ {print $2}' | tr -d " ")
  16. KEY1=$(echo "$INIT_OUTPUT" | awk -F: '/Unseal Key 1/ {print $2}' | tr -d " ")
  17. KEY2=$(echo "$INIT_OUTPUT" | awk -F: '/Unseal Key 2/ {print $2}' | tr -d " ")
  18. KEY3=$(echo "$INIT_OUTPUT" | awk -F: '/Unseal Key 3/ {print $2}' | tr -d " ")
  19. vault operator unseal "$KEY1"
  20. vault operator unseal "$KEY2"
  21. vault operator unseal "$KEY3"
  22. # Adding the VAULT_TOKEN as a file in order to execute goss tests
  23. echo "export VAULT_TOKEN=$VAULT_TOKEN" > /vib-vault/test/vault-token
  24. # Creating a user/password in order to launch Cypress tests
  25. # https://developer.hashicorp.com/vault/docs/auth/userpass#configuration
  26. vault auth enable userpass
  27. vault policy write rootpolicy - << EOF
  28. # Read the configuration secret example
  29. path "secret/config" {
  30. capabilities = ["read"]
  31. }
  32. # Read the host information example
  33. path "sys/host-info" {
  34. capabilities = ["read"]
  35. }
  36. # List secrets engines
  37. path "sys/mounts" {
  38. capabilities = ["read"]
  39. }
  40. # Enable cubbyhole secrets engine
  41. path "sys/mounts/cubbyhole" {
  42. capabilities = ["create", "update"]
  43. }
  44. # Manage Cubbyhole secrets engine keys
  45. path "cubbyhole/keys" {
  46. capabilities = ["list"]
  47. }
  48. path "cubbyhole/keys/*" {
  49. capabilities = ["create", "list", "read", "update"]
  50. }
  51. path "cubbyhole/keys/+/config" {
  52. capabilities = ["create", "update"]
  53. }
  54. # Encrypt with any Cubbyhole secrets engine key
  55. path "cubbyhole/encrypt/*" {
  56. capabilities = ["create", "update"]
  57. }
  58. # Decrypt with any Cubbyhole secrets engine key
  59. path "cubbyhole/decrypt/*" {
  60. capabilities = ["create", "update"]
  61. }
  62. EOF
  63. vault write auth/userpass/users/vib-user password='ComplicatedPassword123!4' policies=admins,rootpolicy
  64. sleep infinity
  65. containerPorts:
  66. http: 8100
  67. internal: 8300
  68. service:
  69. active:
  70. type: LoadBalancer
  71. ports:
  72. http: 80
  73. internal: 8600
  74. general:
  75. type: ClusterIP
  76. ports:
  77. http: 8081
  78. internal: 8700
  79. serviceAccount:
  80. create: true
  81. automountServiceAccountToken: true
  82. containerSecurityContext:
  83. enabled: true
  84. runAsUser: 1002
  85. runAsNonRoot: true
  86. readOnlyRootFilesystem: true
  87. allowPrivilegeEscalation: false
  88. capabilities:
  89. drop: ["ALL"]
  90. podSecurityContext:
  91. enabled: true
  92. fsGroup: 1002
  93. seccompProfile:
  94. type: RuntimeDefault
  95. persistence:
  96. enabled: true
  97. mountPath: /vib-vault/test
  98. # We need to add /tmp for GOSS tests
  99. extraVolumes:
  100. - name: tmp
  101. emptyDir: {}
  102. extraVolumeMounts:
  103. - name: tmp
  104. mountPath: /tmp
  105. injector:
  106. service:
  107. ports:
  108. https: 8443