2017년 12월 5일 화요일

LDAP 속성등

acount

LDAP 構文属性タイプオブジェクト ID
Audio Binary 1.3.6.1.4.1.1466.115.121.1.4 
Binary Binary 1.3.6.1.4.1.1466.115.121.1.5 
Boolean Boolean 1.3.6.1.4.1.1466.115.121.1.7 
Country String String 1.3.6.1.4.1.1466.115.121.1.11 
DN String 1.3.6.1.4.1.1466.115.121.1.12 
Directory String String 1.3.6.1.4.1.1466.115.121.1.15 
Generalized Time String 1.3.6.1.4.1.1466.115.121.1.24 
IA5 String String 1.3.6.1.4.1.1466.115.121.1.26 
Integer Int 1.3.6.1.4.1.1466.115.121.1.27 
Postal Address String 1.3.6.1.4.1.1466.115.121.1.41 
Printable String String 1.3.6.1.4.1.1466.115.121.1.44 
Telephone Number String 1.3.6.1.4.1.1466.115.121.1.50 

default account

アイデンティティーシステム 属性  リソースユーザー属性  LDAP 構文  説明  
accountIduidDirectory string User ID 
accountIdcnDirectory string 必須。ユーザーのフルネーム。 
firstnamegivennameDirectory string ユーザーの名。 
lastnamesnDirectory string 必須。ユーザーの姓。 
modifyTimeStampmodifyTimeStampGeneralized time ユーザーエントリが変更された日時を示します。 
passworduserPasswordOctet string 暗号化された値。ユーザーのパスワード。 



group
アイデンティティーシステム 属性  リソースユーザー属性  LDAP 構文  説明  
user defined ldapGroupsldapGroupsLDAP ユーザーがメンバーになっているグループの識別名のリスト。
リソース属性である「グループメンバー属性」では、ユーザーの識別名を含むように更新される LDAP グループエントリの属性を指定します。「グループメンバー属性」のデフォルト値は、uniquemember です。
user defined posixGroupsなし LDAP ユーザーがメンバーになっている posixGroups エントリの識別名のリスト。
アカウントに Posix グループのメンバーシップを割り当てるには、そのアカウントが uid LDAP 属性の値を持っている必要があります。posix

person
アイデンティティーシステム 属性  リソースユーザー属性  LDAP 構文  説明  
descriptionDirectory stringString ユーザーの特定の関心事についての簡潔でわかりやすい説明 
seeAlsoDNString ほかのユーザーへの参照 
telephoneNumberTelephone numberString 第一電話番号 

Organizationalperson
リソースユーザー属性  LDAP 構文  属性タイプ  説明  
destinationIndicatorPrintable string String この属性は、電報サービスに使用されます。 
facsimileTelephoneNumberFacsimile telephone number String 第一 FAX 番号。 
internationaliSDNNumberNumeric string String オブジェクトに関連付けられた国際 ISDN 番号を指定します。 
lDirectory string String 都市、国、その他の地理的領域などの地域の名前 
ouDirectory string String 組織単位の名前 
physicalDeliveryOfficeNameDirectory string String 配達物の送付先となるオフィス。 
postalAddressPostal address String ユーザーの勤務先オフィスの所在地。 
postalCodeDirectory string String 郵便配達用の郵便番号。 
postOfficeBoxDirectory string String このオブジェクトの私書箱番号。 
preferredDeliveryMethodDelivery method String 受取人への優先される送付方法 
registeredAddressPostal Address String 受信者に配達を受け入れてもらう必要がある電報や速達文書の受け取りに適した郵便の宛先。 
stDirectory string String 州名または都道府県名。 
streetDirectory string String 郵便の宛先の番地部分。 
teletexTerminalIdentifierTeletex Terminal Identifier String オブジェクトに関連付けられたテレテックス端末の識別子 
telexNumberTelex Number String 国際表記法によるテレックス番号 
titleDirectory string String ユーザーの役職を格納します。このプロパティーは、一般に、プログラマーのような職種ではなく、「シニアプログラマー」のような正式な役職を示すために使用されます。通常、Esq. や DDS などの敬称には使用されません。 
x121AddressNumeric string String オブジェクトの X.121 アドレス。 

inetOrgPerson 


