Sync policy git repository with MongoDB policy collection upon policy changes
The policy collection in the MongoDB database should be synchronized with the policy repository in the Git server upon every change in policies.
The idea is to write a script which could be executed both manually and in a CI pipeline. The behavior of the script would be as follows:
- Clone the policy repository and get all policy files with their group;
- Create or Update an entry in MongoDB policy collection for each policy file.
AC:
- The policy collection is synchronized with the GIT repository on every execution of the script