codice / acdebugger

Purpose-built debugger for determining missing OSGi bundle security permissions
Apache License 2.0
7 stars 10 forks source link

An error occurred while attempting to analyze a security exception #52

Open jrnorth opened 5 years ago

jrnorth commented 5 years ago

Description

AC Debugger: =======================================================================
AC Debugger: AN ERROR OCCURRED WHILE ATTEMPTING TO ANALYZE THE SECURITY EXCEPTION,
AC Debugger: A DOMAIN WE COMPUTED FROM THE STACK (INDEX: 1) CANNOT BE FOUND IN THE
AC Debugger: CURRENT ACCESS CONTROL CONTEXT (STARTING AT INDEX: 1)
AC Debugger: PLEASE REPORT AN ISSUE WITH THE FOLLOWING INFORMATION AND INSTRUCTIONS
AC Debugger: ON HOW TO REPRODUCE IT
AC Debugger: =======================================================================
AC Debugger: PERMISSION:
AC Debugger:     java.io.FilePermission "${ddf.home.perm}http:${/}schemas.opengis.net${/}waterml${/}2.0${/}waterml2.xsd", "read"
AC Debugger: LOCAL 'i' VARIABLE: 0
AC Debugger: CURRENT DOMAIN: spatial-wfs-v1_1_0-source >instance of org.apache.aries.blueprint.container.BlueprintProtectionDomain(id=1156)>
AC Debugger: ACCESS CONTROL CONTEXT:
AC Debugger:   *spatial-wfs-v1_1_0-source <instance of org.apache.aries.blueprint.container.BlueprintProtectionDomain(id=1156)>
AC Debugger: COMPUTED CONTEXT:
AC Debugger:   bundle-0
AC Debugger:   *org.apache.ws.xmlschema.core
AC Debugger:   *spatial-wfs-v1_1_0-source
AC Debugger:   *org.apache.cxf.cxf-rt-frontend-jaxrs
AC Debugger:   *org.apache.cxf.cxf-rt-rs-client
AC Debugger:   *org.apache.aries.blueprint.core
AC Debugger: STACK:
AC Debugger:   at bundle-0(java.security.AccessControlContext:472) <instance of java.security.AccessControlContext(id=1152)>
AC Debugger:   at bundle-0(java.security.AccessController:884) <class of java.security.AccessController>
AC Debugger:   at bundle-0(java.lang.SecurityManager:549) <instance of net.sourceforge.prograde.sm.ProGradeJSM(id=1475)>
AC Debugger:   at bundle-0(java.lang.SecurityManager:888) <instance of net.sourceforge.prograde.sm.ProGradeJSM(id=1475)>
AC Debugger:   at bundle-0(java.io.File:814) <instance of java.io.File(id=1478)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.resolver.DefaultURIResolver:58) <instance of org.codice.ddf.spatial.ogc.wfs.catalog.source.WfsUriResolver(id=1480)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.catalog.source.WfsUriResolver:50) <instance of org.codice.ddf.spatial.ogc.wfs.catalog.source.WfsUriResolver(id=1480)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:684) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1483)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:538) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1483)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:1516) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1483)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:659) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1483)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:157) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1483)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.XmlSchemaCollection:508) <instance of org.apache.ws.commons.schema.XmlSchemaCollection(id=1485)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.XmlSchemaCollection:715) <instance of org.apache.ws.commons.schema.XmlSchemaCollection(id=1485)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:706) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1486)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:732) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1486)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:541) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1486)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:1516) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1486)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:659) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1486)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.SchemaBuilder:157) <instance of org.apache.ws.commons.schema.SchemaBuilder(id=1486)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.XmlSchemaCollection:508) <instance of org.apache.ws.commons.schema.XmlSchemaCollection(id=1485)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.XmlSchemaCollection:715) <instance of org.apache.ws.commons.schema.XmlSchemaCollection(id=1485)>
AC Debugger:   at *org.apache.ws.xmlschema.core(org.apache.ws.commons.schema.XmlSchemaCollection:564) <instance of org.apache.ws.commons.schema.XmlSchemaCollection(id=1485)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.catalog.source.reader.XmlSchemaMessageBodyReader:79) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.reader.XmlSchemaMessageBodyReaderWfs11(id=1487)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.catalog.source.reader.XmlSchemaMessageBodyReader:36) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.reader.XmlSchemaMessageBodyReaderWfs11(id=1487)>
AC Debugger:   at *org.apache.cxf.cxf-rt-frontend-jaxrs(org.apache.cxf.jaxrs.utils.JAXRSUtils:1354) <class of org.apache.cxf.jaxrs.utils.JAXRSUtils>
AC Debugger:   at *org.apache.cxf.cxf-rt-frontend-jaxrs(org.apache.cxf.jaxrs.impl.ResponseImpl:370) <instance of org.apache.cxf.jaxrs.impl.ResponseImpl(id=1491)>
AC Debugger:   at *org.apache.cxf.cxf-rt-rs-client(org.apache.cxf.jaxrs.client.AbstractClient:561) <instance of org.apache.cxf.jaxrs.client.ClientProxyImpl(id=1493)>
AC Debugger:   at *org.apache.cxf.cxf-rt-rs-client(org.apache.cxf.jaxrs.client.ClientProxyImpl:899) <instance of org.apache.cxf.jaxrs.client.ClientProxyImpl(id=1493)>
AC Debugger:   at *org.apache.cxf.cxf-rt-rs-client(org.apache.cxf.jaxrs.client.ClientProxyImpl:786) <instance of org.apache.cxf.jaxrs.client.ClientProxyImpl(id=1493)>
AC Debugger:   at *org.apache.cxf.cxf-rt-rs-client(org.apache.cxf.jaxrs.client.ClientProxyImpl:238) <instance of org.apache.cxf.jaxrs.client.ClientProxyImpl(id=1493)>
AC Debugger:   at bundle-0(com.sun.proxy.$Proxy167.describeFeatureType(org.codice.ddf.spatial.ogc.wfs.v110.catalog.common.DescribeFeatureTypeRequest)+16) <instance of com.sun.proxy.$Proxy167(id=1496)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource:549) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource(id=1497)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource:489) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource(id=1497)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource:114) <class of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource$WfsSourceAvailabilityCommand:1113) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource$WfsSourceAvailabilityCommand(id=1498)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.catalog.common.AvailabilityTask:65) <instance of org.codice.ddf.spatial.ogc.catalog.common.AvailabilityTask(id=1500)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource:432) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource(id=1497)>
AC Debugger:   at *spatial-wfs-v1_1_0-source(org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource:299) <instance of org.codice.ddf.spatial.ogc.wfs.v110.catalog.source.WfsSource(id=1497)>
AC Debugger:   at bundle-0(sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[])+-1) <class of sun.reflect.NativeMethodAccessorImpl>
AC Debugger:   at bundle-0(sun.reflect.NativeMethodAccessorImpl:62) <instance of sun.reflect.NativeMethodAccessorImpl(id=1502)>
AC Debugger:   at bundle-0(sun.reflect.DelegatingMethodAccessorImpl:43) <instance of sun.reflect.DelegatingMethodAccessorImpl(id=1504)>
AC Debugger:   at bundle-0(java.lang.reflect.Method:498) <instance of java.lang.reflect.Method(id=1505)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.utils.ReflectionUtils$1:342) <instance of org.apache.aries.blueprint.utils.ReflectionUtils$1(id=1507)>
AC Debugger:   at bundle-0(java.security.AccessController.doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessControlContext)+-1) <class of java.security.AccessController>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.utils.ReflectionUtils:340) <class of org.apache.aries.blueprint.utils.ReflectionUtils>
AC Debugger:     ----------------------------------------------------------
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BeanRecipe:835) <instance of org.apache.aries.blueprint.container.BeanRecipe(id=1511)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BeanRecipe:591) <instance of org.apache.aries.blueprint.container.BeanRecipe(id=1511)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BeanRecipe:703) <instance of org.apache.aries.blueprint.container.BeanRecipe(id=1511)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BeanRecipe:666) <instance of org.apache.aries.blueprint.container.BeanRecipe(id=1511)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.di.AbstractRecipe:108) <instance of org.apache.aries.blueprint.container.BeanRecipe(id=1511)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BlueprintRepository:360) <instance of org.apache.aries.blueprint.container.BlueprintRepository(id=1515)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BlueprintRepository:338) <instance of org.apache.aries.blueprint.container.BlueprintRepository(id=1515)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BlueprintRepository:152) <instance of org.apache.aries.blueprint.container.BlueprintRepository(id=1515)>
AC Debugger:   at *org.apache.aries.blueprint.core(org.apache.aries.blueprint.container.BlueprintContainerImpl:789) <instance of org.apache.aries.blueprint.container.BlueprintContainerImpl(id=1517)>
AC Debugger:   at *org.apache.aries.blueprint.cm(org.apache.aries.blueprint.compendium.cm.CmManagedServiceFactory:203) <instance of org.apache.aries.blueprint.compendium.cm.CmManagedServiceFactory(id=1519)>
AC Debugger:   at *org.apache.aries.blueprint.cm(org.apache.aries.blueprint.compendium.cm.BaseManagedServiceFactory:139) <instance of org.apache.aries.blueprint.compendium.cm.CmManagedServiceFactory(id=1519)>
AC Debugger:   at *org.apache.aries.blueprint.cm(org.apache.aries.blueprint.compendium.cm.BaseManagedServiceFactory:38) <class of org.apache.aries.blueprint.compendium.cm.BaseManagedServiceFactory>
AC Debugger:   at *org.apache.aries.blueprint.cm(org.apache.aries.blueprint.compendium.cm.BaseManagedServiceFactory$1:88) <instance of org.apache.aries.blueprint.compendium.cm.BaseManagedServiceFactory$1(id=1523)>
AC Debugger:   at bundle-0(java.util.concurrent.Executors$RunnableAdapter:511) <instance of java.util.concurrent.Executors$RunnableAdapter(id=1525)>
AC Debugger:   at bundle-0(java.util.concurrent.FutureTask:266) <instance of java.util.concurrent.FutureTask(id=1527)>
AC Debugger:   at bundle-0(java.util.concurrent.ThreadPoolExecutor:1149) <instance of java.util.concurrent.ThreadPoolExecutor(id=1529)>
AC Debugger:   at bundle-0(java.util.concurrent.ThreadPoolExecutor$Worker:624) <instance of java.util.concurrent.ThreadPoolExecutor$Worker(id=1531)>
AC Debugger:   at bundle-0(java.lang.Thread:748) <instance of java.lang.Thread(name='pool-37-thread-1', id=514)>
AC Debugger: =======================================================================
Exception in thread "pool-1-thread-1" java.lang.InternalError: unable to find a domain computed from the stack in the access control context: org.apache.ws.xmlschema.core
    at org.codice.acdebugger.breakpoints.SecurityCheckInformation.getNextContextDomainIndexNotComputedFromStack(SecurityCheckInformation.java:431)
    at org.codice.acdebugger.breakpoints.SecurityCheckInformation.recomputeFromContext(SecurityCheckInformation.java:455)
    at org.codice.acdebugger.breakpoints.SecurityCheckInformation.recompute(SecurityCheckInformation.java:376)
    at org.codice.acdebugger.breakpoints.SecurityCheckInformation.<init>(SecurityCheckInformation.java:136)
    at org.codice.acdebugger.breakpoints.AccessControlContextCheckProcessor.process(AccessControlContextCheckProcessor.java:117)
    at org.codice.acdebugger.breakpoints.AccessControlContextCheckProcessor.process(AccessControlContextCheckProcessor.java:72)
    at org.codice.acdebugger.impl.BreakpointInfo.process(BreakpointInfo.java:49)
    at org.codice.acdebugger.impl.Debugger$EventSetThread.run(Debugger.java:400)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Steps to Reproduce

  1. Download the standalone Wiremock JAR: http://wiremock.org/docs/download-and-installation/
  2. Run the JAR.
  3. In the directory containing the Wiremock JAR there should now be a __files directory. Drop https://github.com/jrnorth/ddf/blob/4e243c5ceb30d563e485802ccc49367add040f88/catalog/spatial/wfs/spatial-wfs-common/src/test/resources/WFS_Capabilities.xml and https://github.com/jrnorth/ddf/blob/4e243c5ceb30d563e485802ccc49367add040f88/catalog/spatial/wfs/spatial-wfs-common/src/test/resources/AZWellLogs.xsd in that directory.
  4. There should also be a mappings directory. Drop https://github.com/jrnorth/ddf/blob/4e243c5ceb30d563e485802ccc49367add040f88/catalog/spatial/wfs/spatial-wfs-common/src/test/resources/mappings.json in that directory.
  5. Stop Wiremock and start it again.
  6. Start and install DDF.
  7. Run AC Debugger.
  8. Create a WFS 1.1.0 source using the url http://localhost:8080 and enable it.
  9. Verify you see the text from the description in the AC Debugger console.

Expected behavior:

AC Debugger prints possible solutions to the security exception.

Actual behavior:

AC Debugger prints an error message.

Reproduces how often:

100%

Version

1.8-SNAPSHOT