Skip to content
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

emit cert as Java KeyStore #307

Open
aep opened this issue Jul 20, 2022 · 3 comments
Open

emit cert as Java KeyStore #307

aep opened this issue Jul 20, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@aep
Copy link
Contributor

aep commented Jul 20, 2022

Use case

java requires using a "keystore" instead of just pem encoded certs.
so we'll have to emit those from premain.

Describe your solution

(https://github.com/pavlo-v-chernykh/keystore-go) could be used to provide the nessesary template func

something like

"Marbles": {
        "javathing": {
            "Parameters": {
                "Files": {
                    "/app/keystore.jks": "{{ javaKeyStore .MarbleRun.MarbleCert.Cert }}",
@daniel-weisse
Copy link
Member

I would prefer not to add language specific encodings to the manifest.
In my opinion, parsing files is something that should be left to the application itself.

If PEM is something your application does not handle well, you can also use raw, to get the certificate in DER encoded certificate, or hex, to get the DER certificate hex encoded. See the docs for more details.

Tagging @m1ghtym0 in case he has a different opinion.

@aep
Copy link
Contributor Author

aep commented Jul 21, 2022

Yeah that would be the ideal design but the client insists to run applications unmodified using gramine.

I think a workable path would be to have generic transformer plugins in premain, but unfortunately premain doesn't know which file is the certificate.

Another possible solution is to just downstream fork premain and hardcode this specific behavior. but other people using java will have the same issue

@m1ghtym0
Copy link
Member

I agree with Daniel that ideally, encodings should be language neutral.
However, I see the problem here and it's just another encoding.
IMO, that's not a big deal and we can have as many encodings as necessary, especially in hindsight of lift&shift.
So, @aep please feel free to add JavaKeyStore as a file encoding.

aep added a commit to aep/marblerun that referenced this issue Jul 21, 2022
aep added a commit to aep/marblerun that referenced this issue Jul 21, 2022
aep added a commit to aep/marblerun that referenced this issue Jul 21, 2022
aep added a commit to aep/marblerun that referenced this issue Jul 21, 2022
Java requires using a "keystore" instead of just pem encoded certs.
So this adds the ability to emit a keystore file containing secrets.

in Files, you can now use the "jks" filter like

"Marbles": {
    "javathing": {
        "Parameters": {
            "Files": {
                "/app/keystore.jks": "{{ jks \"password\" .MarbleRun.MarbleCert.Cert }}",

fixes edgelesssys#307
aep added a commit to aep/marblerun that referenced this issue Jul 21, 2022
Java requires using a "keystore" instead of just pem encoded certs.
So this adds the ability to emit a keystore file containing secrets.

in Files, you can now use the "jks" filter like

"Marbles": {
    "javathing": {
        "Parameters": {
            "Files": {
                "/app/keystore.jks": "{{ jks \"password\" .MarbleRun.MarbleCert.Cert }}",

fixes edgelesssys#307
aep added a commit to aep/marblerun that referenced this issue Jul 21, 2022
Java requires using a "keystore" instead of just pem encoded certs.
So this adds the ability to emit a keystore file containing secrets.

in Files, you can now use the "jks" filter like

"Marbles": {
    "javathing": {
        "Parameters": {
            "Files": {
                "/app/keystore.jks": "{{ jks \"password\" .MarbleRun.MarbleCert.Cert }}",

fixes edgelesssys#307
@m1ghtym0 m1ghtym0 added the enhancement New feature or request label Aug 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

No branches or pull requests

3 participants