Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: relocate classes in com.fasterxml.jackson #46

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Conversation

algomaster99
Copy link
Member

I was running the following command:

java -javaagent:/home/aman/personal/who-are-you/watchdog-agent/target/watchdog-agent-0.7.1-SNAPSHOT.jar=fingerprints=/home/aman/experiments/runtime-integrity/graphhopper/web/target/classfile.sha256.jsonl \
-D"dw.graphhopper.datareader.file=berlin-latest.osm.pbf" \
-jar web/target/graphhopper-web-7.0-SNAPSHOT.jar server config-example.yml

Refer https://github.com/graphhopper/graphhopper/tree/7.0#installation

The agent threw an exception while deserialising the fingerprint. It happened because it used the jackson-databind (version 2.10.5.1) package from the graphhopper. Hence, we need to shade it for our own agent so that there are no version clashes.

@algomaster99 algomaster99 changed the title fix: relocate classes in com.fasterxml.jackson fix: relocate classes in com.fasterxml.jackson Aug 4, 2023
@algomaster99
Copy link
Member Author

algomaster99 commented Aug 4, 2023

Once I fixed it, I found there are a number of classes that maven is unable to discover:

[NOT WHITELISTED]: org/apache/log4j/LogManager
[NOT WHITELISTED]: io/dropwizard/jersey/DropwizardResourceConfig$SpecificBinder9cac4336-b5b4-4c39-abe4-b48aff3be11a
[NOT WHITELISTED]: io/dropwizard/jersey/DropwizardResourceConfig$SpecificBinderc3ac3381-5f23-4da4-a2de-46a84c6dc88b
[NOT WHITELISTED]: com/graphhopper/routing/weighting/custom/JaninoCustomWeightingHelperSubclass2
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2InjectionManagerFactory
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2InjectionManagerFactory$Hk2InjectionManagerStrategy
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2InjectionManagerFactory$Hk2InjectionManagerStrategy$1
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2InjectionManagerFactory$Hk2InjectionManagerStrategy$2
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ImmediateHk2InjectionManager
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/AbstractHk2InjectionManager
[NOT WHITELISTED]: org/jvnet/hk2/external/generator/ServiceLocatorGeneratorImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$1
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$2
[NOT WHITELISTED]: org/jvnet/hk2/internal/DescriptorComparator
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceHandleComparator
[NOT WHITELISTED]: org/jvnet/hk2/internal/PerLocatorUtilities
[NOT WHITELISTED]: org/jvnet/hk2/internal/PerLocatorUtilities$1
[NOT WHITELISTED]: org/jvnet/hk2/internal/PerLocatorUtilities$2
[NOT WHITELISTED]: org/jvnet/hk2/internal/PerLocatorUtilities$3
[NOT WHITELISTED]: org/jvnet/hk2/internal/IndexedListData
[NOT WHITELISTED]: org/jvnet/hk2/internal/SingletonContext
[NOT WHITELISTED]: org/jvnet/hk2/internal/SingletonContext$1
[NOT WHITELISTED]: org/jvnet/hk2/internal/SingletonContext$2
[NOT WHITELISTED]: org/jvnet/hk2/internal/PerLookupContext
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$3
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$4
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$8
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$10
[NOT WHITELISTED]: org/jvnet/hk2/internal/DynamicConfigurationImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities$Interceptors
[NOT WHITELISTED]: org/jvnet/hk2/internal/Creator
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities$1
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities$AnnotationInformation
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities$4
[NOT WHITELISTED]: org/jvnet/hk2/internal/ConstantActiveDescriptor
[NOT WHITELISTED]: org/jvnet/hk2/internal/SystemDescriptor
[NOT WHITELISTED]: org/jvnet/hk2/internal/Closeable
[NOT WHITELISTED]: org/jvnet/hk2/internal/AutoActiveDescriptor
[NOT WHITELISTED]: org/jvnet/hk2/internal/ThreeThirtyResolver
[NOT WHITELISTED]: org/jvnet/hk2/internal/DynamicConfigurationServiceImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/DefaultClassAnalyzer
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorRuntimeImpl
[NOT WHITELISTED]: org/jvnet/hk2/external/runtime/ServiceLocatorRuntimeBean
[NOT WHITELISTED]: org/jvnet/hk2/internal/InstantiationServiceImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/TwoPhaseTransactionDataImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$CheckConfigurationData
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$12
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$5
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceHandleImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/InstanceLifecycleEventImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$6
[NOT WHITELISTED]: org/jvnet/hk2/internal/CacheKey
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$UnqualifiedIndexedFilter
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$IgdCacheKey
[NOT WHITELISTED]: org/jvnet/hk2/internal/ImmediateResults
[NOT WHITELISTED]: org/jvnet/hk2/internal/NarrowResults
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$IgdValue
[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$9
[NOT WHITELISTED]: org/jvnet/hk2/internal/Collector
[NOT WHITELISTED]: org/jvnet/hk2/internal/ClazzCreator
[NOT WHITELISTED]: org/jvnet/hk2/internal/ConstructorAction
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities$3
[NOT WHITELISTED]: org/jvnet/hk2/internal/Utilities$2
[NOT WHITELISTED]: org/jvnet/hk2/internal/SystemInjecteeImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/ClazzCreator$ResolutionInfo
[NOT WHITELISTED]: org/jvnet/hk2/internal/AnnotatedElementAnnotationInfo
[NOT WHITELISTED]: org/jvnet/hk2/internal/SoftAnnotatedElementAnnotationInfo
[NOT WHITELISTED]: org/jvnet/hk2/internal/PopulatorImpl
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2BootstrapBinder
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/JerseyClassAnalyzer$Binder
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/RequestContext$Binder
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl$Binder
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl$Binder$2
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl$Binder$1
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/JerseyErrorService$Binder
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/JerseyClassAnalyzer
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/RequestContext
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/RequestContext$Binder$1
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/JerseyErrorService
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2RequestScope
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl$1
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl$CacheKey
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/ContextInjectionResolverImpl$3
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2Helper
[NOT WHITELISTED]: org/glassfish/jersey/servlet/async/AsyncContextDelegateProviderImpl
[NOT WHITELISTED]: org/glassfish/jersey/servlet/init/FilterUrlMappingsProviderImpl
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/Hk2Helper$1
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/SupplierFactoryBridge
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/InstanceSupplierFactoryBridge
[NOT WHITELISTED]: org/glassfish/jersey/inject/hk2/InjectionResolverWrapper
[NOT WHITELISTED]: org/glassfish/jersey/spidiscovery/internal/MetaInfServicesAutoDiscoverable
[NOT WHITELISTED]: org/glassfish/jersey/spidiscovery/internal/MetaInfServicesAutoDiscoverable$1
[NOT WHITELISTED]: org/jvnet/hk2/internal/IterableProviderImpl
[NOT WHITELISTED]: org/jvnet/hk2/internal/SystemDescriptor$1
[NOT WHITELISTED]: org/jvnet/hk2/internal/FactoryCreator
[NOT WHITELISTED]: org/jvnet/hk2/internal/CacheKey$1

One of them is also from log4j. 😮

Upon shutting down the server, these two classes are loaded:

[NOT WHITELISTED]: org/jvnet/hk2/internal/ServiceLocatorImpl$7
[NOT WHITELISTED]: org/jvnet/hk2/internal/SingletonContext$GenerationComparator

@algomaster99 algomaster99 merged commit 6c06f9b into main Aug 4, 2023
6 checks passed
@algomaster99 algomaster99 deleted the shade-jackson branch August 4, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant