Event Hooks Setup

Hi

Please find below the setup instructions for enabling Event Hooks and setup a simple event Hook to change SSL for siteworx accounts using SSL (please note all thanks to IW Team where this information has been taken from).

I hope I have made it simple to follow, and please feel free to correct if you find any mistakes.

Please look through the forum for more event hooks which you can use or adapt or if you make any event hooks for your use, it would be lovely if you could share with the forum if possible.

Many thanks

John

Event Hooks
(This plugin allows any custom server script to be executed after any successful interworx action. For example, you could have a script run that notifies you when a new SiteWorx account is created, or when a pointer domain gets deleted, etc. Any ‘input’ from the user that was involved in the action will be available to the shell script as environment variables, prefixed with ‘iw_’. See http://interworx.com/iworx-hooks.conf for a sample hooks configuration file. For even more control, custom plugins can also be written.)

Code:
#!/bin/bash

INSTALLATION:

Please download and save iworx-hooks.conf sample file (http://interworx.com/iworx-hooks.conf for a sample hooks configuration file) and save into /etc/iworx-hooks.conf

 chown iworx /etc/iworx-hooks.conf

First, ensure the InterWorx CLI is installed via ‘yum install interworx-cli’

Install this script at /usr/local/bin/custom_cipher_suite.sh (please see end for file code)

Enable the Event Hooks plugin in NodeWorx - nodeworx, plugins, Event Hooks, enable

Add the following line to your InterWorx Event Hook Configuration:

 Ctrl_Siteworx_Ssl install /usr/local/bin/custom_cipher_suite.sh

Ensure that both this file and the Event Hook config are both readable
and executable by the iworx user:

 chmod 0770 /usr/local/bin/custom_cipher_suite.sh
 chown iworx /usr/local/bin/custom_cipher_suite.sh

In order for this script to run successfully, the iworx user
must be added to the sudoers file. This can be done as follows:

Run ‘visudo’
Append these lines:

 %iworx ALL=(ALL) NOPASSWD:SETENV: /bin/bash -p /usr/local/bin/custom_cipher_suite.sh
 Defaults:%iworx !requiretty

Save and exit visudo

File Code

Save below as custom_cipher_suite.sh and Install this script at /usr/local/bin/custom_cipher_suite.sh

if [[ “$iw_working_domain” == “” ]]; then
exit 1
fi

if [[ “$(id -u)” != “0” ]]; then
self="$( cd “$( dirname “${BASH_SOURCE[0]}” )” && pwd )/$(basename $0)"
sudo -E bash -p $self
exit 0
fi

file="/etc/httpd/conf.d/vhost_$iw_working_domain.conf"

oldcipher=“RC4:HIGH:MEDIUM:!SSLv2:!ADH:!aNULL:!eNULL:!NULL:!LOW”
newcipher="[YOUR CUSTOM CIPHERSUITE HERE]"

sed -i “s/SSLCipherSuite $oldcipher/SSLCipherSuite $newcipher/g” $file

Hi

This post is now redundant if using Interworx-CP 5.1 or higher.
The SSL ciphers are now set from Nodeworx, Server, SSL as shown in pictures here.
Many thanks
John

Hi, thanks bro