Re: UDF: adding custom jar to classpath

2022-04-06 Thread Sébastien Rebecchi
. > > > > *From: *Sébastien Rebecchi > *Date: *Wednesday, 6 April 2022 at 15:15 > *To: *dev@cassandra.apache.org , > e.dimitr...@gmail.com > *Cc: *ble...@apache.org > *Subject: *Re: UDF: adding custom jar to classpath > > Hi Ekaterina, > > > > I use 4.0.1. >

Re: UDF: adding custom jar to classpath

2022-04-06 Thread bened...@apache.org
...@gmail.com Cc: ble...@apache.org Subject: Re: UDF: adding custom jar to classpath Hi Ekaterina, I use 4.0.1. But as I said I added a jar in classpath (/usr/share/cassandra/lib/ folder on every node) and I see that the jar is loaded in the classpath from the Cassandra command line. And I have

Re: UDF: adding custom jar to classpath

2022-04-06 Thread Sébastien Rebecchi
Hi Ekaterina, I use 4.0.1. But as I said I added a jar in classpath (/usr/share/cassandra/lib/ folder on every node) and I see that the jar is loaded in the classpath from the Cassandra command line. And I have "enable_user_defined_functions: true" and "enable_user_defined_functions_threads: false

Re: UDF: adding custom jar to classpath

2022-04-06 Thread Ekaterina Dimitrova
Hi Sebastian, Do you use the latest 4.0.3 version? Those options were added in 4.0.2 I believe, so if you try them with an earlier version - below message is what you would get as they didn’t exist. Best regards, Ekaterina On Wed, 6 Apr 2022 at 9:53, Sébastien Rebecchi wrote: > Hi Benjamin, Hi

Re: UDF: adding custom jar to classpath

2022-04-06 Thread Sébastien Rebecchi
Sorry, I found that allow_insecure_udfs and allow_extra_insecure_udfs have been introduced in 4.0.2 but I run 4.0.1, so that explains the error. So for 4.0.1 "enable_user_defined_functions_threads: false" should be enough, no advance on that I still don't know why my UDF does not compile then Le m

Re: UDF: adding custom jar to classpath

2022-04-06 Thread Sébastien Rebecchi
Hi Benjamin, Hi everybody, I found in the documentation that we should add "allow_insecure_udfs: true" and optionally "allow_extra_insecure_udfs: true" so that "enable_user_defined_functions_threads: false" is really taken into account (I understood like that). That would explain why my UDF still

Re: UDF: adding custom jar to classpath

2022-04-05 Thread Benjamin Lerer
Unfortunately, I do not have much time for doing some digging. Sorry for that :-( You should look at JavaBasedUDFunction and UDFExecutorServic. Le lun. 4 avr. 2022 à 17:25, Sébastien Rebecchi a écrit : > Hi! > Do you have any more ideas for me? > Cordially, > Sébastien. > > Le lun. 28 mars 2022

Re: UDF: adding custom jar to classpath

2022-04-04 Thread Sébastien Rebecchi
Hi! Do you have any more ideas for me? Cordially, Sébastien. Le lun. 28 mars 2022 à 16:39, Sébastien Rebecchi a écrit : > Unfortunately, it is not working even with > "enable_user_defined_functions_threads: false" in cassandra.yaml :/ > Is there any way to check the running configuration? > > Le

Re: UDF: adding custom jar to classpath

2022-03-28 Thread Sébastien Rebecchi
Unfortunately, it is not working even with "enable_user_defined_functions_threads: false" in cassandra.yaml :/ Is there any way to check the running configuration? Le lun. 28 mars 2022 à 15:35, Benjamin Lerer a écrit : > I do not think that allowing to customize UDF classes whitelist has been >

Re: UDF: adding custom jar to classpath

2022-03-28 Thread Benjamin Lerer
I do not think that allowing to customize UDF classes whitelist has been discussed before. Feel free to open a JIRA ticket :-) I have some plans to revisit how we securise UDFs as the current threading approach has some impact in terms of latency. That can be a good opportunity to look into providi

Re: UDF: adding custom jar to classpath

2022-03-28 Thread Sébastien Rebecchi
Thanks you very much! I will try that. As you know, would it be a long-terms solution? Or is there any plan to add the possibility to customize UDF classes whitelist? Le lun. 28 mars 2022 à 14:31, Benjamin Lerer a écrit : > Is there a way to customize that default behaviour? > > > Looking at Jav

Re: UDF: adding custom jar to classpath

2022-03-28 Thread Benjamin Lerer
> > Is there a way to customize that default behaviour? Looking at JavaBasedUDFunction quickly it seems that the ClassLoader is only used when you use the UDFExecutorService to execute your UDFs. You can try to disable it using "enable_user_defined_functions_threads: false" and see if it works. N

Re: UDF: adding custom jar to classpath

2022-03-28 Thread Sébastien Rebecchi
Hi Benjamin, Thanks for the answer. Is there a way to customize that default behaviour? If no, could you indicate where to find this class loader in the github of Cassandra please? Le lun. 28 mars 2022 à 12:40, Benjamin Lerer a écrit : > Hi Sébastien, > > Cassandra uses a special classloader fo

Re: UDF: adding custom jar to classpath

2022-03-28 Thread Benjamin Lerer
Hi Sébastien, Cassandra uses a special classloader for UDFs that limit which classes can be used. You cannot rely on non-JDK classes for UDFs and some of the JDK packages like the IO package for example cannot be used. The goal is simply to ensure that UDFs cannot compromise the server security.

UDF: adding custom jar to classpath

2022-03-28 Thread Sébastien Rebecchi
Hello, I am trying to create a UDF based on custom methods. So I set enable_user_defined_functions to true and added a jar in "/usr/share/cassandra/lib/" folder on every node, restarted the nodes and I can see from the command line that the jar is indeed used (in the classpath with -cp). But when