アイデンティティーシステム 属性  リソースユーザー属性  LDAP 構文  説明  
audioAudio Binary オーディオファイル。 
businessCategoryDirectory string String 組織で実施されているビジネスの種類。 
carLicenseDirectory string String 自動車の登録番号 (ナンバープレート) 
departmentNumberDirectory string String 組織内の部署を特定します 
displayNameDirectory string String エントリを表示するときに優先的に使用されるユーザーの名前 
employeeNumberDirectory string String 組織内の従業員を数値で示します 
employeeTypeDirectory string String 従業員、契約社員などの雇用形態 
homePhoneTelephone number String ユーザーの自宅電話番号。 
homePostalAddressPostal address String ユーザーの自宅住所。 
initialsDirectory string String ユーザーのフルネームの各部のイニシャル。 
jpegPhotoJPEG Binary JPEG 形式のイメージ。 
labeledURIDirectory string String ユーザーに関連付けられた URI (Universal Resource Indicator) とオプションのラベル。 
mailIA5 string String 1 つ以上の電子メールアドレス。 
managerDN String ユーザーのマネージャーのディレクトリ名。 
mobileTelephone number String ユーザーの携帯電話番号。 
oDirectory string String 組織の名前。 
pagerTelephone number String ユーザーのポケットベル番号。 
preferredLanguageDirectory string String 優先される、ユーザーの書き言葉または話し言葉の言語。 
roomNumberDirectory string String ユーザーのオフィスまたは部屋の番号。 
secretaryDN String ユーザーの管理補佐のディレクトリ名。 
userCertificatecertificate Binary バイナリ形式の証明書。




entry

속성 이름값 유형원래의 이름
c국가Country
cn일반 명, 인명Common Name
dc도메인 이름Domain Component
o단체명The Organization
ObjectClass스키마-
ou부서명Organization Unit
snSumame
st도도부 현State
uid사용자 IDUser ID


objectClass

이름필수 속성
dcObjectdc
organizationo
organizationalRolecn
organizationalUnitou
accountuid
simpleSecurityObjectuserPassword
inetOrgPersoncn, sn
posixAccountuid (account 등 구조적 객체 클래스와 함께 사용할 필요)
posixGroupcn

schema

번호파일 설명 
corba RFC2714에 정의 된 CORBA 오브젝트를 처리하기 위해 사용하는 스키마 
core OpenLDAP Core 스키마 (필수) 
cosine COSINE와 Internet X.500 스키마 (필수) 
duaconf LDAP 기반 Directory User Agent (DUA) 설정을위한 스키마 
dyngroup Netscape 사가 정의한 그룹의 스키마 URL을 사용한 동적 그룹 생성을위한 속성이 정의되어있는 
inetorgperson 조직에 관련된 사람을 나타내는 개체 클래스 inetOrgPerson을 정의하는 스키마 
java RFC2713에서 정의 된 Java 오브젝트를 처리하기 위해 사용하는 스키마 
misc 발전 중의 객체 클래스를 정의하는 스키마 제품의 사용은 권장되지 않는다 
nis UNIX 계정 등을 처리하기 위해 사용하는 스키마 posixAccount와 posixGroup는이 파일에 정의되어있는 
openldap OpenLDAP 프로젝트의 스키마 정보 제공 용으로 사용되는 
10 ppolicy 암호 정책에 대한 스키마 
11 collective RFC3671에 정의되어있는 여러 항목에서 공유하는 속성에 대한 스키마 

2017년 8월 31일 목요일

rabbit cluster

vagrant 
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "ubuntu/xenial64"
   # config.vm.host_name = 'web'
  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  #config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "192.168.50.4"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  
  config.vm.define "n1" do |n1|
      n1.vm.hostname = "n1"
      n1.vm.network "private_network", ip: "192.168.50.4"
  end

  config.vm.define "n2" do |n2|
      n2.vm.hostname = "n2"
      n2.vm.network "private_network", ip: "192.168.50.5"
  end
  
  config.vm.define "n3" do |n3|
      n3.vm.hostname = "n3"
      n3.vm.network "private_network", ip: "192.168.50.6"
  end
  
  config.vm.define "haproxy" do |haproxy|
      haproxy.vm.hostname = "haproxy"
      haproxy.vm.network "private_network", ip: "192.168.50.3"
  end
 # config.vm.network "private_network", ip: "192.168.50.4"
  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL

