docker-misp
docker-misp copied to clipboard
Make every MISP setting customizable by environment variables.
the ngix entrypoint iterates over every suitable misp settings variable and parses the relevant arguments.
This pull quest allows the user to set every MISP config by environment variables. Every environment variable set must start with "M_S_" following by the misp setting. The value of the environment variable is the value set in MISP.
What problem does this solve? What happens if an admin (not the person maintaining the server/roll out) makes a change in the UI? I assume this will over-write any changes?
I think I'd prefer this to be contained in INITIALIZE Env Flag block so it could be used to setup initially, but not force the configs after. The only things we force are things specific to deployment level. Configurations may be done by an application admin, not the deployment person.
Changes will be overwritten. (If an administrator sets them in the first place. You always have the option to ignore this.) But wrapping this into the init block as well is fine with me.
Well there are settings that can be changed by cake starting with MISP already. For example MISP.live=true. That's why I opted with M(isp)S(etting) And then the actual setting name and value.
Well there are settings that can be changed by cake starting with MISP already. For example MISP.live=true. That's why I opted with M(isp)S(etting) And then the actual setting name and value.
In my opinion it is then better to write MISP_
The point is there exists a lot of settings some for modules, some for authentication, some for Redis, mail, etc....
If you have a .env file directly from name it should be clear which application, which location, what exact setting you mentioned here. I like the method of grafana docker environments https://grafana.com/docs/grafana/latest/administration/configuration/#configure-with-environment-variables
If you allow I will make some suggestions this weekend.
kind regards
Hi, my proposal is to have the following: #97 Therefore your code should be modified like:
# iterate over every environment variable starting with "M_S_" and parsing it to key value pair to execute cake setting
for var in $(env | grep MISP_MISP_); do
setting_name="$(echo "$var" | sed "s/^MISP_MISP_//g" | sed "s/=.*$//g")"
setting_value="$(echo "$var" | sed "s/^MISP_MISP_.*=//g")"
$MISP_MISP_CAKE_FILE Admin setSetting "${setting_name}" "${setting_value}"
done
But the environment variables should be added in uppercase so is it possible to modify your code that it convert it to the correct end format?