How to manage environment variables in server.env with Vault - spring

How to manage enviroment variables in my config "server.env" at websphere liberty.
In my server websphere liberty:
server.env
username=admin
password=abc123
I want to use Vault to manage server.env

Related

share MQ Libraries installed on server1 to share on server2 liberty server.xml

We have configured WLP and MQ to use JMS messaging. On a server1 where the Liberty Servers and MQ installed we referred the MQ libraries as below and it's working fine. However, we are not sure from server2 when we make connection to MQ we are using client transport type with port number. How to refer the below MQ libraries on the server2 server.xml? Any help or guidance on this? Thanks
server.xml from server1
server2 JMS connection
<properties.wmqJms
transportType="CLIENT"
hostName="Host1"
port="9001"
channel="SYSTEM.DEF.SVRCONN"
queueManager="QM1"/>
You'll need to copy the file wmq.jmsra.rar to the disk of server2 and then set the path to that file in server.xml using a variable:
<variable name="wmqJmsClient.rar.location" value="/path/to/wmq/rar/wmq.jmsra.rar"/>
See: https://www.ibm.com/docs/en/was-liberty/nd?topic=dmal-deploying-jms-applications-liberty-use-mq-messaging-provider

how to access environment variables from self hosted runner in github action

I am running EC2 as self hosted runner. I have exported AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to the EC2, and I can see that they are set with printenv command.
Reason for doing this is that I dont want to save AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in github secret.
Is there any way I can access and use the environment variables (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) in my github action workflow?

Spring Cloud config server security

I implemented Spring Cloud config server. How can I prevent the config server bootstrap.yml file from storing the GIT user name and password as clear text?
Vault: https://github.com/hashicorp/vault
Use Vault: https://cloud.spring.io/spring-cloud-config/reference/html/#_vault
Set up Spring Vault:
https://docs.spring.io/spring-vault/docs/2.2.2.RELEASE/reference/html/
https://spring.io/projects/spring-vault
In your Spring Cloud config server, file bootstrap.yml
spring:
cloud:
config:
token: YourVaultToken
ok So this is working fine for me, the issue was my config server's bootstrap.yml need to connect to GIT repository as backend and GIT repo is secured with username and password but I can not pass the username and password in bootstrap.yml file.
To solve this:
Pass the credential as environmental variable and store these environment variable in terraform or any other secure location.

How to use consul in dev environment

Suppose I've got services A and B. Both of them are deployed to test server and connected to Consul.
When I start service A on my local machine it will read data from consul and interact with service B deployed on test server.
How can I make service A to interact with service B on the local machine if it's also running?
I thought to run local Consul instance and proxy missing requests (configuration and service discovery) to test server consul but I didn't find any info about it.
How can / should I configure my local environment with Consul?
Steps for configuring consul on local environment :
install consul on local
https://www.consul.io/downloads.html
consul agent -dev - command used to run consul on local
You can use git2consul tool for reading the config from the local git repository, like
git2consul --config <path to git2consul file>
https://github.com/breser/git2consul
If you want to avoid the usage of service B running in the test environment you should make your local service B to register whit a different name into the consul server like C and also change you local service A to consume it.
This way you would have registered into consul two instances of service A, one instance of service B and one instance of service C and.

Monitor a remote IBM Websphere with VisualVM and JMX

I am trying to monitor a remote IBM WAS with VisualVM but I can't connect.
To enable JMX on the IBM Websphere open the WebSphere administrative console and:
navigate to: Server -> Server Types -> WebSphere application servers ->[SERVER_NAME]
Expand Java and Process Management and click Process definition
Click Java Virtual Machine
In the Generic JVM arguments field append the following properties:
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1099 -Djava.rmi.server.hostname=XX.228.75.XX
Restart the server
When the server starts, open VisualVM and add a new Remote Connection:
In the connection field, put the server host and the port previously configured, for instance 1099.

Resources