end


서버 1
    1  ifconfig
    2  exit
    3  sudo su
    4  exit
    5  sudo apt-get install rabbitmq-server
    6  sudo rabbitmq-plugins enable rabbitmq_management
    7  sudo service rabbitmq-server restart
    8  sudo rabbitmqctl add_user rabbitmq password
    9  sudo rabbitmqctl set_user_tags rabbitmq administrator
   10  sudo rabbitmqctl cluster_status
   11  rabbitmqctl stop
   12  rabbitmqctl stop_app
   13  ps -aux | grep rabbit
   14  rabbitmq-server -detached
   15  sudo rabbitmq-server -detached
   16  exit
   17  ping 192.168.50.6
   18  ping 192.168.50.5
   19  rabbitmq-server -detached
   20  sudo rabbitmq-server -detached
   21  sudo rabbitmqctl status
   22  cd /var/lib/rabbitmq/
   23  ll
   24  vi .erlang.cookie
   25  sudo vi .erlang.cookie
   26  sudo vi /etc/hosts
   27  sudo vi .erlang.cookie
   28  history
   29  sudo rabbitmqctl cluster_status
   30  sudo apt-get -y install htop


서버 2

 1  sudo su
    2  exit
    3  sudo apt-get install rabbitmq-server
    4  rabbitmq-plugins enable rabbitmq_management
    5  sudo rabbitmq-plugins enable rabbitmq_management
    6  sudo service rabbitmq-server restart
    7  sudo rabbitmqctl add_user rabbitmq password
    8  sudo rabbitmqctl set_user_tags rabbitmq administrator
    9  sudo rabbitmqctl cluster_status
   10  history
   11  sudo rabbitmq-server -detached
   12  sudo rabbitmqctl stop_app
   13  sudo rabbitmqctl join_cluster rabbit@n1
   14  ping n1
   15  ping 192.168.50.4
   16  ping 192.168.50.6
   17  ping 192.168.50.4
   18  sudo rabbitmqctl join_cluster rabbit@n1
   19  ping n1
   20  vi /etc/host
   21  cd /var/lib/rabbitmq/
   22  ll
   23  sudo vi .erlang.cookie
   24  sudo vi /etc/hosts
   25  ping n2
   26  ping n1
   27  sudo rabbitmqctl join_cluster rabbit@n1
   28  sudo rabbitmq-server -detached
   29  sudo rabbitmqctl join_cluster rabbit@n1
   30  ls
   31  ll
   32  sudo vi .erlang.cookie
   33  rabbitmqctl status
   34  sudo rabbitmqctl status
   35  sudo vi /etc/hosts
   36  sudo rabbitmqctl join_cluster rabbit@n1
   37  sudo rabbitmqctl cluster_status
   38  sudo rabbitmq-server -detached
   39  sudo rabbitmqctl cluster_status
   40  ls
   41  ll
   42  rm -rf .erlang.cookie
   43  sudo rm -rf .erlang.cookie
   44  sudo rabbitmq-server -detached
   45  sudo rabbitmqctl cluster_status
   46  sudo /etc/hosts
   47  sudo vi /etc/hosts
   48  sudo rabbitmqctl cluster_status
   49  sudo rabbitmq-server -detached
   50  sudo rabbitmq-server stop_app
   51  sudo rabbitmq-server stop
   52  sudo rabbitmqctl status
   53  l
   54  ll
   55  sudo vi .erlang.cookie
   56  sudo vi /etc/hosts
   57  sudo rabbitmq-server stop_app
   58  sudo rabbitmq-server -detached
   59  sudo rabbitmqctl cluster_status
   60  sudo rabbitmqctl join_cluster rabbit@n1
   61  ps -aux | grep rabbi
   62  sudo rabbitmq-server stop
   63  ps -aux | grep rabbi
   64  sudo rabbitmqctl shutdown
   65  sudo rabbitmq-server stop_app
   66  sudo rabbitmqctl stop_app


2017년 7월 24일 월요일

로그 분석


cat coap.log | awk '{print $2}' | uniq -c




ip별 통계

  • grep "날짜" 로그파일명 | awk '{print $1}' | sort | uniq -c | sort -rn
    • 예) grep "18/Dec/2016" /var/log/httpd/access_log | awk '{print $1}' | sort | uniq -c | sort -rn

