Friday, February 14, 2020

Microsoft Ignite 2020

Tuesday, December 31, 2019

QBE CIO Award 2019

All the hard work is paid for ... QBE Cyber Security team has been recognized for exceptional performance!! 

Friday, May 17, 2019

GoDaddy DNS Update Using API

I recently need to update my DNS entry which is hosted in GoDaddy. GoDaddy supports API call to update DNS entries, which is amazing!!

You need to generate the API key and secret.

create the file below and cronjob it!



headers="Authorization: sso-key $key:$secret"
echo "Headers = " $headers

result=$(curl -X GET -H "$headers" "$domain/records/$type/$name")
echo "Result = " $result

dnsIP=$(echo $result | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")
echo "DNS IP = " $dnsIP

ret=$(curl -s GET "")
currentIP=$(echo $ret | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")
echo "Current IP = " $currentIP

if [ $dnsIP != $currentIP ];
        echo "IP's are not equal, updating record"
        curl -X PUT "$domain/records/$type/$name" \
                -H "accept: application/json" \
                -H "Content-Type: application/json" \
                -H "$headers" \
                -d "[ { \"data\": \"$currentIP\", \"port\": $port, \"priority\": 0, \"protocol\": \"string\", \"service\": \"string\", \"ttl\": $ttl, \"weight\": $weight } ]"

if [ $dnsIP = $currentIP ];
        echo "IP's are equal, no update required"

Saturday, April 13, 2019

Ubuntu 18.04 + Docker Setup

I am setting up a new Docker Engine running on Ubuntu 18.04
During the Ubuntu installation, I selected Docker Engine as part of the deployment setup. By default the Docker Engine Service is run by Snap.

My environment uses web proxy to hit the Internet and internal DNS servers only are allowed. Docker Daemon or Docker Containers must use web proxy and internal DNS to hit the Internet.

To setup Ubuntu with static IP, pointing to the right DNS, netplan must be created
create a YAML file in the /etc/netplan/

> sudo vi /etc/netplan/99-local-init.yaml

version: 2
renderer: networkd
search: [domainlocal.tld]
addresses: [, 10.0.03]

ps: addresses: [,] are the local DNS servers

To get Docker Engine to use web proxy and local DNS servers, Drop-In configuration files must be created. Check the Docker Engine service name under /etc/systemd/system/ folder. My Ubuntu 18.04 installation has got snap.docker.dockerd.service name

Create a folder with the same name of the service name and add ".d" at the end of the folder name

> sudo mkdir -p /etc/systemd/system/snap.docker.dockerd.service.d 

Then you can create as many as .conf files in that folder

To create web proxy configuration

> sudo vi /etc/systemd/system/snap.docker.dockerd.service.d/proxy.conf

Environment="HTTP_PROXY=http://myproxy.domainlocal.tld:8080/" "HTTPS_PROXY=http://myproxy.domainlocal.tld:8080/" "NO_PROXY=localhost,*.domainlocal.tld"

To create DNS setting

> sudo vi /etc/systemd/system/snap.docker.dockerd.service.d/dns.conf

ExecStart=/usr/bin/snap run docker.dockerd --dns --dns --dns-search domainlocal.tld

ps: ExecStart= must be defined in the first line to reset that flag

The daemon must be restarted

> sudo systemtcl daemon-reload
> sudo systemctl restart snap.docker.dockerd

To build / run process within the Docker Container, pass the flags:

> sudo docker build --build-arg http_proxy=http://myproxy.domainlocal.tld:8080 --build-arg https_proxy=http://myproxy.domainlocal.tld:8080 -t dockerhubname/imangename .

Have fun!

Tuesday, March 12, 2019

Docker Copy Files

When building a Docker image using the Dockerfile, if you need to copy some files from the Docker Engine machine to the Docker Image, you need to use the "correct" source path where the files are located.

Let's say you have the following files:


you can't specify the following command within your Dockerfile

COPY /mydocker/ /etc/
COPY /mydocker/ /etc/

instead, you need to do the following

mkdir /mydocker/resources
mv /mydocker/ /mydocker/resources
mv /mydocker/ /mydocker/resources

then, in your Dockerfile, specify the following COPY command

COPY resources /etc/