Monitor asynchronous post processing does not play well with security

Description

The monitoring plugins does some post processing in a fixed size thread pool.
If the resources involved are secured, the following logs pop up in the logs:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Jussila Ville via aruba.it 9:08 AM (14 minutes ago) to Andrea 2018-05-30 08:07:47,649 WARN [geoserver.monitor] - Post process task failed org.springframework.security.authentication.InsufficientAuthenticationException: Cannot access johto as anonymous at org.geoserver.security.SecureCatalogImpl.unauthorizedAccess(SecureCatalogImpl.java:933) at org.geoserver.security.SecureCatalogImpl.buildWrapperPolicy(SecureCatalogImpl.java:910) at org.geoserver.security.SecureCatalogImpl.buildWrapperPolicy(SecureCatalogImpl.java:792) at org.geoserver.security.SecureCatalogImpl.checkAccess(SecureCatalogImpl.java:699) at org.geoserver.security.SecureCatalogImpl.checkAccess(SecureCatalogImpl.java:683) at org.geoserver.security.SecureCatalogImpl.getNamespaceByPrefix(SecureCatalogImpl.java:366) at org.geoserver.catalog.impl.AbstractFilteredCatalog.getNamespaceByPrefix(AbstractFilteredCatalog.java:279) at org.geoserver.catalog.impl.AbstractCatalogDecorator.getNamespaceByPrefix(AbstractCatalogDecorator.java:564) at org.geoserver.monitor.LayerNameNormalizer.run(LayerNameNormalizer.java:53) at org.geoserver.monitor.MonitorFilter$PostProcessTask.run(MonitorFilter.java:252) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Environment

None

Status

Assignee

Fernando Miño

Reporter

Andrea Aime

Triage

Fix versions

Affects versions

2.11.1

Components

Priority

Medium
Configure