-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi, PlantUML is great! But despite open-source, it is also a relatively large executable that will be run in many environments with broad access rights, e.g. full-disk access, network, etc. In the light of Supply Chain Attacks (e.g. dependencies become compromised by malicious code) etc., it would be good to isolate PlantUML from the host system.
There are two immediate directions:
- Run PlantUML in a Docker container, as e.g. based on this Docker image.
- Provide a transparent mechanism that limits the access privileges of the
.jar.
I am not familiar with the complex Java Security Model, but it seems possible to provide a security permissions file and include that when invoking the JRE.
So for instance, one could limit it to reading and writing the current working directory and the stuff necessary to run the Graphviz engine.
My key point is that it should be in a transparent way, e.g. a separate permissions.txt so that it is open for quick inspection, like so:
java -Djava.security.manager -Djava.security.policy=permissions.txt -jar plantuml.jar sequenceDiagram.txt
If hidden in the source-code, it is inaccessible for inspection and requires users to "trust" the binary. Which is against state-of-the-art "minimal trust" approaches.
Requires Actions, IMO:
- Clarify the current security model in the documentation, including dependencies and the build environment.
- Produce a minimal policy file
permissions.txt. I think this will not be a lot of effort if one knows the inner mechanics of PlantUML, but hugely contain potential risks.
Think Log4J to get a grasp of what trouble, effort, and reputation risk is at stake ;-).