시간별 

  • grep "날짜" 로그파일명 | awk '{print $4}' | cut -b 2-15 | sort | uniq -c | sort -rn
    • 예) grep "18/Dec/2016" /var/log/httpd/access_log | awk '{print $4}' | cut -b 2-15 | sort | uniq -c

접속url 

  • grep "날짜" 로그파일명 | awk '{print $7}' | sort | uniq -c | sort -rn
    • 예) grep "18/Dec/2016" /var/log/httpd/access_log | awk '{print $7}' | sort | uniq -c | sort -rn

실시간 집계

    • netstat -pantu | grep -e ':80' -e ':443' | awk '{print $6}' | sort | uniq -c

2017년 6월 19일 월요일

tls/dtls handshake


server                                                              client




helloRequest           ----------------->                   ClientHandshaker
                                                                     starthandshake
                                                                     ProtocolVersion
                                                                     clientRandom,                                                                                                  supportedClientCertificateTypes
                                                                     supportedServerCertificateTypes
                                                                     CompressionMethod
                                                                     clientHello
                    <------------------------------------     sendFlight(flight);


receivedClientHello
starthandshake  
negotiateProtocolVersion
서버 와 클라이언트 난수
세션생성후 세션 설정
세션에 압축 협상후 설정
클라이언트에서 제안한 암호화 선택
후 세션에 저장
세션에 데이터 조각 크기 지정

먼저 ServerHello (필수).
// 1) ServerHello                                                      receivedServerHello
ServerHello        -------------------------------------------> usedProtocol =                                                                                            message.getServerVersion();                                        serverRandom = message.getRandom();
                            session.setSessionIdentifier(message.getSessionId());
                            session.setCipherSuite(message.getCipherSuite());                             session.setCompressionMethod(                                                                           setSendRawPublicKey
                                            setReceiveRawPublicKey
                                                                                                       
                                                                                                           
                                                                                                           


// 2) CertificateMessage  -------------------------------> CertificateMessage
                                                                            receivedServerCertificate
Second, send Certificate
 (if required by key exchange algorithm)                                   검증                        

// 3) Server Key Exchange ------------------------------    receivedServerKeyExchange

                       message.verifySignature(serverPublicKey, clientRandom, serverRandom);
            The ServerKeyExchange message is sent by the server only when the server
CertificateMessage(if sent) does not contain enough data to
allow the client to exchange a premaster secret. Used when the key
  exchange is ECDH. The client tries to verify the server's signature and
 on success prepares the ECDH key agreement.                                                               
// 4) Certificate Request(옵션)------------------------------>







// 5) Server Hello Done(필수)                <    -->              receivedServerHelloDone  


                                               First, if required by server, send Certificate.                                                            Second, send ClientKeyExchange as specified by the                                          
                                               Third, send CertificateVerify message if necessary.
                                               Fourth, send ChangeCipherSpec
                                               Fifth, send the finished message.                                                                                                        
                                                                                                             
                                                                                                             
                                                                                                             

                                                                                                                                                                                                                           
                                                                                                             

                                                                                                             

                                                                                                             

                                                                                                             
                                                                                                             








                            





























































2017년 6월 7일 수요일

TLS 개요


TLS 개요

구성품
PKI
X509 증명서
난수 생성
대칭암호
디지털서명
키교환
공개키 암호
메세지 인증
일방향해쉬
암호모드

난수 생성
공개키 암호 키교환 대칭암호 암호모드

공개키 암호 디지털서명 x509 증명 PKI
일방향 해쉬 메세지 인증


TLS_키교환_디지털서명_WITH_대칭암호_키길이_암호모드_메세지인증(해쉬)



TLS_RSA_WITH_AES_128_GCM_SHA256

키교환 RSA 디지털서명
대칭암호 AES 128
암호 모드 GCM
메세지 인증 SHA256



암호키(대칭암호: 비밀키,공개키암호:keypair) 의 생성
암호모도초기백터 Nounce생성
MAC(메세지인증)

nexacro 인터셉터 설정

    <dependency>       <groupId>com.fasterxml.jackson.core</groupId>   <artifactId>jackson-core</artifactId&...