access-manager
access-manager copied to clipboard
Possibility to automate the creation of Authorization Rules
In our environment constantly new servers are deployed. It would be nice to have a possibility to automate the creation of new authorization rules. Also for the initial creation of a lot of rules it would be good to either automate this or to create it them out of a CSV. The currently build in CSV import doesn't match our needs but we can easily create a CSV with powershell and import this into Access Manager
@hschoerg thanks for the feedback. I agree this would be a good idea. I'll add it to the backlog for consideration for a future release.
In the mean time, you can automate to some degree, by modifying the appsettings.json file in the application config folder using PowerShell or other scripting tool of your choice. This is a standard JSON file format, and you can edit authorization rules directly in the file if you choose to do so. The way to do it would be to create a 'template' first, by creating an authorization rule in the UI, and use that as the base for new rules.
Just ensure that you don't edit the file while the UI is open. The next save operation in the UI will overwrite your changes.
@ryannewington
I had a similar topic here https://github.com/lithnet/access-manager/discussions/116 Your suggestion of modifying the appsettings.json file is a suitable workaround. However, each Authorization rule in has its own ID. If I wanted to create new rules by modifying the appsettings.json file directly, how would I generate this ID?
Thank you.
@sniper9191 as long as it's unique and it's a guid you can use any value. New-Guid in PowerShell will do the trick
This is available natively in the Ams V2 PowerShell module