2019-05-21

Selinux disable setting



기본적으로 SELINUX는 활성화 되어 있다. 서버 작업시 SELINUX 로 인해 제한을 받는 경우가 종종 발생하게 
되는데 아래와 같이 SELINUX 를 disabled 로 변경하면 비활성화가 된다. 

SELINUX=disabled

SELIX 설정 파일은 아래와 같다. 
Centos   :   vi  /etc/sysconfig/selinux
Ubuntu  :    vi /etc/selinux/config

   # This file controls the state of SELinux on the system.
   # SELINUX= can take one of these three values:   #     enforcing - SELinux security policy is enforced.   #     permissive - SELinux prints warnings instead of enforcing.   #     disabled - No SELinux policy is loaded.   SELINUX=enforcing        ##   ==>   SELINUX=disabled 로 변경.
   # SELINUXTYPE= can take one of these two values:   #     targeted - Targeted processes are protected,   #     mls - Multi Level Security protection.   SELINUXTYPE=targeted

바로 적용은 되지 않으며 재부팅을 해야 적용이 된다.

재부팅을 하지 않고 현재 접속된 터미널에 한해 변경된 내용을 적용하고 싶을 경우 다음의 명령어를 실행하면 된다. 

/usr/sbin/setenforce 0 

Adding Ubuntu 16.04 LTS Template in XenServer 6.2



Many people have been having a few issues when installing Ubuntu 16.04 LTS or 14.04 LTS template on a XenServer 6.2 since they dont normally see the templates on the installation screen. Hope the following solution will help. Following some research online and trial and error, i found a solution on how to Add Ubuntu 16.04 LTS Template in XenServer 6.2

The firstt thing you need to do is update the  pygrub in Xenserver, to do so edit

 /usr/lib/python2.4/site-packages/grub/GrubConf.py

drop down to line 428, change the following lines


Change

if arg.strip() == "${saved_entry}":
to:
 if arg.strip() == "${saved_entry}" or arg.strip() == "${next_entry}":

Create new templates for Ubuntu

To add Ubuntu 16.04 LTS template on the  XenServer host, you need to type in the following commands.

For Ubuntu 16.04 Template

$ UUID=`xe template-list name-label="Ubuntu Precise Pangolin 12.04 (64-bit)" params=uuid --minimal`
$ NEW_UUID=`xe vm-clone uuid=$UUID new-name-label="Ubuntu Xenial 16.04 (64-bit)"`
$ xe template-param-set other-config:default_template=true other-config:debian-release=xenial uuid=$NEW_UUID

For Ubuntu 14.04 Template

$ UUID=`xe template-list name-label="Ubuntu Precise Pangolin 12.04 (64-bit)" params=uuid --minimal`
$ NEW_UUID=`xe vm-clone uuid=$UUID new-name-label="Ubuntu Trusty 14.04 (64-bit)"`
$ xe template-param-set other-config:default_template=true other-config:debian-release=trusty uuid=$NEW_UUID

Now open XenCenter and right click on XenServer host and click New VM, you should see the template on the list, the rest of the steps are easy, just follow the directions on the screen.

Xen Server Bootoption 설정



1. VM machine uuid 확인.

   $ xe vm-list

     uuid ( RO)           : 79ce516a-d6e2-97bc-ee76-178a50d62691
         name-label ( RW): Name of VMMachine
         power-state ( RO): running


2. VM Machine bootoption 변경. 

  $ xe vm-param-set uuid=79ce516a-d6e2-97bc-ee76-178a50d62691 HVM-boot-policy=BIOS\ order


3. result

before
 


after

장비 Serial Number 확인 방법



Windows Machine Serial Number check



1. Window 

   => wmic bios get SerialNumber

   



Ntopng Install & configuration



NTOPNG                                                              Ntopng는 기존 Ntop에서 업그레이드 된 버전으로 웹 인터페이스를 통하여 관리 메니징이  가능하며, 훨신 깔끔해지고 보기 편한 UI를 제공한다. 또한 CPU와 메모리 사용량을 감소시켜 자원 활용에도 용이하다.


 필자는 가상화에서도 Ntop을 테스트 해 보았는데 무리없이 동작하는 것을 확인하였다. 단 가상화에서의 이슈가 발생하여 물리 서버로 Ntop서버를 설치하였는데.. 가상화 이슈에 대해서는 추후에 포스팅 해 보도록 할 예정이다.

 Ntopng 는 유닉스(Lunux, *BSD, and MacOSX) 및 윈도우(including windows7/8) 플랫폼을 모두 지원한다.

 Ntopng에 대한 자세한 사항은 홈페이지 참조 : http://www.ntop.org/products/ntop/ 


Ntop 설치 방법 

준비 사항 : NTOP 서버 1대(물리서버), 랜포트 2개 이상
  - Management용 1개, 트래픽 모니터링용 1개, 
  - OS : CentOS6.5 64bit

EPEL6 Repositoiry 추가

yum -y install http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

vi 편집기로 ntop.repo 파일 오픈 후 ntop repository 추가

vi /etc/yum.repos.d/ntop.repo

아래의 내용 추가

[ntop]
name=ntop packages
baseurl=http://www.nmon.net/centos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.nmon.net/centos/RPM-GPG-KEY-deri


repository 업데이트 및 ntopng 및 패키지 설치.

yum clean all
yum update
!
yum install pfring n2disk nProbe ntopng ntopng-data


ntopng.start 파일 수정.

vi /etc/ntopng/ntopng.start


모니터링할 IP 대역 설정.

--local-networks "192.168.0.0/24"
--interface 0


