Package com.atlassian.velocity
Class JiraAllowlistIntrospector
java.lang.Object
org.apache.velocity.util.introspection.IntrospectorBase
org.apache.velocity.util.introspection.Introspector
org.apache.velocity.util.introspection.SecureIntrospectorImpl
com.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
com.atlassian.velocity.JiraAllowlistIntrospector
- All Implemented Interfaces:
org.apache.velocity.util.introspection.SecureIntrospectorControl
public class JiraAllowlistIntrospector
extends com.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
Extends PluginAwareSecureIntrospector to manage a security allowlist specifically for Atlassian Jira Velocity environment.
This class enhances security by controlling access to methods within the Velocity templates, based on a configured allowlist
in velocity-default.properties.
It listens to the plugin startup events to initialize itself and ensures that only allowed methods can be executed
within the Velocity context, it also registers allowlists from every plugin that is installed in JIRA.
- Since:
- v10.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
-
Field Summary
Fields inherited from class com.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
ALLOWLIST_DEBUG_PROPERTY, ALLOWLIST_DEBUG_PROPERTY_ALT
Fields inherited from class org.apache.velocity.util.introspection.IntrospectorBase
log
-
Constructor Summary
ConstructorsConstructorDescriptionJiraAllowlistIntrospector
(org.apache.velocity.runtime.log.Log log, org.apache.velocity.runtime.RuntimeServices runtimeServices) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isAllowlistedClassPackageInternal
(Class<?> clazz) protected boolean
isAllowlistedMethodInternal
(Method method) protected boolean
isClassPackageRestricted
(Class<?> clazz) protected boolean
isClassRestricted
(Class<?> clazz) protected boolean
void
onPluginEnabled
(com.atlassian.plugin.event.events.PluginEnabledEvent event) void
onPluginFrameworkStarted
(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) void
void
Methods inherited from class com.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
isAllowlistDebugMode, isAllowlistedClassPackageCached, isAllowlistedMethodCached, loadClass, setPluginAllowlist
Methods inherited from class org.apache.velocity.util.introspection.SecureIntrospectorImpl
checkObjectExecutePermission, checkObjectExecutePermission, getMethod, getMethod, isAllowlisted, isAllowlistedClass, isAllowlistedInternal, isAllowlistEnabled, isExecutionRestricted, isPackageMatches, isParametersRestricted, isParamsContainPathTraversal, isRestrictedClass, isRestrictedClassPackageCached, isRestrictedClassPackageInternal, resolveArrayClass, toClassSet, toMethodSet, toMethodStr, toPackageName, toParsedSet, topLevelChecks, toValidatedClassSet
Methods inherited from class org.apache.velocity.util.introspection.IntrospectorBase
getIntrospectorCache
-
Constructor Details
-
JiraAllowlistIntrospector
public JiraAllowlistIntrospector(org.apache.velocity.runtime.log.Log log, org.apache.velocity.runtime.RuntimeServices runtimeServices)
-
-
Method Details
-
onPluginFrameworkStarted
@EventListener public void onPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) - Overrides:
onPluginFrameworkStarted
in classcom.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
-
onPluginEnabled
@EventListener public void onPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event) -
getStatus
-
resetIntrospectorState
public void resetIntrospectorState() -
postInitIntrospectorSetup
public void postInitIntrospectorSetup() -
isAllowlistedMethodInternal
- Overrides:
isAllowlistedMethodInternal
in classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isClassPackageRestricted
- Overrides:
isClassPackageRestricted
in classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isAllowlistedClassPackageInternal
- Overrides:
isAllowlistedClassPackageInternal
in classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isClassRestricted
- Overrides:
isClassRestricted
in classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isIntrospectorEnabled
protected boolean isIntrospectorEnabled()- Overrides:
isIntrospectorEnabled
in classcom.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
-