Spark SQL security considerations

前端 未结 1 435
抹茶落季
抹茶落季 2020-12-12 02:14

What are the security considerations when accepting and executing arbitrary spark SQL queries?

Imagine the following setup:

Two files on hdfs are registered

相关标签:
1条回答
  • 2020-12-12 02:48

    TL;DR You should never execute any untrusted code on your Spark cluster.

    Are the ways to load new data and register it as tables through pure spark SQL?

    Yes. CREATE TABLE can be executed using sql method so if as long as users have permissions to access filesystem they can create tables.

    Are there ways to register UDFs/execute arbitrary code purely through spark.sql(1)?

    Yes, as long they can control classpath which, can be modified with SQL.

    spark.sql("""add jar URI""")
    

    Do users have access to any sql functions with side effects (that modifies or accesses unathorized data)?

    Effectively yes (by extension of the previous point).

    Can I safely accept arbitrary SQL,

    No.

    0 讨论(0)
提交回复
热议问题