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

Allow server settings path to be set via settingsFile query parameter #1040

Merged

Conversation

LukasKalbertodt
Copy link
Member

Fixes #1014

This allows institutions to easily configure Studio for multiple use cases, without specifying super long config values in query parameters directly.

I am still a bit scared that this might introduce a security vulnerability, but I tried things and thought about it and I think: it does not. Most importantly, we make sure that the passed string is only a single file that lives in the same directory as the 'settings.toml' that would have been loaded anyway. This also prevents Studio from loading config files from external sources. Further consider that all values in the config file can be overwritten via specific query parameters anyway! Well, except return.allowedDomains. So this is the only one we care about. But given that an attacker can only chose between all settings files that live in the same directory as 'settings.toml'. So this should be fine, I think. Also note that we cannot just let the query parameter specify arbitrary paths as users can upload videos and attachments to Opencast, so they could inject a settings file that was that is reachable via the same domain.


@fsufrre Can you test this and make sure it works for you and solves your feature request? To do that, you need to checkout this branch, run create-release.sh and replace the contents of the studio.jar in your opencast installation with the contents of the oc-studio*integrated.tar.gz file. If you prefer, I can also do most of that for you and send you the modified jar file. Just ping me via matrix for that.

Fixes elan-ev#1014

This allows institutions to easily configure Studio for multiple use
cases, without specifying super long config values in query parameters
directly.

I am still a bit scared that this might introduce a security
vulnerability, but I tried things and thought about it and I think: it
does not. Most importantly, we make sure that the passed string is only
a single file that lives in the same directory as the 'settings.toml'
that would have been loaded anyway. This also prevents Studio from
loading config files from external sources. Further consider that all
values in the config file can be overwritten via specific query
parameters anyway! Well, except `return.allowedDomains`. So this is the
only one we care about. But given that an attacker can only chose
between all settings files that live in the same directory
as 'settings.toml'. So this should be fine, I think. Also note that we
cannot just let the query parameter specify arbitrary paths as users
can upload videos and attachments to Opencast, so they could inject a
settings file that was that is reachable via the same domain.
Copy link

@wsmirnow wsmirnow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me.

@LukasKalbertodt LukasKalbertodt changed the title Allow server settings path to be set via settingsPath query parameter Allow server settings path to be set via settingsFile query parameter Jul 5, 2023
Copy link
Member

@JulianKniephoff JulianKniephoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little drive by review; just language nitpicks, though. 🤷‍♀️

CONFIGURATION.md Outdated Show resolved Hide resolved
CONFIGURATION.md Outdated Show resolved Hide resolved
CONFIGURATION.md Outdated Show resolved Hide resolved
CONFIGURATION.md Outdated Show resolved Hide resolved
Co-authored-by: Julian Kniephoff <me@juliankniephoff.com>
@LukasKalbertodt LukasKalbertodt merged commit dea7817 into elan-ev:master Jul 13, 2023
2 checks passed
@LukasKalbertodt LukasKalbertodt deleted the config-file-query-param branch July 13, 2023 10:23
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.

add config for using studio within multiple moodle instances
3 participants