Adding Rule after plugin installation

Started by Lord_Pinhead, August 22, 2018, 04:23:55 PM

Previous topic - Next topic
Hi,

i started with Opnsense and need 2 Services for my LAN. So i thought about creating an plugin for them.
The first one is check_mk with (x)inetd and the second is vlmcsd, and KMS Emulator for my lab installations.

So for both of them i need to add Rules to the specified Interfaces to allow certain traffic and i need in the second case an DNS Setting in DNSMasq.

Are there any code examples i could use? Or should i use the API for it, and if yes, i still need an example for it :-)

--
Lord_Pinhead

August 22, 2018, 06:46:41 PM #1 Last Edit: August 22, 2018, 06:49:58 PM by fabian
the package for vlmcsd is very likely not in the repository but you can build it by hand (if your legal department says that it is ok - looks problematic in my opinion), check_mk probably is, inetd may be preinstalled.

If you want to create a plugin, you can find the instructions here: https://docs.opnsense.org/development/examples/helloworld.html

The dnsmasq is not using the new components so you will not get access to it via the API but if you build your own plugin, you can design the API as you like.

I start with the helloworld example and check_mk. But still i need to open a Port on an Interface after the plugin was installed.
Adding the inetd entry is a new Action, that should not be a Problem.

vlmcsd is not a Problem for me, the Firewall is running in my own Office Environment and is for deploying a MS Lab Setup. MS even has a list of VL Keys in the MSDN for that reason.



This will not work after the installation but after a firewall reload: https://github.com/opnsense/plugins/blob/master/net/frr/src/etc/inc/plugins.inc.d/frr.inc#L39

You may trigger a reload after the installation.