Skip to content

Commit f2fc387

Browse files
author
Daan Hoogland
committed
rabbitmq jasypt instructions update
1 parent 1693b37 commit f2fc387

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

source/adminguide/events.rst

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,20 @@ changes can control the behaviour.
162162
163163
The ``eventNotificationBus`` bean represents the
164164
``org.apache.cloudstack.mom.rabbitmq.RabbitMQEventBus`` class.
165-
165+
166166
If you want to use encrypted values for the username and password, you have to include a bean to pass those
167167
as variables from a credentials file.
168168

169+
.. note::
170+
Older versions of this guide referenced
171+
``org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer``, which comes
172+
from the ``jasypt-spring3`` artifact. That artifact is not shipped with CloudStack and is
173+
not compatible with the Spring 5 used since CloudStack 4.x, so beans referencing it fail
174+
to load with a ``ClassNotFoundException``. Use
175+
``com.cloud.utils.crypt.EncryptablePropertyPlaceholderConfigurer`` instead, which ships
176+
with CloudStack and works the same way. This bean also expects encrypted values to be
177+
wrapped as ``ENC(...)``, matching the convention used elsewhere in CloudStack.
178+
169179
A sample is given below
170180

171181
.. code:: bash
@@ -191,29 +201,39 @@ changes can control the behaviour.
191201
</bean>
192202
193203
<bean id="environmentVariablesConfiguration" class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
194-
<property name="algorithm" value="PBEWithMD5AndDES" />
204+
<property name="algorithm" value="PBEWITHHMACSHA512ANDAES_256" />
195205
<property name="passwordEnvName" value="APP_ENCRYPTION_PASSWORD" />
196206
</bean>
197207
198208
<bean id="configurationEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
199209
<property name="config" ref="environmentVariablesConfiguration" />
210+
<property name="ivGenerator">
211+
<bean class="org.jasypt.iv.RandomIvGenerator" />
212+
</property>
200213
</bean>
201214
202-
<bean id="propertyConfigurer" class="org.jasypt.spring3.properties.EncryptablePropertyPlaceholderConfigurer">
215+
<bean id="propertyConfigurer" class="com.cloud.utils.crypt.EncryptablePropertyPlaceholderConfigurer">
203216
<constructor-arg ref="configurationEncryptor" />
204217
<property name="location" value="classpath:/cred.properties" />
205218
</bean>
206219
</beans>
207220
208221
209-
Create a new file in the same folder called ``cred.properties`` and the specify the values for username and password as jascrypt encrypted strings
222+
Create a new file in the same folder called ``cred.properties`` and specify the values for
223+
username and password as jasypt encrypted strings, wrapped as ``ENC(...)``.
210224

211225
Sample, with ``guest`` as values for both fields:
212226

213227
.. code:: bash
214228
215-
username=nh2XrM7jWHMG4VQK18iiBQ==
216-
password=nh2XrM7jWHMG4VQK18iiBQ==
229+
username=ENC(nh2XrM7jWHMG4VQK18iiBQ==)
230+
password=ENC(nh2XrM7jWHMG4VQK18iiBQ==)
231+
232+
``PBEWithMD5AndDES``, used in earlier releases of this guide, is a weak algorithm and should
233+
not be used for new deployments; ``PBEWITHHMACSHA512ANDAES_256`` above is a stronger,
234+
future-proof alternative. Use the ``jasypt`` CLI tools (or any tool using the jasypt library)
235+
with the same algorithm, IV generator and ``APP_ENCRYPTION_PASSWORD`` to produce the
236+
encrypted values for ``cred.properties``.
217237

218238

219239
#. Restart the Management Server.

0 commit comments

Comments
 (0)