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

Users can configure an allow-list of predicate functions available during queries #979

Closed
refset opened this issue Jun 29, 2020 · 1 comment · Fixed by #1291
Closed

Users can configure an allow-list of predicate functions available during queries #979

refset opened this issue Jun 29, 2020 · 1 comment · Fixed by #1291
Assignees
Labels
Milestone

Comments

@refset
Copy link
Contributor

refset commented Jun 29, 2020

Users should be able to control which core/built-in predicates and "custom" predicates (reachable via fully qualified names) are accessible during queries. This will help to secure the execution of queries that are constructed by untrusted clients. This could be achieved via a new topology option with a set of names for the allowed functions.

  • If a user doesn't specify :fn-allow-list as an arg to the :crux/query-engine component, all functions are allowed
  • :fn-allow-list should contain a set of symbols
    • unqualified symbols should be assumed to be namespaces, all symbols from those namespaces should be allowed
    • qualified symbols should be assumed to be functions
    • strings should be conformed to symbols, for Java folks
  • should through a suitable crux.error error (probably IAE?) if a disallowed function is used in a query
  • queries should be checked at query plan time (so that the check can be cached - we shouldn't need to re-check them at query execution)
  • might be tempting, but clojure.core should not be a blanket exception to the rule - there're functions like spit and slurp which access more than they potentially should. (We could consider a built-in allow-list, or 'allow clojure.core but block some functions', if that's easier, but not a blanket allow)
@danmason
Copy link
Contributor

danmason commented Dec 7, 2020

Need to add some docs for configuring this - convert configuration into a major section, add a file for configuring the query engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants