ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.88k stars 514 forks source link

Spring Cloud and jasypt-spring-boot-starter, not decrypting during refresh #112

Closed ramkumarar closed 5 years ago

ramkumarar commented 5 years ago

I'm using jasypt-spring-boot-starter (2.1.0) in a spring cloud config project.When the config loads for the firt time from config server the encrypted values are getting properly decrypted. But when i do a refresh via actuator endpoint the encrypted value is passed as is and not getting decrypted. Iam having following properties in cloud configuration and passing the password via JVM run time argument -Djasypt.encryptor.password=pass

app.enc.attribute = ENC(hKF3c7lizZKAi75e9q9JCQ==) jasypt.encryptor.bootstrap = true jasypt.encryptor.algorithm = PBEWITHMD5ANDTRIPLEDES

I see some discussion around this earlier. Not sure if this is resolved or not. https://github.com/spring-cloud/spring-cloud-config/issues/808

ramkumarar commented 5 years ago

Was able to resolve the issue using StandardEncryptableEnvironment and closing this issue.

yangkebiao commented 5 years ago

Was able to resolve the issue using StandardEncryptableEnvironment and closing this issue.

How to solve it? Can you show the code?

nav16011991 commented 5 years ago

Please use following code in your main method: new SpringApplicationBuilder() .environment(new StandardEncryptableEnvironment()) .sources(MasterDataManagementService.class).run(args);

nischayreddy commented 5 years ago

@nav16011991 Will this change any behavior of application except not updating the passwords?.

krishna2025 commented 4 years ago

we are using spring boot version 2.1.10.RELEASE and cloud version Greenwich.SR3 and we are using jasypt for encrypted passwords. I kept encrypted passwords on application.yml file. During configserver startup it is getting decripted properly and working fine. If I make any changes on application.yml file my decripted password automatically getting encrypted back and not decripting. Can some one help on this?

krishna2025 commented 4 years ago

Please use following code in your main method: new SpringApplicationBuilder() .environment(new StandardEncryptableEnvironment()) .sources(MasterDataManagementService.class).run(args);

HI should we need to use this logic at configServer main program?or Config Client can u please suggest me?