What is swarm?

docker service ls
In this blog you can find technical matter related to information security. Other than that Linux server configuration, Nginx configuration, high availability techniques etc...

docker service ls
Script should be execute by zabbix user. Default path of the "alertScriptPath is
Download all the scripts from Github. Download Link
SENDER="Zabbix-Alert<zabbix-alert@mycompany.com>"ZBX_URL="https://mycompany.com/zabbix"USERNAME="Admin" # Zabbix UsernamePASSWORD="password" # Zabbix Password
Note: Better to use read only user instead of using admin user.
Add host groups to condition list.
Default Subject:
[{TRIGGER.SEVERITY}] : {TRIGGER.NAME}Default Message:Problem started at {EVENT.TIME} on {EVENT.DATE}Problem name: {TRIGGER.NAME}Host: {HOST.NAME}IP: {HOST.IP}Severity: {TRIGGER.SEVERITY}Original Problem ID: {EVENT.ID}Status: {EVENT.STATUS}Trigger ID: {TRIGGER.ID}Last Value: {ITEM.LASTVALUE}Item ID: {ITEM.ID}Item Graphic: [{ITEM.ID1}]
Default Subject:
[Resolved] : {TRIGGER.NAME}Default Message:Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}Problem name: {TRIGGER.NAME}Host: {HOST.NAME}IP: {HOST.IP}Severity: {TRIGGER.SEVERITY}Original Problem ID: {EVENT.ID}Status: {EVENT.STATUS}Trigger ID: {TRIGGER.ID}Last Value: {ITEM.LASTVALUE}Item ID: {ITEM.ID}Item Graphic: [{ITEM.ID1}]
Default Subject:
[Acknowledged] : {TRIGGER.NAME}Default Message:{USER.FULLNAME} user acknowledged problem at {ACK.DATE} {ACK.TIME} with the following message:{ACK.MESSAGE}Problem name: {TRIGGER.NAME}Host: {HOST.NAME}IP: {HOST.IP}Severity: {TRIGGER.SEVERITY}Status: {EVENT.STATUS}Original Problem ID: {EVENT.ID}Last Value: {ITEM.LASTVALUE}
./build.sh
./configure
make
make install
makemake install
Then execute this command
patch -p0 < /root/rpmbuild/SOURCES/modules/nginx-goodies-nginx-sticky/patches/cookies.patch
You have to put full path when it prompt for File path. You find the path from locate command.
rpmbuild -bb nginx.spec
Note: If you are a beginner, add module by module and build.
- Machine A IP: 192.168.1.170 add below content to /etc/ipsec-tools.conf
#!/usr/sbin/setkey -f
flush;
spdflush;
spdadd 192.168.1.170 192.168.1.171 any -P out ipsec
esp/transport//require;
spdadd 192.168.1.171 192.168.1.170 any -P in ipsec
esp/transport//require;
- Machine B IP: 192.168.1.171 add below content to /etc/ipsec-tools.conf
#!/usr/sbin/setkey -fflush;spdflush;
spdadd 192.168.1.170 192.168.1.171 any -P in ipsecesp/transport//require;spdadd 192.168.1.171 192.168.1.170 any -P out ipsecesp/transport//require;
- To apply the policies restart the “setkey” service in both servers
systemctl restart setkey
- To verify the policies applied correctly you can use below command.
setkey -PD
- Machine A IP: 192.168.1.170 put below content to “raccoon.conf” file. /etc/racoon/racoon.conf
log notify;path pre_shared_key "/etc/racoon/psk.txt";path certificate "/etc/racoon/certs";
remote anonymous {exchange_mode main,aggressive;lifetime time 2 min;proposal {encryption_algorithm aes 256;hash_algorithm sha256;authentication_method pre_shared_key;dh_group modp1024;}generate_policy off;}
sainfo anonymous {lifetime time 2 min;pfs_group 2;encryption_algorithm aes 256;authentication_algorithm hmac_sha256;compression_algorithm deflate;}
- Machine B IP: 192.168.1.171 put below content to “raccoon.conf” file. /etc/racoon/racoon.conf
log notify;path pre_shared_key "/etc/racoon/psk.txt";path certificate "/etc/racoon/certs";
remote anonymous {exchange_mode main,aggressive;lifetime time 2 min;proposal {encryption_algorithm aes 256;hash_algorithm sha256;authentication_method pre_shared_key;dh_group modp1024;}generate_policy off;}sainfo anonymous {lifetime time 2 min;pfs_group 2;encryption_algorithm aes 256;authentication_algorithm hmac_sha256;compression_algorithm deflate;}
- Add below line to /etc/racoon/psk.txt Host A: 192.168.1.170
192.168.1.171 a9993e364706816aba3e
- Add below line to /etc/racoon/psk.txt Host B: 192.168.1.171
192.168.1.170 a9993e364706816aba3e
If the tunnel is configured correctly, when you ping from each host you should be able to ping and can see the traffic go through the tunnel from wiresharq dump.
Host-A 192.168.1.170
#!/usr/sbin/setkey -fflush;spdflush;# Put the ESP SAs in the DBadd 192.168.1.170 192.168.1.171 esp 31031 -E aes-cbc0xdcc6981b0787002abf5dfc28d8b2221063b949316b35c51a7bdb65753e369c66;add 192.168.1.171 192.168.1.170 esp 43241 -E aes-cbc0x3a9fc0f3d7081ae4f4184250b658f69c0d5b220367a160b8592871d2eeef1523;# AH SAs In the DBadd 192.168.1.170 192.168.1.171 ah 33362 -A hmac-sha2560xf93c4f2b0034dd236e77d9aca68014d09dd7c2ef0571d7831082617b1b560324;add 192.168.1.171 192.168.1.170 ah 30759 -A hmac-sha2560xd3e451082bb8837e88f238c153f16664bc0b33542515d6d8d4b79050e06662c8;spdadd 192.168.1.170 192.168.1.171 any -P out ipsecesp/transport//requireah/transport//require;spdadd 192.168.1.171 192.168.1.170 any -P in ipsecesp/transport//requireah/transport//require;
Host-B 192.168.1.171
#!/usr/sbin/setkey -fflush;spdflush;# Put the ESP SAs in the DBadd 192.168.1.170 192.168.1.171 esp 31031 -E aes-cbc0xdcc6981b0787002abf5dfc28d8b2221063b949316b35c51a7bdb65753e369c66;add 192.168.1.171 192.168.1.170 esp 43241 -E aes-cbc0x3a9fc0f3d7081ae4f4184250b658f69c0d5b220367a160b8592871d2eeef1523;# AH SAs In the DBadd 192.168.1.170 192.168.1.171 ah 33362 -A hmac-sha2560xf93c4f2b0034dd236e77d9aca68014d09dd7c2ef0571d7831082617b1b560324;add 192.168.1.171 192.168.1.170 ah 30759 -A hmac-sha2560xd3e451082bb8837e88f238c153f16664bc0b33542515d6d8d4b79050e06662c8;spdadd 192.168.1.170 192.168.1.171 any -P in ipsecesp/transport//requireah/transport//require;spdadd 192.168.1.171 192.168.1.170 any -P out ipsecesp/transport//requireah/transport//require;
systemctl restart setkey