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

Support running executables in Docker containers (namely PlantUML) #50

Open
mfhepp opened this issue Aug 18, 2022 · 3 comments
Open

Support running executables in Docker containers (namely PlantUML) #50

mfhepp opened this issue Aug 18, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@mfhepp
Copy link

mfhepp commented Aug 18, 2022

Hi,
the diversity of the executables used make it quite a security concern, as they all have full-disk and network access.

Now, an effective mitigation would be to put the executables like PlantUML into a Docker container with limited privileges and run it from there, as e.g. PlantUML should not need anything beyond read access to the working directory and write access to the plots output directory.

I will be happy to work on a Dockerfile for PlantUML, but before doing so, I need to know how pandoc-plot invokes PlantUML and others.

  • Do you send the figure source code via stdout/stdin to the process?
  • Or do you create a temporary file of the image source?
  • If so, do you pass an absolute path, or a relative path for the source and the target locations?

This will be important to configure the Dockerfile so that it has access to the input and sufficient rights to create the output.

If you could post an example of how the entire command line for a figure would look like for PlantUML, that would be good.

Like so:

java -jar plantuml.jar plot323232.source -o plots/plot323232.png

Relative paths would be best. stdout/stdin would be ideal.

Then, an updated version of this Dockerfile would do the trick:

@mfhepp
Copy link
Author

mfhepp commented Aug 19, 2022

Cross-referencing #51

@LaurentRDC
Copy link
Owner

See my answer in #51 as to what command is run.

As described there, I've been thinking about making the command that pandoc-plot run completely customizable by the users. For example, the configuration might look like:

plantuml:
    command: $exe -jar plantuml.jar -t$png -output $outfile $infile

and the user could change it to whatever they want. Someone else will have to do this as I don't have time these days

@LaurentRDC LaurentRDC added the enhancement New feature or request label Aug 30, 2022
@mgajda
Copy link
Contributor

mgajda commented Sep 12, 2023

@mfhepp If you have a command line that runs it within Docker container, it would perhaps be useful to add to documentation?

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