Repository navigation
Replies: 1 comment
|
Thanks for bringing this up, @llamafilm! One of the reasons for moving Custom Scripts out of NetBox Core was to reduce the potential attack surface for installations that don't need this functionality. At the same time, we're rebuilding it on a more maintainable foundation. However, Scripts remain a powerful feature intended for trusted Python code. Since they run within the NetBox environment, they can access the database through Django's ORM or even execute SQL directly. While NetBox permissions control who can manage and run Scripts, they don't restrict what the Python code itself can access. Providing a sandboxed Python environment or enforcing per-script database permissions isn't currently a design goal of this plugin. For teams that want non-admin users to develop Scripts, I'd recommend a Git-based workflow with pull request reviews, branch protection, and CI checks. You can then use a NetBox Data Source to synchronize reviewed code into the plugin. By restricting permissions to modify the Data Source, upload Scripts, and manage Project source, you can prevent contributors from bypassing that review process. If you need strict object-level permissions enforced during execution, an external application using the NetBox API with appropriately scoped credentials remains the better approach. |
Uh oh!
There was an error while loading. Please reload this page.
One of the challenges with NetBox scripts today is that there are no permissions controls. So anybody with permission to create/update a script essentially has full read/write access to the entire database. This works fine if scripts are written only by NetBox administrators, but we have an increasing desire for non-admin users to write and maintain scripts. I would love to assign each script an identity and permissions constraints, so each script author can have the freedom to develop with less risk. For example, one script would be allowed to write only devices with a specific role or tag.
The other option that works today, is to use NetBox API instead of scripts, so each script becomes an external "app". Then each caller has a NetBox user identity with permissions constraints. But this requires more work to stand up infrastructure for each app.
Is this one of the design goals of this new netbox-scripts plugin?
All reactions