Wednesday, September 19, 2018

Apache access control via Ldap

Friend,

We have an application (Logsniffer) running And We were looking for some access control on it.

Below are config file for Apache access control via ldap.

root@ip-10-101-2-145:/etc/apache2/sites-enabled# cat logsniffer-ssl.conf
Listen 443
<VirtualHost *:443>
  ServerName logsniffer-cme.atpl.com
  ServerAlias logsniffer-cme.atpl.com
  SSLEngine On
  SSLCertificateFile /etc/apache2/ssl/crt/8b47601b81cb83cf.crt
  SSLCertificateKeyFile /etc/apache2/ssl/key/acceletrade.key
  SSLCertificateChainFile /etc/apache2/ssl/key/gd_bundle-g2-g1.crt

  ProxyRequests     Off
  ProxyPass         /  http://localhost:8082/
  ProxyPassReverse  /  http://localhost:8082/
#  ProxyPassReverse  /  http://www.logsniffer.my.domain/
  <Proxy http://localhost:8082/*>
        Order deny,allow
        Deny from All
        AuthName "Valid Ldap Authorisation for LDap Domain"
        AuthType Basic
        AuthBasicProvider ldap
#        AuthzLDAPAuthoritative on
        AuthLDAPUrl "ldap://132.1.16.104:389/cn=users,cn=accounts,dc=atpl,dc=com?uid"
        Require ldap-group cn=cme,cn=groups,cn=accounts,dc=atpl,dc=com
        Satisfy any
</Proxy>
  ProxyPreserveHost on
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Monday, September 3, 2018

Assign fix netwrk interface name

Hi Friends,

After network hardware or os up-gradation, We normally loose network interface names.

And If you are working in remote location, It become pain to change interfaces settings (ex- ip, rx-tx settings).

Please use below settings to avoid this:-

1) # In /etc/default/grub - ensures eth0/1/2/x like names



GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

2) # MAC address can be read using following command



root@abc:~# ls /sys/class/net/ | xargs -IX sh -c 'echo X $(cat /sys/class/net/X/address)'
eth0 88:d7:f6:d4:be:37
eth1 88:d7:f6:d4:be:36
eth2 64:3f:5f:01:5a:dc
eth3 64:3f:5f:01:5a:dd
eth4 64:3f:5f:01:5a:c8
eth5 64:3f:5f:01:5a:c9
lo 00:00:00:00:00:00

3) Create /etc/udev/rules.d/70-persistent-net.rules !! FIX MAC ADDRESSES LIST !!

# Create /etc/udev/rules.d/70-persistent-net.rules !! FIX MAC ADDRESSES LIST !!
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:4d:54:46:60:49", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:4d:54:46:60:4a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="64:3f:5f:01:2e:d8", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="64:3f:5f:01:2e:d9", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="64:3f:5f:01:2d:af", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="64:3f:5f:01:2d:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"

Renew k8s certificates

Check If certificate expires: amikum@~:03:06:54(⎈ |local-cluster:default):sudo kubeadm certs check-expiration CERTIFICATE                EXP...