payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
19 stars 26 forks source link

Replace `um_env.py` with a yaml file #454

Closed blimlim closed 2 months ago

blimlim commented 3 months ago

During the setup stage, um.py currently sets UM environment variables by sourcing the um_env.py file:

https://github.com/payu-org/payu/blob/8a4a1e2e9171f01e37bd34bfd8bb6f209f550873/payu/models/um.py#L115-L125

Arbitrary code could be included in um_env.py and could lead to security issues. Since um_env.py is only used for setting variable values, it might be best to replace it with a yaml file containing the same information.

blimlim commented 3 months ago

I'll try to also clarify which of the variables in um_env.py are actually being used, e.g it currently contains:

vars = {
'AINITIAL': '',
'ASTART': 'INPUT/pre-industrial.astart', 
...

while 'INPUT/pre-industrial.astart' is not used and isn't included in the vk83 restarts.