ntopng.conf.sample 파일 복사

cp /etc/ntopng/ntopng.conf.sample /etc/ntopng/ntopng.conf

방화벽에 Ntopng Management Port 허용

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT

방화벽 재시작 및 ntopng 시작

service iptables restart
!
service redis start
service ntopng start


설정 완료 후 http://ntopserverIP:3000 으로 접속. 

기본 ID/PW는 admin/admin

2014-06-19

Cisco SSH Connection





Cisco SSH 프로토콜을 이용하여 접속하기.


  Telnet 접속 취약점.

  Cisco 장비를 원격으로 접속할 경우 장비에서는 기본적으로 Telnet 으로 접속이 가능하다.

그러나 Telnet 접속은 Cleartext(평문)로 패킷이 전송이 되기 때문에 중간에 누군가가 악의적인 의도록 패킷을 Sniffing 할 경우 접속 계정 및 비밀번호가 노출되기 쉬어 보안적으로 취약한 점이 있다.

  이러한 보완하기 위해 SSH 프로토콜을 이용하여 암호화된 패킷을 전송하면 보안적으로 좀더 강화된 장비 운용이 가능하다. 


 SSH 프로토록 접속 설정. 

  SSH 프로토콜은 1,2가 있는데 SSH1에 보안 취약점으로 SSH2가 나왔으며, 
  현재는 거의 대부분 SSH2를 사용한다. 
  
  SSH를 지원하지 않거나 SSH1만 지원하는 장비들이 있을 수도 있으니 
  사용하는 장비가 SSH 지원여부를 꼭 확인해야 한다. 

 


  
     ip ssh version 2       //  SSH Version 2로 설정한다.

     
     hostname  {hostname} 
     ip domain-name {domainname} 
     
       // Hostname 및 Domain-name 을 설정한다. 
           SSH를 사용하기 위해서는 반드시 필요한 설정.


     crypto key generate rsa 

      // 암호화 키 생성시 키 값을 지정해 줄수 있으며 default는 512 이다.

    
    

    SSH 프로토콜로만 접속 허용하기. 


    기본적으로 telnet 및 SSH 접속이 가능하도록 원격 접속 세션이 허용되어 있다. 
    그러기 때문에 SSH만 접속 가능하도록 별도의 추가 설정이 필요하다. 

   

    - 기본값으로 transport input all 로 설정이 되어 있으며, SSH 만 접속 가능하도록 
      위와 같이 설정해 준다.


   참고로 show crypto key mypubkey rsa  하면 생성된 키 정보를 확인 할 수 있다. 
   



   마지막으로 copy running-config startup-config(wr)는 필수

  추가적으로 ACL 을 통해 특정 Host 에서만 접속 가능하도록 설정하면 보안적으로  
  보다 더 강화된 운용이 가능하다. 

2014-06-12

Cisco Traffic Storm Control

Traffic Storm Control 이란?


네트워크 상에 과도한 트래픽이 발생하여 네트워크 성능 저하를 유발할 수 있는 상황을 대비하여 트래픽을 제어하여 네트워크 안정화를 유지할 수 있는 기능.
Traffic Storm Control 기능을 활성화 하면 1초 단위로 트래픽을 모니터링하여 설정해 놓은 임계치 값 이상 트래픽이 발생할 경우 트래픽을 차단하고 최소 임계치 설정 값으로 낮춰준다.
또한 해당 인터페이스를 Shutdown 하거나 SNMP Trap으로 로그를 발송할 수도 있다.


1 - Broadcast Suppression














Storm Control 기능은 Default Disable 되어 있으며, 특정 인터페이스에서 해당 기능을 Enable 해 주면 된다.

Enabling Traffic Storm Control


 Router(config)# interface gigabitEthernet 1/0
 Router(config-if)# storm-control broadcast level ?
<0.00 - 100.00>  Enter rising threshold
  bps              Enter suppression level in bits per second
  pps              Enter suppression level in packets per second

    // level 은 퍼센트와 bbs, pps 중 선택해서 설정 할 수 있다.


Router(config-if)# storm-control broadcast level 10 1

  // level {최대 임계치 } {적정 임계치}
     최대 임계치를 넘을 경우 트래픽을 차단하고 적정 임계치로 트래픽을 제어한다.

 Storm-control broadcast Multicast, Unicast 모두 설정이 가능하며, 명령어는 동일하다.

Configuring the Traffic Storm Control action


 shutdown

Router(config-if)# storm-control action shutdown

 // 설정된 임계치 값을 넘을 경우 해당 포트를 차단하는 기능.
    대부분 권장 사항은 아니며, EEM 이나 STP 구성으로 보완적인 운영을 하기도 한다.

SNMP Trap

Router(config-if)# storm-control action trap
Router(config-if)# exit
Router(config)# snmp-server enable traps storm-control trap-rate 0

  // 분당 storm-control trap 전송 값을 지정할 수 있으며, default O 이다.
     0은 제한이 없으며, 트랩이 발생할 때마다 전송하게 된다.


Displaying Traffic Storm Control Settings

 Storm-control 상태 확인 command

Router#show storm-control broadcast

Interface  Filter State   Upper        Lower        Current
   ---------      -------------     -----------     -----------       ----------  
   Gi1/1       Forwarding    10.00%     1.00%        0.00%

Elasticsearch Heap Size

  Elasticsearch는 Java 기반으로 동작을 합니다. Java는 가비시 컬렉터 (garbage-collected)에 의해서 관리가 되며, Java 객체는 힙(Heap) 이라고하는 메모리의 런타임 영역에 상주합니다.  Elasticsear...