PyTerraBackTyl
PyTerraBackTyl copied to clipboard
Using a relative path for GIT_WORKING_PATH value with 'git' backend module creates unwanted subdirectories, returns 500
Setting GIT_WORKING_PATH to a relative path (e.g. GIT_WORKING_PATH: data) for the git backend module creates unwanted subdirectories and results in PyTerraBackTYL returning a 500 error code during a terraform apply/plan.
General reminder to always test using both relative and full paths.
Workaround:
Use the full path (e.g. /opt/pyterrabacktyl/data)
I was unable to replicate this issue. Further investigation is needed, but it appears that during training, a user was hitting the '/' endpoint without 'env=VALUE' set in the URL which causes the Git backend module to default to the 'master' branch. The apparent symptoms and workaround would have been the result of timing.
If the above is confirmed as the issue:
- ~git_backend.py should raise an exception instead of defaulting to 'master'~
- The function get gets and sets the environment from the URL should raise an exception.
- a new issue should be opened to validate the user-agent string against a user-configurable list of accepted strings.
2019-04-26 22:42:11,948 - werkzeug - ERROR - 192.168.xxx.xxx - - [26/Apr/2019 22:42:11] code 400, message Bad request syntax ('HELP')
An in-house security scanning platform was hitting arbitrary endpoints causing the Git backend to default to the 'master' branch; the above (from Apr. 27th) is confirmed and the fixes in the bulleted list should be made.