Enum SecurityProfile

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SecurityProfile>

    public enum SecurityProfile
    extends java.lang.Enum<SecurityProfile>
    There are 4 different security profile defined.

    The security profile to be used is set at the launch of PlantUML and cannot be changed by users. The security profile defines what an instance of PlantUML is allowed to do:
    - access some local file
    - connection to some remote URL
    - print some technical information to the users.

    The security profile is defined:
    - either by an environment variable
    - or an option at command line

    There is also a default value, which is LEGACY in this current implementation.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALLOWLIST  
      INTERNET
      This mode is designed for PlantUML running in a web server.
      LEGACY
      This mode reproduce old PlantUML version behaviour.
      SANDBOX
      Running in SANDBOX mode is completely secure.
      UNSECURE
      Running in UNSECURE mode means that PlantUML can access to any local file and can connect to any URL.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getTimeout()
      Retrieve the timeout for URL.
      java.lang.String longDescription()
      A Human understandable description.
      static SecurityProfile valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SecurityProfile[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SANDBOX

        public static final SecurityProfile SANDBOX
        Running in SANDBOX mode is completely secure. No local file can be read (except dot executable) No remote URL access can be used No technical information are print to users.

        This mode is defined for test and debug, since it's not very useful for users. However, you can use it if you need to.

      • INTERNET

        public static final SecurityProfile INTERNET
        This mode is designed for PlantUML running in a web server.
      • LEGACY

        public static final SecurityProfile LEGACY
        This mode reproduce old PlantUML version behaviour.

        Right now, this is the default Security Profile but this will be removed from future version because it is now full secure, especially on Internet server.

      • UNSECURE

        public static final SecurityProfile UNSECURE
        Running in UNSECURE mode means that PlantUML can access to any local file and can connect to any URL.

        Some technical information (file path, Java version) are also printed in some error messages. This is not an issue if you are running PlantUML locally. But you should not use this mode if PlantUML is running on some server, especially if the server is accessible from Internet.

    • Method Detail

      • values

        public static SecurityProfile[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SecurityProfile c : SecurityProfile.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SecurityProfile valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • longDescription

        public java.lang.String longDescription()
        A Human understandable description.
      • getTimeout

        public long getTimeout()
        Retrieve the timeout for URL.