gchq / CyberChef

The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis
https://gchq.github.io/CyberChef
Apache License 2.0
28.66k stars 3.22k forks source link

Feature request: Add config file to override `defaultOptions` values #1917

Open hsolberg opened 4 days ago

hsolberg commented 4 days ago

Is your feature request related to a problem? Please describe. Hi! Cyberchef is a very useful tool for contained testing and running regexes locally (running docker on your own laptop for instance). However, when more users in your organization need the same functionality it's better to host it for everyone to use. This creates some challenges when using the default options here -> https://github.com/gchq/CyberChef/blob/master/src/web/index.js#L42-L56

Mainly the updateUrl-option that's turned on (true) by default. This is the "Update the URL when the input or recipe changes" under "Options" in the frontend (see screenshot under "Additional context"). When you're using Cyberchef with sensitive data, that data populates the url and is stored in your browser history. That can lead to some unfortunate situations if you are using Cyberchef in meetings with clients to show them a usecase for instance or just end up being your default suggested auto-completion URL when typing in the address.

Describe the solution you'd like Here's two possible solutions, either one would do the trick

  1. Make defaultOptions configurable by config file. This will force first time Cyberchef-users to get the default values we set in the config. The options-menu in the frontend should still be available for those who want to override this as the preferences they choose will persist between sessions (according to description in the Options-meny). If we don't set anything in the config then use the current default values. (Defaults -> Config file -> User preference)
  2. Add environment variables to override, maybe something like OVERRIDE_DEFAULT_OPTION_UPDATE_URL=false or other intuitive naming scheme that fits. As with the first solution this should still be possible to override on a user session level for those that want to. If we don't specify any environment variables, then use the default values. (Defaults -> Env -> User preference)

Describe alternatives you've considered So far the alternatives seem to be either:

TL;DR -> None of these alternatives are ideal or good solutions in the long run as it's bound to break eventually.

Additional context The options menu in question. image

If anything is unclear then please reach out! 😅