Skip to content

#189: Add Hashicorp Vault as db credential source, smtp password is a…#190

Merged
ebrahimmfadae merged 2 commits intodevfrom
features/189-using-vault
Feb 5, 2022
Merged

#189: Add Hashicorp Vault as db credential source, smtp password is a…#190
ebrahimmfadae merged 2 commits intodevfrom
features/189-using-vault

Conversation

@maryarm
Copy link
Copy Markdown
Contributor

@maryarm maryarm commented Feb 5, 2022

…lso now supports Vault

@maryarm maryarm requested a review from Marchosiax February 5, 2022 02:59
Comment thread Deployment/docker-compose-vault.yml Outdated
- "127.0.0.1:8200:8200"
volumes:
- $DATA/vault:/vault/file:rw
- $PWD/vault/config:/vault/config:rw
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why $PWD is used instead of $DATA?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I remember, DATA is used to address runtime output, but here we need to introduce the existing vault configs fto the container.

Comment thread Deployment/docker-compose-vault.yml Outdated
@@ -0,0 +1,33 @@
version: '3.8'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file redundant? Because same implementation exists in docker-compose.yml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍 I will remove this and local compose as well, they are only used for testing :)

Comment thread Deployment/docker-compose-vault.yml Outdated
- PANEL_PASS=${PANEL_PASS}
- BACKEND_USER=${BACKEND_USER}
- SMTP_PASS=${SMTP_PASS}
- DB_USER=${DB_USER}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these default values? Can we change username and password for each app?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically yes as there are separate lines for each app at the vault's start up script, but to ease the setup of compose we used only one env var for all of them.

vault server -config /vault/config/vault.json &

## Export values
export VAULT_ADDR='http://0.0.0.0:8200'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently these export command will override environment configs in docker-compose.yml, which will makes environment variables redundant. If its not the case please explain.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, right. As the port 8200 is also hard coded in the vault.json, I will remove the env from compose.

- VAULT_API_ADDR=http://0.0.0.0:8200
- VAULT_ADDRESS=http://0.0.0.0:8200
- PANEL_PASS=${PANEL_PASS}
- BACKEND_USER=${BACKEND_USER}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is BACKEND_USER, value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in Jenkinsfile.deploy.dev.groovy it is defined to be retrieved from jenkins credentials.

image: djenriquez/vault-ui
environment:
- VAULT_URL_DEFAULT=http://vault:8200
- VAULT_AUTH_DEFAULT=USERNAMEPASSWORD
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the actual credential or it will change after initializing? Considering that the UI port is going to be exposed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

USERNAMEPASSWORD is not the userpass, it indicates the default authentication method.

@ebrahimmfadae ebrahimmfadae self-assigned this Feb 5, 2022
@ebrahimmfadae ebrahimmfadae added the enhancement New feature or request label Feb 5, 2022
@ebrahimmfadae ebrahimmfadae merged commit a48a94e into dev Feb 5, 2022
@ebrahimmfadae ebrahimmfadae deleted the features/189-using-vault branch February 5, 2022 09:33
ebrahimmfadae added a commit that referenced this pull request Feb 19, 2022
* remove payment from enginx config

* Add storage module's volume

* Fix storage volume address

* close #175: Fix matching-engine's trade counter

* 174 upgrade versions (#179)

* remove payment from enginx config (#170)

* #174: All modules except keycloak-gateway upgraded.

Co-authored-by: Peyman <46522754+Marchosiax@users.noreply.github.com>

* Close #171 and #177: Kafka improvement (#180)

* Clean up engine's event models

* Clean up accountant

* Adding new events for richorder topic

* Add OrderStatus model

* Separate order and trade processing in API

* Set all kafka configs

* close #177: Fix websocket issue

* Add kafka ui monitoring tool

* Fix new topic beans

* Change kafka image

* Fix kafka config

* Fix bean name error

* Remove kafka exposed ports

* Remove root user grant

* Optimize imports

* Change java version to 11 (#185)

* #189: Add Hashicorp Vault as db credential source, smtp password is a… (#190)

* #189: Add Hashicorp Vault as db credential source, smtp password is also now supports Vault

* #189: A bit cleaning in the configs to remove useless files/redundant variables

* #199: move vault host config from docker to main profile (#192)

* Close #181, Remove nginx (#194)

* Remove nginx service and config file

* Remove redundant network aliases

* Refactor jenkins configs and docker compose

* Set all app ports to 8080

* Add fallback value to network config

* Rename network

* Refactor docker-compose configs

* Add remove orphans to docker-compose startup script

* Refactor jenkins configuration files

* Resolve docker-compose config issues

* Update jvm target version in kotlin-maven-plugin

* Remove anonymous volumes in docker files

* Update Jenkins file

* Cleanup docker-compose configs

* Fix typo in server port

* Change chain scan gateway addresses

* Update java version in git flows

* Rename compose project name in Jenkinsfile

* Update DATA value in Jenkins

* Update maven compiler version in keycloak

* Fix maven version

* Add clean up codes after deliver

* Fix local port expose

* Update Jenkins stages title

* Close #195, Fix maven build issues (#196)

* Fix matching-engine test package names

* Change vault config address

* Fix docker-compose command in jenkins

* Fix bc-gateway VAULT_HOST

* Security issues resolved (#197)

* Add auth endpoint extensions

* Add admin module

* close #172: Brute force

* close #182: Token and clients

* Add auth admin services

* Add keycloak extension

* Add profile services

* Resolve merge conflicts

* Add opex realm configs

* Close #172: Brute force protection

* Close #182: Token organization

* Close #186: Keycloak and security improvements

* Remove .env gitignore rule

* Revert keycloak's admin and frontend url

* Remove client secret variable

* Add .env gitignore rule

* Update gitignore

* Hostfix keycloak

* Remove application-docker.yml and application-local.yml profiles

* Extract keycloak frontend url configs

* Remove mvnw and mvnw.cmd in all modules

* Fix postgres version

* Add resources folder

* Fix vault config

* Fix env variables in application.yml

* Add migration config to keycloak

* Update keycloak url configs

* Close #200, Refactor deployment configs (#206)

* Remove application-docker.yml and application-local.yml profiles

* Extract keycloak frontend url configs

* Remove mvnw and mvnw.cmd in all modules

* Fix postgres version

* Add resources folder

* Fix vault config

* Fix env variables in application.yml

* Add migration config to keycloak

* Update keycloak url configs

* Fix opex-master-realm.json path in keycloak

* Fix cert-url in websocket

* Remove ; from end of postgres sql commands

* Add bitcoin reserved addresses

Co-authored-by: Peyman <marchosiax@gmail.com>
Co-authored-by: maryarm <45322329+maryarm@users.noreply.github.com>
Co-authored-by: Peyman <46522754+Marchosiax@users.noreply.github.com>
@ebrahimmfadae ebrahimmfadae added this to the v1.0.0 milestone May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants