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, ALLOWLIST_EXTRA_PROPERTY, ALLOWLIST_EXTRA_PROPERTY_ALTFields 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 booleanisAllowlistedClassPackageInternal(Class<?> clazz) protected booleanisAllowlistedMethodInternal(Method method) protected booleanisClassPackageRestricted(Class<?> clazz) protected booleanisClassRestricted(Class<?> clazz) protected booleanvoidonPluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event) voidonPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) voidvoidMethods inherited from class com.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
isAllowlistDebugMode, isAllowlistedClassPackageCached, isAllowlistedMethodCached, loadClass, setPluginAllowlist, toMethodStrMethods inherited from class org.apache.velocity.util.introspection.SecureIntrospectorImpl
appendedToClassRelatedLogging, checkObjectExecutePermission, checkObjectExecutePermission, getMethod, getMethod, isAllowlisted, isAllowlistedClass, isAllowlistedInternal, isAllowlistEnabled, isExecutionRestricted, isPackageMatches, isParametersRestricted, isParamsContainPathTraversal, isRestrictedClass, isRestrictedClassPackageCached, isRestrictedClassPackageInternal, loadClassAndLog, resolveArrayClass, toClassSet, toMethodSet, toPackageName, toParsedSet, topLevelChecks, toValidatedClassSetMethods 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:
onPluginFrameworkStartedin 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:
isAllowlistedMethodInternalin classcom.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
-
isClassPackageRestricted
- Overrides:
isClassPackageRestrictedin classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isAllowlistedClassPackageInternal
- Overrides:
isAllowlistedClassPackageInternalin classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isClassRestricted
- Overrides:
isClassRestrictedin classorg.apache.velocity.util.introspection.SecureIntrospectorImpl
-
isIntrospectorEnabled
protected boolean isIntrospectorEnabled()- Overrides:
isIntrospectorEnabledin classcom.atlassian.velocity.allowlist.uberspect.PluginAwareSecureIntrospector
-