-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarkus Gradle plugin fails to initialize when an "aes-gcm-nopadding"-encrypted value is present in application.properties #33135
Comments
/cc @glefloch, @quarkusio/devtools |
/cc @radcortez |
I'll have a look. |
In #31166, the Gradle plugin was refactored to use SmallRye Config and set its own configuration. The problem is that the We could:
I'm not a Gradle expert, so some help from @snazy would be appreciated :) |
Adding the dependency isn't a big deal, however the dependency requires the decryption key to be present, even if no value's encrypted. Not sure whether the Gradle build itself (Quarkus build is not affected should actually get the decrypted values at all. Thinking that it should probably be "good enough" to just return |
As decribed in quarkusio#33135, using encrypted configuration values does not work with the current Gradle plugin since Quarkus 3.0.0. `smallrye-config-crypto` requires the `smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key` to be present for _all_ builds, even those that do not use encrypted config values. It is probably not necessary to actually know the decrypted configuration values in the Gradle build, it might practically be a security risk, because the secret key could leak into build log files (could be prevented of course) and the Gradle cache, which has a high chance of being shared with others, likely publicly. This PR adds a "fake" secret keys handler that just returns the string `<REDACTED>` for all encrypted values. Fixes quarkusio#33135
As decribed in quarkusio#33135, using encrypted configuration values does not work with the current Gradle plugin since Quarkus 3.0.0. `smallrye-config-crypto` requires the `smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key` to be present for _all_ builds, even those that do not use encrypted config values. It is probably not necessary to actually know the decrypted configuration values in the Gradle build, it might practically be a security risk, because the secret key could leak into build log files (could be prevented of course) and the Gradle cache, which has a high chance of being shared with others, likely publicly. This PR adds a "fake" secret keys handler that just returns the string `<REDACTED>` for all encrypted values. Fixes quarkusio#33135
As decribed in quarkusio#33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (quarkusio#33079). This change just adds tests to validate the behavior.
As decribed in quarkusio#33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (quarkusio#33079). This change just adds tests to validate the behavior.
As decribed in quarkusio#33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (quarkusio#33079). This change just adds tests to validate the behavior.
As decribed in quarkusio#33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (quarkusio#33079). This change just adds tests to validate the behavior.
As decribed in quarkusio#33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (quarkusio#33079). This change just adds tests to validate the behavior.
As decribed in quarkusio#33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (quarkusio#33079). This change just adds tests to validate the behavior.
Describe the bug
The Gradle Quarkus plugin gives the following error if any
${aes-gcm-nopadding::...}
values are present in the application.properties file:The build.gradle file has the correct dependencies:
This failure does not appear in a Maven build.
Here is a portion of the stack trace:
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
Reproducer: https://github.com/jskillin-idt/quarkusio-quarkus-issues-33135
To recreate the reproducer:
quarkus create app --no-code --gradle
src/main/resources/application.properties
add the line:someValue = ${aes-gcm-nopadding::garbage}
(it doesn't matter what it is as long as it references "aes-gcm-nopadding")With either your own repo or the reproducer, simply:
./gradlew build
Notice that the configuration of the build.gradle, through dependencies or classpath, does not appear to affect the outcome.
Output of
uname -a
orver
Linux jskillin-ubuntu-dev 6.2.0-20-generic #20-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 6 07:48:48 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.18" 2023-01-17 OpenJDK Runtime Environment (build 11.0.18+10-post-Ubuntu-0ubuntu5) OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Ubuntu-0ubuntu5, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.0.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.1
Additional information
No response
The text was updated successfully, but these errors were encountered: