친구 수진이와 둘이서 떠났던 자전거 여행.
친구 수진이와 둘이서 떠났던 자전거 여행.
http://h21.hani.co.kr/arti/cover/cover_general/25881.html
이런곳에서 일하시는 엄마..
나의 어깨가 무거워진다.
A Guard came to the prison shoe shop where Jimmy Valentine was stitching a boot. The guard took Jimmy to the warden’s office. There, the warden passed Jimmy a pardon, which had been signed by the governor that morning. Jimmy took the document and looked bored. He had spent nearly ten months of his four-year sentence in jail, but he had expected to stay only about three months. Men like Jimmy Valentine had so many powerful friends outside of prison. It wasn’t even worth giving them a haircut and uniform, because they left prison so quickly.
“Valentine,” said the warden, “you’ll be released in the morning. I know you have a good character. Stop breaking into safes, and get a real job. I know you can do it.”
“Me?” said Jimmy. “I’ve never broken into a safe in my life.”
“Oh, no,” laughed the warden, “of course not. Why were you convicted for that theft in Springfield, then? Did you take the blame for one of your powerful friends? Or was it because the jury didn’t like your face? I hear those excuses from criminals every day.”
“Warden,” said Jimmy, innocently, “I don’t know what you’re talking about. I’ve never been to Springfield in my life.”
“Take him back to his cell, officer,” smiled the warden, “and give him his street clothes. Unlock him at seven in the morning and bring him to my office. I advise you to think about my advice, Valentine – become an honest man.”
At a quarter past seven the next morning Jimmy stood in the warden’s office. He wore the cheap suit and stiff, squeaky shoes that the state give to all freed prisoners.
The clerk handed Jimmy a train ticket and a five-dollar bill. The law expected Jimmy to use them to begin a new life as an honest man. The warden gave him a cigar, and shook his hand. It was written in the record book that prisoner #9762 was pardoned by the Governor, and Mr.James Valentine walked free into the sunshine.
Jimmy ignored the singing birds, the waving trees and the colorful flowers. He went straight to a restaurant. There he celebrated his freedom by eating a barbecued chicken, and drinking a bottle of white wine. Afterward, he smoked a cigar which was a lot better than the one the warden had give him. When he had finished smoking he walked slowly to the train station. On the way there he tossed a quarter into the hat of a blind man sitting on the ground.
Then Jimmy got on the train. Three hours later he got off at a small town. He walked into Mike Dolan’s cafe, and shook hands with Mike, who was alone behind the bar.
“Sorry we couldn’t get you out of prison sooner, Jimmy,” said Mike. “But there were some lawyers in Springfield we had to deal with. Then the governor almost changed his mind. How’re you doing?”
“I’m fine,” said Jimmy. “Have you got my key?”
Mike gave him his key and Jimmy went upstairs. He unlocked the door of a room and stepped inside. Everything was the same as when he left it. Detective Ben Price’s collar button still lay on the floor from the fight when Jimmy was arrested.
Jimmy slid back a secret panel in the wall and pulled out a dusty suitcase. He opened the suitcase and gazed happily at the finest set of burglar’s tools ever made. The set was made of special steel and had all the most modern designs. It included drills, punches, clamps, and augers. Jimmy was particularly proud of the tools he had invented himself. He had spent more than nine hundred dollars to have them made at a secret workshop.
In half an hour Jimmy went downstairs to the cafe. He was now dressed in expensive clothes. He carried his dusted and cleaned suitcase in his hand.
“Do you have any safes to break into?” asked Mike, with a friendly smile.
“Me?” asked Jimmy, in a puzzled tone. “I don’t understand. I’m a representative for the New York Short Biscuit and Cracker Company.”
This joke made Mike laugh so much that he wanted to buy Jimmy a drink. Jimmy had a soft drink. He never drank alcohol.
A week after the release of prisoner #9762, also known as James Valentine, there was a robbery. A safe was broken into in Richmond, Indiana. The criminal did not leave any clues. Eight hundred dollars were stolen. Two weeks after that a new, burglar-proof safe in Logansport was opened like a birthday present. Fifteen hundred dollars in cash was taken, but the gold and silver was left untouched. The police became concerned. The an old-fashioned bank-safe in Jefferson City gave up five thousand dollars. The losses were now so high that Ben Price took over the case. He found some obvious similarities between the burglaries.
“This is Jimmy Valentine’s work,” said Ben Price. “He’s back in business. Look at that combination knob. It was taken out as easily as pulling out a radish in wet weather. He’s got the only clamps that can do it. And look how expertly those tumblers were punched out! Jimmy only ever drills one hole. Yes, I want Mr. Valentine back in prison. This time his stay will be a long one.”
Ben Price knew Jimmy’s habits well. Ben had learned them while working on the Springfield case. Jimmy never cracked safes that were close to each other, he always left the scene quickly, he always worked alone, and he liked spending the money he stole. The detective had caught Jimmy once, and Ben knew he could catch Jimmy again. When people with safes heard that Ben Price was working on the case they felt better.
One afternoon Jimmy Valentine and his suitcase got off the mail wagon at Elmore, a little town five miles from the railway line in the Arkansas countryside. Jimmy looked like an athletic young senior just home from college as he walked toward the hotel.
A young woman walked towards Jimmy. As the passed each other he looked into her eyes and forgot who he was. She looked down and blushed. Young men with Jimmy’s style and looks were rare in Elmore.
Jimmy turned and watched her walk into the Elmore Bank. He approached a boy sitting on the steps of the bank, and began to ask him questions about the townn. He gave the boy a dime every few minutes to keep him interested. After a while the young lady came out, pretending not to notice the young man with the suitcase, and went on her way.
“Is that Miss Polly Simpson?” asked Jimmy.
“No,” said the boy. “That’s Annabel Adams. Her dad owns this bank. Why did you come to Elmore? Is that a gold watch chain? I’m going to get a dog for my birthday. Have you got any more dimes?”
Jimmy went to the Planters’ Hotel and registered under the name of Ralph D.Spencer. He told the clerk that he had come to Elmore to start a business. He asked about the shoe business in town, and if the town needed a shoe store.
The clerk was impressed by Jimmy’s clothes and manner. The clerk was thought to be a fashionable young man by the young people in Elmore, but seeing Jimmy made him realize he had a lot to learn about fashion. As he tried to figure out the way Jimmy had tied his tie, he politely answered the man’s questions.
“I think there’d be a lot of demand for a shoe store,” said the clerk. “There’s no shoe store in town. People buy shoes at the general store. And business is good here. I hope you decide to stay here Mr.Spencer. Elmore is a very pleasant town to live in, and the people are very friendly.”
Jimmy told the boy he would stay in town for a few days to check out the situation. “I’ll carry my bag up to my room myself,” said Jimmy. “It’s quite heavy.”
Jimmy changed his name to Ralph Spencer and stayed in Elmore. He opend a successful shoe store, and made many friends. And he achieved his heart’s desire – he met Miss Annabel Adams and began to fall in love with her.
After a year had passed, Mr.Spencer had won the respect of the community. His shoe store was very successful, and he and Annabel were engaged to be married in two weeks. Mr.Adams was a typical, conservative country banker, and he approved of Mr.Spencer. Annabel was very proud of Ralph and very affectionate toward him. He felt very comfortable in her family.
One day, Jimmy sat down in his room and wrote this letter, which he mailed to an old friend in St.Louis:
Dear Old Friend:
I want to meet you at Sullivan’s place, in Little Rock, next Wednesday night at nine o’clock. I want you to help me with some things. Also, I want to give you my tools. I know you’ll be happy – they’re worth about one thousand dollars.
Billy, I’ve quit the old business. I’ve been living straight and honest for a year. I’ve got a nice store, and I’m going to marry the most beautiful girl in the world two weeks from now. This is the best way to live, Billy. I will never touch another man’s money again. After I get married I’m going to sell my store and travel west. I’ve never stolen anything there and no one will recognize me.
Billy, I’m in love with an angel. She believes in me, and I will never do another dishonest thing in my life. You must meet me at Sullivan’s place. I’ll bring the tools with me.
Your old friends,
Jimmy
On the Monday night after Jimmy wrote his letter, Ben Price arrived in Elmore. He hung around town quietly until he found out what he wanted to know. From the restaurant across the street from Spencer’s shoe store he got a good look at Ralph D.Spencer.
“Are you going to marry the banker’s daughter, Jimmy?” said Ben to himself, softly. “Well, that’s interesting!”
The next morning Jimmy had breakfast at the Adams’ house. He was going to Little Rock that day to order his wedding suit and buy something nice for Annabel. It would be his first trip out of Elmore since he arrived. It had been more than a year since his last “job” and he thought it would be safe to leave the small town.
After breakfast at the Adams’ house, he went downtown with Mr.Adams, Annabel, Annabel’s married sister and her two girls, aged five and nine. They stopped at the hotel where Jimmy still stayed, and he ran inside and got his suitcase. The they went to the bank, where Dolph Gibson waited with a horse and carriage to take Jimmy to the train station.
The whole family went into the banking room. Jimmy also went in because Mr.Adams trusted his future son-in-law. The clerks were happy to see the good-looking and friendly young man who was going to marry Miss Annabel. Jimmy put his suitcase on the floor. For fun, Annabel picked up the suitcase and said “Do I look like a Doctor? Wow! Ralph, it’s very heavy. It feels like it’s full of gold bricks.”
“There are a lot of brass shoehorns in there,” said Jimmy, “that I’m going to return. I want to save money on the courier charges by taking them myself. I’m becoming very sensible with money.”
The Elmore bank had just installed a new safe and vault. Mr.Adams was very proud of it, and wanted to show everyone. The vault was small but it was strong. Three solid steel bolts fastened the door. It also had a time lock. Mr.Adams proudly explained how it worked to Mr.Spencer, who showed a polite and not very intelligent interest. The two children, May and Agatha, were delighted by the shining metal and the funny clock and dials.
While everyone was admiring the safe, Ben Price walked into the bank. He told the clerk that he was waiting for a friend, then casually leaned on a counter and looked into the banking room.
Suddenly there was screaming. Somehow, May, The nine-year old girl, had shut Agatha in the vault. She had been playing and copied the way Mr.Adams had turned the handle and the combination dial.
The old banker pulled the handle for a moment. “The door can’t be opened,” he groaned. “It’s a new safe. I haven’t set the clock and the combination yet.”
Agatha’s mother screamed again, hysterically.
“Quiet!” said Mr.Adams, and he raised a trembling hand. “Please be quiet for a moment. Agatha!” he called, as loudly as he could, “can you hear me?” In the following silence they could hear the faint sound of the child screaming in terror.
“My precious darling,” wailed the mother. “She will die of fright in the dark! Open the door! Oh, break it open! Can’t you men do something?”
“The nearest man who can open this door is in Little Rock,” said Mr.Adams, in a shaky voice. “My God! Spencer, what shall we do? The child won’t survive for long in there. There isn’t enough air, and she’ll probably die of fright.”
Agatha’s mother desperately beat the door of the vault with her hands. Someone wildly suggested dynamite. Annabel turned to Jimmy. Her large eye were full of fear, but not despair. She believed that the man she loved could do anything.
“Can’t you do something, Ralph,” she said. “Please try.”
With a strange smile he said, “Annabel, give me that rose you’re wearing.”
Annabel was confused, but she unpinned the rose from her dress and gave it to him. Jimmy put the rose in his shirt pocket, then took off his jacket and rolled up his sleeves. He was no longer Ralph Spencer. He had become Jimmy Valentine.
“Get away from the door, all of you,” he ordered.
He put his suitcase on the table and opened it. From that moment Jimmy seemed to be in a trance. He quickly took out the strange, shiny tools, and whistled softly as he worked. The others watched him in amazement.
In a minute Jimmy’s favorite drill was biting into the steel door. In ten minutes he broke his own burglary record. He threw back the bolts and opened the door.
Agatha was still conscious. She fell into her mother’s arms.
Jimmy Valentine put on his jacket and walked towards the front door. He seemed to hear faraway voices crying “Ralph” but he didn’t hesitate. A big man was standing in a doorway.
“Hello, Ben,” said Jimmy. “You found me at last. Well, let’s go. There’s no reason to stay here.”
Then Ben Price did something unexpected.
“I think you’re mistaken, Mr.Spencer,” he said. “I don’t think I know you.”
And Ben Price turned and walked away down the street.
* 역사
psad 소프트웨어 프로젝트는 1999년 가을, 바스티유 개발팀이 바스티유가 경량의 네트워크 침입 탐지 컴포넌트를 제공해야 한다고 결정했을 때 Bastille 리눅스의 일부로 시작했다. 당시 피터 왓킨스는 지금까지도 Bastille 와 함께 제공되는 매우 뛰어난 방화벽 스크립트를 개발 중이었으므로 방화벽 로그가 제공하는 정보에 기반한 IDS 도구를 개발하는 것은 자연스러운 다음 작업이었다. 또 당시 PortSentry(http://sourceforge.net/projects/sentrytools 참조)에는 기본 버리기 전략으로 설정된 방화벽과 함께 사용하기에는 부적절한 구조적 설계 문제가 있었다.
2001년 마이클 래쉬는 바스티유-NIDS 프로젝트가 바스티유를 설치할 필요 없이 독립적으로 실행될 수 있게 별도의 프로젝트로 분리시키고 포트 스캔 공격 탐지기라고 명명했다. psad의 개발 주기는 매우 활발하며 평균 3~4 달에 한 번씩 새로운 배포판이 나온다.
* 방화벽 로그를 분석하는 이유
좋은 네트워크 보안은 기본 네트워크 연결성과 서비스를 허용하기 위해 절대적으로 필요한 만큼만 허용하게 적절히 설정된 방화벽에서 시작된다. 방화벽은 인라인 장치이므로 네트워크 트래픽에 필터링 로직을 적용하기 좋다. 컴퓨터 네트워킹의 문맥에서 인라인 장치란 네트워크를 통해 패킷이 라우팅될 때 패킷의 직접적인 경로에 존재하는 하드웨어를 의미한다. 인라인 장치 내의 하드웨어나 소프트웨어가 오작동해서 기기의 네트워크 트래픽 전달 기능에 영향을 미친다면 네트워크 통신은 더 이상 동작하지 못한다. 인라인 장치의 예로는 라우터, 스위치, 브리지, 방화벽, 네트워크 참입 방지 시스템(IPS)이 있다
방화벽의 기능이 좀 더 완전해지고 복자배짐에 따라 점차적으로 (애플리케이션 계층 검사와 같이) 전통적으로 침입 탐지 시스템의 점주였던 기능을 제공하고 있다. 이런 기능이 트래픽을 필터링하는 기능에 더해지면서 방화벽은 명백한 침투와 복잡한 정탐 시도로부터 서비스를 보호하고 웜 트래픽으로부터의 잠재적인 피해를 제한할 수 있는 효과적인 기법을 제공할 수 있는 양질의 침입 탐지 데이터를 생성할 수 있게 됐다. 광범위한 로깅과 필터링 기능을 갖춘 iptables 와 같은 방화벽은 무시해선 안 되는 가치 있는 보안 데이터를 제공할 수 있다.
스노트와 같은 전용 침입 탐지 시스템이 굉장히 많은 기능과 네트워크 공격을 기술하기 위한 광범위한 규칙 언어를 제공하는 반면 iptables 는 항상 네트워크 트래픽에 인라인돼서 자세한 패킷 헤더 로그를 제공한다. 철저한 방어의 원리가 적용되므로 iptables 의 로그를 주의 깊게 보는 것이 좋다.
* psad 의 기능
현 버전의 psad는 Nmap과 같은 도구를 이용한 포트 스캔, 다양한 백도어 프로그램을 위한 탐사, 분산 서비스 거부 공격(DDoS) 도구, 네트워킹 프로토콜을 악용하려는 시도와 같이 다양한 유형의 의심스러운 트래픽을 탐지할 수 있다. Psad는 fwsnort와 함께 사용하는 경우 애플리케이션 계층 데이터를 조사해야 하는 규칙을 포함해서 스노트 2.3.3 전체 규칙의 60% 이상을 탐지하고 경고할 수 있다.
psad 의 좀 더 흥미로운 기능 가운데 하나는 스캔이나 기타 악의적인 트래픽이 시작되는 원격 운영체제를 수동적으로 핑거프린팅할 수 있는 기능이다. psad가 사용하는 핑거프린트는 p0f에서 나온 것이다. 더욱이 psad는 자세한 메일과 syslog 경고, 위험 수준 임계치에 기반한 IP 자동 차단 기능(이 기능은 기본적으로 비활성화돼 있다), 통합된 whois 지원, DShield 보고 등을 제공한다.
* psad 설치
psad를 설치하기 전에 우선 http://www.cipherdyne.org/psad/download 에서 최신 버전을 받아야 한다. psad를 포함해서 http://www.cipherdyne.org 에서 배포하는 모든 프로그램은 각 소스 트리에 설치 프로그램인 insatll.pl 이 함께 제공된다. tarball 파일을 받은 다음에는 MD5 합과 GnuPG 서명을 모두 확인하는 것이 좋다.


install.pl 스크립트는 메일 경고가 전송될 메일 주소, 시스템에서 현재 실행 중인 syslog 데몬의 유형(syslogd, syslog-ng, metalog), psad가 특정 로깅 접두어를 포함하는 iptables 로그 메시지만을 분석하게 할지에 대한 결정, 로그 데이터를 DShield 분산 IDS로 전송할지에 대한 결정 등과 같은 몇 가지 사용자 입력을 필요로 한다. 직접 정보를 입력하거나 기본 값(그냥 엔터 키를 누름)을 그대로 사용할 수 있다. 잠시 후면 psad의 설치가 완료된다.
데비안 혹은 우분투 리눅스를 사용하는 경우 다음의 명령어를 이용하여 쉽고 같편하게 psad 설치를 진행할 수 있다.
# sudo apt-get install psad
리눅스에 psad를 성공적으로 설치하고 나면 로컬 파일시스템에 다량의 새 파일과 디렉토리가 생성된다.
펄은 주요 psad 데몬(나중에 다룰 도우미 데몬 kmsgsd와 psadwatchd는 C로 작성한 것이다)을 개발하는 데 쓰인 프로그래밍 언어로, 핵심 펄 모듈에는 포함되지 않는 몇 개의 펄 모듈이 사용된다. 이러한 펄 모듈을 /usr/lib/psad 에 모두 설치함으로써 psad 는 이미 시스템 펄 라이브러리 트리에 설치된 펄 모듈(주로 /usr/lib/perl5 에 위치)과 psad 가 필요로 하는 모듈을 완전히 분리시켜 유지할 수 있다.
psad 에는 다음과 같은 모듈이 필요하다.
* Date::Calc
* Net::Ipv4Addr
* Unix::Syslog
* IPTABLES::Parse
* IPTABLES::ChainMgr
psad, kmsgsd, psadwatchd 와 같은 세 개의 시스템 데몬이 psad를 구성한다. 이 데몬은 모두 /usr/sbin 에 설치되며 /etc/psad/psad.conf 파일을 참조한다.
psad 설치 프로그램은 /etc/psad/archive 디렉토리도 생성해서 현재의 psad 데몬 설정 파일을 복사한다. 이는 psad 를 재설치할 때 이전의 설정을 보존하기 위한 것이다. install.pl 프로그램은 현재의 psad 설정 값을 새로운 설정 파일로 통합할 수 있으며, 이를 통해 업그레이드 비용을 최소화할 수 있다.
설치 프로그램은 /var 에도 몇 개의 파일과 디렉토리를 생성한다. 우선 /var/lib/psadfifo 에 명명된 파이프를 생성하고 /var/log/psad 디렉토리와 파일 /var/log/psad/fwdata 를 생성한다. 끝으로 install.pl 스크립트는 설치 로그를 /var/log/psad/install.log 에 유지한다. 실행 시 psad 의 주요 동작 디렉토리(수상한 네트워크 트래픽과 관련된 IP 주소를 기록하는 디렉토리)도 /var/log/psad 다.
psad가 설치되는 디렉토리는 무작위로 선택되는 것이 아니라 파일 시스템 계층 표준(FHS, Filesystem Hierarchy Standard)이라는 문서에서 정의하는 표준 디렉토리 내에 위치한 것이다. 이 문서에는 유닉스 파일시스템 디렉토리 구조 내의 각 디렉토리가 담당할 목적을 분류한다. 이 문서를 따르는 애플리케이션은 리눅스 디렉토리 구조를 예상 가능하게 사용하며 이는 수많은 디렉토리와 파일 속에서 어느 정도 정리된 모습을 유지할 수 있게 해준다. FHS는 http://www.pathname.com/fhs에서 구할 수 있다.XIW0pLyDnJ.pdf
* psad 관리
– psad 의 시작과 종료
psad의 시작과 종료는 매우 간단하다. init 스크립트를 사용하면 된다.
psad가 init 스크립트를 통해 시작되면 주 psad 데몬, kmsgsd, psadwatchd 와 같은 세 개의 데몬도 시작된다. kmsgsd 는 psad 가 iptables 로그를 실시간으로 분석할 수 있게 /var/lig/psad/psadfifo 명명된 파이프로부터 모든 iptables 로그 메시지를 읽어 와서 별도의 파일인 /var/log/psad/fwdata 에 기록한다. 이를 통해 psad 는 iptables 로그 메시지만을 포함하는 데이터 스트림을 제공받는다.
psad는 설치 시에 시스템 syslog 데몬이 info 우선순위를 가지는 모든 커널 메시지(또는 syslog 용어로 kern.info 메시지)를 명명된 파이프 /var/lib/psad/psadfifo 에 기록하게 재설정한다.
psadwatchd 데몬은 단순히 psad와 kmsgsd 데몬이 실행 중인지 확인하고 그렇지 않으면 이들을 재시작한다. psadwatchd 는 두 데몬 중 하나를 재시작해야 하면 /etc/psad/psad.conf 파일에 있는 메일 주소로 경고 메일을 전송한다.
– 데몬 프로세스의 유일성
psad 가 시작되면 세 개의 psad 데몬은 각기 자신만의 프로세스 ID(PID)를 /var/run/psad 내의 파일에 기록한다. 명령 행에서 수동으로 데몬을 시작하면 해당 데몬은 우선 다른 인스턴스가 실행 중인지 확인하고 실행 중이라면 새로운 인스턴스는 바로 종료한다. 이를 통해 이미 존재하는 psad 프로세스를 그대로 유지할 수 있다.
– iptables 정책 설정
기본적으로 psad 는 로그 분석기다. psad 는 자신이 설치된 시스템상의 iptables 정책이 기록 후 버리기 전략으로 설정됐다고 가정한다. 이는 iptables 가 네트워크의 동작을 위해서 꼭 필요한 패킷만을 수용하게 보장해주며 다른 모든 패킷은 기록 후 버린다. 포트 스캔, 백도어 프로그램을 위한 탐사, 시스템을 전복시키는 애플리케이션 명령, 기타 불법적인 걱듯이 수용 가능한 네트워크 트래픽 목록에서 제외되므로 이런 정책으로부터 나온 iptables 기록은 보통 전용 침입 탐지 시스템에 가치 있는 데이터를 제공할 수 있다.
psad는 로컬 iptables 정책이 INPUT 과 FORWARD 체인 모두에서 기본 LOG와 DROP 규칙으로 설정됐는지 확인해주는 자동 기법을 제공한다. 이 기법은 /usr/sbin/fwcheck_psad 에 위치한 전용 스크립트로 (psad 실행 시 –no-fwcheck 명령 행 스위치를 주거나 psad 가 별도의 syslog 서버에서 실행 중이지 않는 한) psad 가 시작할 때 실행한다. fwcheck_psad 스크립트는 IPTables::Parse 펄 모듈을 사용해 로컬 iptables 정책의 표현(representation)을 얻어오며 LOG와 DROP 규칙이 포함됐는지 알아보기 위해 이를 해석한다. 포함돼 있지 않다면 psad는 iptables 정책이 알맞게 설정되지 않았다는 것을 알려주기 위해 설정 경고 메일을 전송한다.
iptables 정책은 매우 복잡할 수 있기 때문에 정책이 로그와 버리기 전략을 가지는지 결정하는데에 IPTables::Parse 모듈의 구문 분석 기능이 항상 충분하지는 않다. 검사가 실패하더라도 psad는 여전히 동작할 수 있으며, psad의 효과는 iptables가 기록하는 패킷의 유형에 따라 달라진다. 실제로 SMB(윈도우에서 사용)와 같은 프로토콜은 필요 없는 내용을 너무 많이 포함하기 때문에 기로하기에 부적절하며, 이런 프로토콜을 통해 전송된 패킷은 주로 LOG 규칙과 일치될 수 있기 전에 받아들이거나 버린다. fwcheck_psad 가 올바로 구문 분석할 수 없을 정도로 복잡한 iptables 정책을 실행 중이라면 /etc/psad/psad.conf 의 ENABLE_FW_LOGGING_CHECK 변수를 N 으로 설정해서 이 검사를 비활성화할 수 있다.
– syslog 설정
패킷이 iptables 내에서 LOG 규칙에 매칭되면 커널은 커널 로깅 데몬인 klogd를 통해 이 사실을 보고한다. 이렇게 전달된 커널 로그 메시지는 보통 보고서 파일에 기록되기 위해 명명된 파이프나 버클리 소켓 인터페이스를 통한 별도의 시스템으로 전달된다. 이는 모두 syslog 데몬이 제공하는 기능과 syslog이 어떻게 설정됐는지에 따라 달라진다.
syslogd와 syslog-ng 데몬은 psad와 호환되며, psad는 metalog도 제한된 방식으로 지원한다. syslogd와 syslog-ng는 명명된 파이프로 로그 메시지를 기록할 수 있으며, psad는 이를 이용하기 위해 모든 kern.info 로그 메시지가 명명된 파이프 /var/lib/psad/psadfifo에 기록되게 설정한다. 이곳으로 전달된 로그 메시지는 kmsgsd가 이용한다. kmsgsd는 psadfifo를 통해 syslog 메시지를 받으면 이 syslog 메시지가 iptables에 의해 생성됐다는 것을 보장하기 위해 두 개의 부분 문자열(IN= 과 OUT=)을 포함하는지 확인한다. 메시지가 이 검사를 통과하면 kmsgsd는 이를 psad가 볼 수 있게 파일 /var/log/psad/fwdata에 기록한다. 많은 kern.info syslog 메시지가 iptables와 아무런 관계도 없는 커널 일부에 의해 생성될 수 있으며, kmsgsd는 iptables 메시지만이 psad에 의해 분석되게 보장한다.
IN=과 OUT= 문자열은 iptables LOG 타겟을 통해 기록된 패킷의 입력과 출력 인터페이스를 나타낸다. 이러한 문자열은 iptables 로그 메시지에 항상 포함된다.
— syslogd
syslogd가 설치된 시스템에서 psad가 실행중이라면 설치 시 /etc/syslog.conf 설정 파일에 다음과 같은 내용이 추가된다. 이는 syslogd가 kern.info 메시지를 /var/lib/psad/psadfifo에 기록하게 설정한다.

– whois 클라이언트
마르코 디트리(Marco d’itri)가 만든 훌륭한 whois(후이즈) 클라이언트가 psad 소스와 함께 제공된다. 이 클라이언트는 주어진 IP 주소에 대해 거의 항상 올바른 넷블록(netblock)을 질의하며, psad는 (–no-whois 명령 행 스위치를 주지 않는 한) IP 주소 소유 정보를 질의해서 메일 경고에 포함시키기 위해 이 클라이언트를 이용한다. 이런 정보를 가지면 스캔이나 기타 다른 공격이 탐지된 네트워크의 관리자 식별 과정이 단순해진다. 예를 들어 우리학교(http://www.kongju.ac.kr)의 IP(203.253.33.6)의 주소를 whois 탐지하면 다음과 같은 결과가 나온다.

* psad 설정
모든 psad 데몬은 /etc/psad에 있는 파일 psad.conf를 참조하며, 이 파일은 간단한 규약을 따른다. 주석은 # 기호로 시작하며 설정 매개변수는 키-값 형식으로 명시한다. 예를 들어 psad.conf의 HOSTNAME 변수는 psad가 설치된 시스템의 호스트명을 정의한다.
### Machine hostname
HOSTNAME extreme;
모든 설정 변수 값은 값을 의미하는 문자열의 끝을 나타내기 위해 세미콜론으로 끝나야 한다. 그러므로 다름과 같이 문서화를 위해 세미콜론 다음에 주석을 포함시킬 수 있다.
### This is used only if ENABLE_PERSISTENCE = “N”;
SCAN_TIMEOUT 3600; ### seconds
끝으로 psad 변수 값은 psad가 설정을 구문 분석할 때 확장되는 하위 변수를 포함할 수 있다. 예를 들어 psad의 주요 로깅 디렉토리는 PSAD_DIR 변수가 정의하며, 기본적으로 /var/log/psad로 설정된다. 다른 설정 변수는 다음과 같이 PSAD_DIR 변수를 참조할 수 있다.
PSAD_ERR_DIR $PSAD_DIR/errs;
– /etc/psad/psad.conf
psad.conf 파일은 psad의 주요 설정 파일로 psad 동작의 다양한 면을 제어하기 위한 100개 이상의 설정 변수를 포함한다.
설정에 관한 더 자세한 내용은 http://www.cipherdyne.org/psad/docs/index.html 에서 확인할 수 있다.
— EMAIL_ADDRESSES
EMAIL_ADDRESSES 변수는 psad가 스캔 경고, 정보 메시지, 기타 공지를 전송할 메일 주소를 정의한다. 콤마를 사용해서 여러 개의 메일 주소를 함께 나타낼 수도 있다.
### Supports multiple email addresses (as a comma separated
### list).
EMAIL_ADDRESSES root@localhost;
— DANGER_LEVEL{n}
psad는 경고에 우선순위를 두기 위해 악의적인 모든 활동을 위험 수준에 따라 나눈다. 위험 수준은 1에서 5까지(5가 가장 안 좋은 것)이며, 공격이나 스캔이 탐지된 각 IP 주소에 할당된다. 위험 수준 값은 스캔의 특성(패킷 수, 포트 범위, 시간 간격), 특정 패킷이 /etc/psad/signatures 파일에 정의된 서명과 일치하는지 여부, 패킷이 /etc/psad/auto_dl 파일에 있는 IP나 네트워크로부터 시작됐는지 여부와 같은 세 가지 요소에 기반해 할당된다.
포트 스캔의 경우 스캔의 패킷 수에 따라 DANGER_LEVEL{n} 변수 값이 달라지며, psad.conf 파일에 다음과 같이 정의돼 있다.
### Danger levels. These represent the total number of
### packets required for a scan to reach each danger level.
### A scan may also reach a danger level if the scan trips
### a signature or if the scanning ip is listed in
### auto_ips so a danger level is automatically
### assigned.
DANGER_LEVEL1 5; ### Number of packets.
DANGER_LEVEL2 15;
DANGER_LEVEL3 150;
DANGER_LEVEL4 1500;
DANGER_LEVEL5 10000;
— HOME_NET
psad는 의심스러운 네트워크 트래픽을 탐지하기 위해 수정된 스노트 규기을 사용하기 때문에 psad.conf 파일에서 psad가 사용하는 변수는 스노트가 사용하는 변수와 유사하다. HOME_NET 변수는 실행 중인 psad가 설치된 시스템의 로컬 네트워크를 정의한다. 그러나 psad와 스노트가 HOME_NET 변수를 처리하는 데에는 한가지 차이점이 있다. psad는 INPUT 체인에 기록된 모든 패킷의 목적지를 출발지 주소와 무관하게 홈 네트워크로 취급한다. 이는 iptables 방화벽 자체에서 라우팅됐기 때문이다. ENABLE_INTF_LOCAL 변수를 N으로 설정해서 이러한 동작을 재정의할 수 있다.
### Specify the home and external networks. Note that by default the
### ENABLE_INTF_LOCAL_NETS is enabled, so psad automatically detects
### all of the directly connected subnets and uses this information as
#@@ the HOME_NET variable.
HOME_NET any;
EXTERNAL_NET any;
— EXTERNAL_NET
EXTERNAL_NET 변수는 외부 네트워크를 정의한다. 기본 값은 any 이지만 HOME_NET 변수처럼 임의의 네트워크 목록으로 설정할 수 있다. 대부분의 경우 기본 값이 가장 좋을 것이다.
— SYSLOG_DAEMON
SYSLOG_DAEMON 변수는 psad 에게 로컬 시스템에서 실행 중인 syslog 데몬이 무엇인지 알려준다. 이 변수는 syslogd, syslog-ng, ulogd, metalog 중 하나의 값을 가진다. psad는 이 변수 값을 이용해서 해당 syslog 설정 파일이 kern.info 메시지를 명명된 파이프 /var/lib/psad/psadfifo에 기록하게 적절히 설정됐는지 확인한다. 단, psad가 ulogd를 통해 iptables 로그 메시지를 얻는 경우는 예외인데 ulogd가 메시지를 직접 디스크에 기록하기 때문에 syslog 데몬이 실행 중이지 않아도 된다. 이 경우 psad는 kmsgsd 데몬을 시작하지 않는다.
### Set the type of syslog daemon that is used. The SYSLOG_DAEMON
### variable accepts four possible values: syslogd, syslog-ng, ulogd,
### or metalog.
SYSLOG_DAEMON syslogd;
— CHECK_INTERVAL
psad는 대부분의 시간을 대기하면서 보내며 새로운 iptables 로그 메시지가 /var/log/psad/fwdata 파일에 기록될 때만 활성화된다. 확인 시간 간격을 CHECK_INTERVAL 변수로 정의하며 초로 나타낸다. 기본 값은 5초다. 이 간격은 최소 1초까지 설정할 수 있지만 경고가 최대한 빨리 생성되길 원하는 경우가 아니라면 보통 이렇게 작은 값으로 설정할 필요는 없다.
### Set the interval (in seconds) psad will use to sleep before
### checking for new iptables log messages
CHECK_INTERVAL 5;
— SCAN_TIMEOUT
기본적으로 SCAN_TIMEOUT 변수는 3600초(1시간)로 설정되며 psad는 이 값을 스캔이 추적되는 시간 간격으로 사용한다. 즉, 특정 IP 주소에서 악의적인 트래픽이 이 시간 간격동안 위험 수준 1에 도달하지 않으면 psad는 경고를 생성하지 않는다. ENABLE_PERSISTENCE를 Y로 설정하면 psad는 SCAN_TIMEOUT 변수를 무시한다.
### This is used only if ENABLE_PERSISTENCE = “N”;
SCAN_TIMEOUT 3600; ### seconds
— ENABLE_PERSISTENCE
포트 스캔 탐지 소프트웨어는 일반적으로 포트 스캔을 잡기 위해 두 개의 임계치를 설정해야 하는데, 조사되는 포트 수와 시간 간격이 그것이다. 공격자는 스캔되는 포트의 수를 줄이거나 스캔의 속도를 줄여서 포트 스캔이 이 임계치에 도달하지 않게 할 수 있다. ENABLE_PERSISTENCE 변수는 psad가 SCAN_TIMEOUT 변수를 스캔 탐지의 요소로 사용하지 않게 해준다. 이는 스캐너가 수일이나 수주에 걸쳐 목표 시스템을 천천히 스캔함으로써 시간 만료 임계치보다 낮은 수준에 머물게 하려는 시도를 무력화하는 데 유용하다. 스캔이 최소 DANGER_LEVEL1 변수에 의해 정의된 패킷수에 도달하면(이 수에 도달하는 데 걸린 시간이 얼마나 긴지에 무관하게) psad는 경고를 전송한다.
### If “Y”, means that scans will never timeout. This is useful
### for catching scans that take place over long periods of time
### where the attacker is trying to slip beneath the IDS thresholds.
ENABLE_PERSISTENCE Y;
— PORT_RANGE_SCAN_THRESHOLD
이 변수를 통해 psad가 위험 수준을 포트 스캔에 할당하기 전에 스캔돼야 하는 포트의 최소 범위를 정의할 수 있다. 기본적으로 PORT_RANGE_SCAN_THRESHOLD는 1로 설정되며, 이는 위험 수준 1에 이르기 전에 최소한 두 개의 서로 다른 포트가 스캔돼야 함을 의미한다. 한 IP 주소가 한 포트만을 반복적으로 스캔할 수 있는데, 이 경우 psad는 경고를 전송하지 않는다(최소 위험 수준 1이 할당되지 않은 활동에 대해서는 절대 경고가 전송되지 않으며, psad에서는 경고가 전송되는 최소 위험 수준을 1에서 5까지로 설정할 수 있다. “EMAIL_ALERT_DANGER_LEVEL” 참조). psad가 스캔되는 포트의 범위를 탐지 요소로 사용하게 하고 싶지 않다면 PORT_RANGE_SCAN_THRESHOLD를 0으로 설정하면 된다.
### Set the minimum range of ports that must be scanned before
### psad will send an alert. The default is 1 so that at
### least two port must be scanned (p2-p1 >= 1). This can be set
### to 0 if you want psad to be extra paranoid, or 30000 if not.
PORT_RANGE_SCAN_THRESHOLD 1;
— EMAIL_ALERT_DANGER_LEVEL
이 변수는 어떤 IP 주소가 최소 이 값과 동일한 위험 수준으로 할당되지 않는 한 psad가 메일 경고를 전송하지 않게 하는 위험 수준의 최소 값을 설정하는 데 쓰인다. 기본 값은 1이다.
### Only send email alert if danger level >= to this value.
EMAIL_ALERT_DANGER_LEVEL 1;
— MIN_DANGER_LEVEL
MIN_DANGER_LEVEL 임계치는 psad가 수행하는 모든 경고와 추적기능을 위한 전역 임계치다. 예를 들어 MIN_DANGER_LEVEL이 2로 설정되면 psad는 특정 IP 주소가 위험 수준 2에 도달하기 전에는 이를 /var/log/psad/ip 디렉토리에 기록하지도 않는다. 그러므로 MIN_DANGER_LEVEL 변수는 항상 EMAIL_ALERT_DANGER_LEVEL 변수의 값보다 작거나 같게 설정해야 한다. 기본 MIN_DANGER_LEVEL 값은 1이다.
### Minimum danger level a scan must reach before any logging or
### alerting is done. The EMAIL_ALERT_DANGER_LEVEL variable below
### only refers to email alerts; the MIN_DANGER_LEVEL variable
### applies to everything from email alerts to whether or not the
### IP directory is created within /var/log/psad/. Hence
### MIN_DANGER_LEVEL should be set less than or equal to the value
### assigned to the EMAIL_ALERT_DANGER_LEVEL variable.
MIN_DANGER_LEVEL 1;
— SHOW_ALL_SIGNATURES
이 변수는 psad가 모든 경고에서 IP 주소와 관련된 모든 서명 경고 정보를 포함하게 할지 여부를 결정한다. 이 변수를 활성화할 경우 특정 IP 주소가 오새동안 의심스러운 트래픽으로 한 사이트에 접속할 때 매우 긴 메일 경고가 초래될 수 있기 때문에 이는 기본적으로 비활성화된다. 그러나 SHOW_ALL_SIGNATURES가 비활성화된 경우에도 psad 메일 경고는 마지막 CHECK_INTERVAL에서 새로 촉발된 서명은 모두 포함한다.
### If “Y”, means all signatures will be shown since
### the scan started instead of just the current ones.
SHOW_ALL_SIGNATURES N;
— ALERT_ALL
이 변수가 Y로 설정되면 psad는 어떤 IP 주소로부터의 새로운 악의적인 활동이 위험 수준 1에 도달하는 한 이러한 활동이 탐지될 때마다 메일이나 syslog 경고, 또는 둘 모두를 생성한다. N으로 설정되면 IP 주소에 할당된 위험 수준이 증가할 때만 경고를 생성한다.
### If “Y”, send email for all newly logged packets from the same
### source ip instead of just when a danger level increases.
ALERT_ALL Y;
— SNORT_SID_STR
이 변수는 어떤 iptables 로그 메시지가 스노트 규칙 하나를 완전하게 기술하는 iptables 규칙에 의해 생성됐는지 알아보기 위해 iptables 로그 메시지와 매칭시킬 부분 문자열을 정의한다. 이런 iptables 규칙은 fwsnort가 생성하며 일반적으로 로깅 접두어 SID{n}을 포함한다. 여기서 {n}은 원본 스노트 규칙에서 얻은 스노트 ID 번호다. SNORT_SID_STR의 기본 값은 단순히 SID다.
### Search for snort “sid” values generated by fwsnort
### or snort2iptables
SNORT_SID_STR SID;
— ENABLE_AUTO_IDS
이 변수는 Y로 설정되는 경우 psad를 수동적 모니터링 데몬에서, (INPUT 체인과 OUTPUT 체인을 통해) 로컬 시스템과 (FORWARD 체인을 통해) 로컬 시스템에 의해 보호되는 모든 시스템과 연동해서 공격자 IP 주소를 차단하기 위해 로컬 iptables 정책을 동적으로 재설정함으로써 공격에 능동적으로 응답하는 프로그램으로 변환한다.
### If “Y”, enable automated IDS response (auto manages
### firewall rulesets).
ENABLE_AUTO_IDS N;
— IMPORT_OLD_SCANS
psad가 포트 스캔과 기타 의심스러운 활동에 대해 수집하는 정보는 /var/log/psad 디렉토리에 기록된다. 위험 수준 1에 도달한 모든 IP 주소에 대해 새 디렉토리 /var/log/psad/ip가 생성된다. 이 디렉토리에 저장되는 다양한 파일에는 가장 최근의 메일 경고, whois 출력, 서명 매칭, 위험 수준, 패킷 수가 포함된다. 처음 시작 시 psad는 보통 기존의 /var/log/psad/ip 디렉토리를 제거하지만 IMPORT_OLD_SCANS를 Y로 설정해서 기존의 디렉토리로부터 모든 데이터를 가져올 수 있다. 이 기능을 통해 이전 psad 인스턴스의 스탬 데이터를 잃지 않고 psad를 재시작하거나 전체 시스템을 재부팅할 수 있다.
### If “Y”, then psad will import old scan source ip directories
### as current scans instead of moving the directories into the
### archive directory.
IMPORT_OLD_SCANS Y;
— ENABLE_DSHIELD_ALERTS
이 변수를 Y로 설정하면 psad는 스캔 데이터를 DSHield 분산 침입 탐지 시스템으로 전송한다. 스캔 정보는 민감한 정보일 수 있기 때문에 스캔 데이터를 DShield로 넘기면 해당 스캔 데이터는 더 이상 여러분의 제어 하에 있지 않으며 상대적으로 열린 데이터베이스로 구문 분석된다는 점을 알아야 한다. 그러나 DShield는 가장 일반적으로 공격당하는 서비스나 현재 대부분의 시스템을 공격하는 어떤 IP 주소가 무엇인지(이런 IP 주소는 엄격한 방화벽 규칙의 좋은 후보가 된다)에 대한 정보를 사용자가 좀 더 잘 이해할 수 있게 해준다. 필자(마이클 래쉬)는 DShield로 스캔 정보를 전송하면 안 된다는 엄격한 요구사항(예를 들어 사이트 보안 정책에서 이를 강제할 수 있다)이 없는 한 psad에서 이 기능을 활성화할 것을 강력히 권장한다. 많은 사람들이 이 기능을 활성화할수록 인터넷은 좀 더 안정해진다.
### Send scan logs to dshield.org. This is disabled by default,
### but is a good idea to enable it (subject to your site security
### policy) since the DShield service helps to track the bad guys.
### For more information visit http://www.dshield.org
ENABLE_DSHIELD_ALERTS Y;
— IGNORE_PORTS
많은 침입 탐지 시스템의 주요 기능은 관리자가 IDS로 하여금 완전히 무시하게 하고 싶은 데이터 조각을 필터링하는 기능이다. IGNORE_PORTS 변수는 psad가 목적지 포트 번호와 프로토콜(TCP나 UDP)에 기반해서 iptables 로그 메시지를 무시하게 한다. 포트 번위와 다중 포트, 프로토콜 조합은 다음과 같이 지정할 수 있다.
### define a set of ports to ignore (this is useful particularly
### for port knocking applications since the knock sequence will
### look to psad like a scan). This variable may be defined as
### a comma-separated list of port numbers or port ranges and
### corresponding protocol, For example, to have psad ignore all
### tcp in the range 61000-61356 and udp ports 53 and 5000, use:
### IGNORE_PORTS tcp/61000-61356, udp/53, udp/5000;
IGNORE_PORTS NONE;
— IGNORE_PROTOCOLS
IGNORE_PROTOCOLS 변수를 사용하면 psad는 전체 프로토콜을 무시할 수 있다. 대개는 iptables 정책을 조정해서 무시하고 싶은 프로토콜을 기록하지 않는 것이 더 좋지만 예를 들어 psad가 모든 ICMP 패킷을 무시하게 하고 싶다면 다음과 같이 IGNORE_PROTOCOLS를 설정하면 된다.
### allow entire protocols to be ignored. This keyword can accept
### a comma separated list of protocols. Each protocol must match
### the protocol that is specified in a Netfilter log message (case
### insensitively, so both “TCP” or “tcp” is ok).
### IGNORE_PROTOCOL tcp,udp;
IGNORE_PROTOCOLS icmp;
— IGNORE_LOG_PREFIXES
iptables 정책은 매우 복잡할 수 있으며, 다수의 여러 가지 로깅 규칙을 포함할 수 있다. 또 각 로깅 규칙은 자신만의 로깅 접두어를 가질 수도 있다. psad가 특정 로깅 접두어(예를 들어 DROP:INPUT5:eth1)를 무시하게 하고 십다면 IGNORE_LOG_PREFIXES를 다음과 같이 설정하면 된다.
### Ignore these specific logging prefixes
IGNORE_LOG_PREFIXES DROP:INPUT5:eth1;
— EMAIL_LIMIT
어떤 경우에는 Iptables 정책이 특정 트래픽을 기록하게 설정되는데, 이 트래픽이 네트워크상에서 여러 번 반복될 수 있다(예를 들어 특정 DNS 서버로의 DNS 요청). 이러한 트래픽이 스캔이라고 해석되면 해당 트래픽 자체가 반복되기 때문에 psad는 이 트래픽에 대해 다량의 메일 경고를 전송할 수 있다. EMAIL_LIMIT 변수를 사용하면 psad가 스캐닝 IP 주소에 대해 전송되는 메일 경고의 수에 제한을 두게 강제할 수 있다. 기본 값은 0으로 이는 제한이 없다는 것을 의미한다. 그러나 EMAIL_LIMIT 값을 50으로 설정하면 psad는 특정 IP 주소에 대해 50개 이상의 메일 경로를 전송하지 않는다.
### Send no more than this number of emails for a single
### scanning source IP. Note that enabling this feature may cause
### alerts for real attacks to not be generated if an attack is sent
### after the email threshold has been reached for an IP address.
### This is why the default is set to “0”.
EMAIL_LIMIT 50;
— ALERTING_METHODS
대부분의 관리자는 psad가 제공하는 메일과 syslog 보고 모드를 모두 사용한다. 그러나 ALERTING_METHODS 변소를 이용하면 psad가 메일 경고와 syslog 경고 중 어떤 것을 생성하게 할지 제어할 수 있다. ALERTING_METHODS 변수는 noemail, nosyslog, ALL과 같은 세 가지 값을 가질 수 있다. noemail과 nosyslog 값은 psad가 메일이나 syslog 경고를 전송하지 않게 한다. 이 값들을 조합해서 모든 경고를 비활성화할 수도 있다. 기본 값은 둘 모두를 생성하는 것이다.
### Allow reporting methods to be enabled/restricted. This keyword can
### accept values of “nosyslog” (don’t write any messages to syslog),
### “noemail” (don’t send any email messages), or “ALL” (to generate both
### syslog and email messages). “ALL” is the default. Both “nosyslog”
### and “noemail” can be combined with a comma to disable all logging
### and alerting.
ALERTING_METHODS ALL;
— FW_MSG_SEARCH
FW_MSG_SEARCH 변수는 psad가 iptables 로그 메시지를 어떻게 검색할 지 정의한다. psad가 (iptables에 주는 –log-prefix 인자를 사용해 iptables LOG 규칙에 정의된) 특정 로그 접두어를 포함하는 로그 메시지만을 분석하게 제한하려면 FW_MSG_SEARCH 변수로 접두어를 정의하면 된다. iptables는 패킷에 FW_MSG_SEARCH 변수 값과 다른 로그 접두어를 할당하게 설정할 수 있으며 이 경우 psad는 해당 패킷을 분석하지 않는다.
예를 들어 psad가 문자열 DROP을 포함하는 iptables 로그 메시지만을 분석하게 하려면 다음과 같이 FW_MSG_SEARCH 변수를 설정하면 된다.
### The FW_MSG_SEARCH variable can be modified to look for logging messages
### that are specific to your firewall configuration (specified by the
### “–log-prefix” option. For example, if your firewall uses the
### string “Audit” for packets that have been blocked, then you could
### set FW_MSG_SEARCH to “Audit”; The default string to search for is
### “DROP”. Both psad and kmsgsd reference this file. NOTE: You can
### specify this variable multiple times to have psad search for multiple
### strings. For example to have psad search for the strings “Audit” and
### “Reject”, you would use the following two lines:
#FW_MSG_SEARCH Audit;
#FW_MSG_SEARCH REJECT;
FW_MSG_SEARCH DROP;
– /etc/psad/auto_dl
모든 IDS는 항상 높은 확률로 긍정 오류를 범한다. 그러므로 IDS는 특정 시스템, 네트워크, 프토토콜이 모든 탐지 동작과 (가장 중요하게는) 자동화된 모든 응답 기능에서 제외될 수 있게 해주는 허용 목록 기능을 갖춰야 한다. 또 특정 IP 주소나 네트워크가 공격자로 알려질 수도 있으므로 이들을 차단할 차단 목록 기능도 필요하다.
이러한 요구사항은 다음과 같은 구문을 따르는 psad의 auto_dl 파일이 충족시킨다.
# <IP address> <danger level> <optional protocol>/<optional ports>;
위험 수준이 0으로 설정되면 psad는 해당 IP 주소나 네트워크를 완전히 무시한다. 반대로 특정 IP 주소나 네트워크가 극도로 악의적이라고 알려지는 경우에는 위험 수준을 5로 설정할 수 있다.
# Examples:
#
# 10.111.21.23 5; # Very bad IP.
# 127.0.0.1 0; # Ignore this IP.
# 10.10.1.0/24 0; # Ignore traffic from this entire class C.
# 192.168.10.4 3 tcp; # Assign danger level 3 if protocol is tcp.
# 10.10.1.0/24 3 tcp/1-1024; # Danger level 3 for tcp port range
– /etc/psad/signatures
/etc/psad/signatures 파일은 약간 수정된 스노트 규칙을 약 200개 정도 포함한다. 이 규칙들을 psad가 iptables 로그 메시지로부터 바로 탐지할 수 있는 공격을 나타낸다. 이 규칙 중 어떤 것도 네트워크 트래픽에 대한 애플리케이션 계층 검사를 필요로 하지 않는다. 애플리케이션 계층 검사는 fwsnort가 수행한다. 이 파일에 있는 규칙을 하나 예로 들면 다음과 같다.
alert udp $EXTERNAL_NET any -> $HOME_NET 31335 (msg:”DDOS Trin00 Daemon to Master”; reference:arachnids,187; reference:url,www.sans.org/resources/idfaq/trinoo.php; classtype:attempted-recon; psad_dsize:>2; psad_id:100002; psad_dl:2; psad_derived_sids:223,231,232;)
– /etc/psad/snort_rule_dl
/etc/psad/auto_dl과 유사하게 snort_rule_dl 파일은 psad가 스노트 규치고가 매칭되는 모든 IP 주소의 위험 수준을 자동으로 설정하게 한다. 이 파일의 구문은 다음과 같다.
# Syntax: Each non-comment line of this file contains a snort ID number, and
# the corresponding psad danger level like so: <sid> <danger level>.
위험 수준이 0이라면 psad는 해당 서명 매칭을 무시하고 어떤 경고도 전송하지 않는다. 일부 서명 매칭은 다른 것보다 더 안 좋을 수 있다. 예를 들어 psad가 스노트 규칙 ID 1812(EXPLOIT gobbles SSH exploit attempt)와 매칭되는 트래픽을 탐지 했다면 이는 잠재적으로 스노트 규칙 ID 469(ICMP PING MAP)에 대한 매칭보다 훨씬 더 위험하다. 물론 고블스(Gobbles) SSH 공격의 효과를 제한하는 가장 좋은 전략은 애초에 취약한 SSH 데몬을 실행하지 않는 것이지만 이 공격을 탐지하는 것은 여전히 중요하다. 다음과 같이 스노트 규칙 2284와 매칭되는 IP 주소의 위험 수준을 5로 설정할 수 있다.
### The following example illustrates the syntax for Snort SID 2284
2284 5;
– /etc/psad/ip_options
IP 헤더의 옵션 부분이 IP 통신에서 자주 사용되지는 않지만 iptables는 –log-ip-options 명령 행 인자를 이용해서 IP 옵션을 기록할 수 있다. iptables 로그 메시지가 IP 옵션을 포함하는 경우 psad는 소스 라우팅(source routing) 시도와 같은 수상한 활동에 대해 이 옵션을 구문 분석한다. 일부 스노트 규칙은 IP 옵션의 의심스러운 사용을 정의하며, psad는 iptables 로그 메시지의 IP 옵션을 해석하기 위해 /etc/psad/ip_options 파일을 참조한다. 이 파일은 다음 구문에 따라 일반적으로 사용되는 IP 옵션과 이에 대응되는 식별 번호를 정의한다.
# <option value> <length (-1 for variable)> <ipopts argument> <description>
아래는 이를 활용한 예문이다.
# <option value> <length (-1 for variable)> <ipopts argument> <description>
0 1 eol End of options list
1 1 nop NOP
130 11 sec Security
131 -1 lsrr Loose Source Route
### (lsrre is included in Snort but not documented anywhere else)
132 -1 lsrre Loose Source Route
68 -1 ts Timestamp
– /etc/psad/pf.os
psad는 원격 운영체제를 수동적으로 핑거 프린팅하기 위해 p0f 프로젝트의 OS 데이터베이스를 사용한다. 이 데이터베이스는 psad가 /etc/psad/pf.os 파일에 설치하며, psad는 처음 시작할 때(또는 Psad가 kill 명령어나 psad -H를 통해 중단(hangup)이나 HUP 신호를 받았을 때) 이를 불러온다.
다음은 리눅스에 대한 p0f 핑거프린트의 예다.
# S1:64:0:44:M*:A: Linux:1.2::Linux 1.2.x (XXX quirks support)
512:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x
16384:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x
Imagine you are walking down Broadway after dinner. You have ten minutes to smoke your cigar while deciding whether to see a tragedy or a comedy. Suddenly a hand is laid on your arm. You turn to look into the thrilling eyes of a beautiful woman wearing diamonds and a fur coat. She quickly puts an extremely hot donut in your hand, pulls out a tiny pair of scissors and cuts off the seconds button of your overcoat. The she yells one word, “Parallelogram!” and runs away down a side street.
That would be pure adventure. Would you accept it and run after her? Not you. Your face would turn red with embarrassment. You would drop the donut and continue down Broadway, feeling for your missing button. This is what you would do, unless you are one of the lucky few who still have the spirit of adventure.
True adventurers have always been rare. The ones we read about have been mostly businessmen. They have gone looking for things they wanted – golden fleeces, holy grails, lady loves, treasure, crowns and fame. But the true adventurer goes out without any aim or goal. just to see what happens.
Half-adventurers – brave and impressive people – have been many. They have changed history. But each one of them had a prize to win, a goal to achieve – so they were no true adventurers.
In the big city there are twin spirits called Romance and Adventure. They are always out looking for worthy people. As we walk the streets Romance and Adventure secretly watch us, and they challenge us in many different ways. Without knowing why, we might look up suddenly and see a face in a window – a face that we seem to have known forever. In a sleepy street we hear a cry of agony and fear coming from a dark and empty house. A cabdriver drops us at the wrong door, which is opened with a smile. A piece of paper with writing on it falls down to our feet from a high window. We exchange glances of instant hate, affection, and fear with passing strangers in a crowd. A sudden shower of rain – and our umbrella may be protecting a beautiful woman. At every corner fingers beckon and eyes plead, but all the joyful, mysterious and dangerous clues of adventure pass by us. We grow stiff from routine. Some day we come to the end of a very dull life, and we will then realize that our adventure was a boring one – a marriage or two, an expensive house, and a lifelong battle with a vacuum cleaner.
Rudolph Steiner was a true adventurer. Most evenings he went out in search of the unexpected. To him the most interesting things in life seemed to be around the next corner. He sometimes ended up in strange situations. He had spent two nights in a police station, and he had been robbed several times. But he didn’t care, he kept looking for adventure.
One evening Rudolph was walking down a street in the old part of the city. There were two streams of people. Some were going home, the others were going out.
Rudolph moved easily and watched things closely. He worked as a salesman in a piano store. Well, that was what he did in the daylight. At night he was a young adventurer.
He heard a sudden noise, and saw a pair of false teeth in a glass case. The teeth were opening and closing very quickly. He saw that there was an electric sign above the teeth advertising a dentist. A giant negro, strangely dressed in a red coat, yellow trousers and military cap handed out cards to the passing crowd.
Rudolph had often seen dentist’s cards given out like this. He usually didn’t take one. But the African very skilfully slipped one card into his hand.
When he had travelled a few meters down the street he glanced at the card. One side of the card was blank. On the other was three words written in ink: “The Green Door.” And then Rudolph saw, three steps in front of him, a man throw away the card the negro had given him as he passed. Rudolph picked it up. It was printed with the dentist’s name ad address, and the usual stuff about “fillings” and “braces” and “painless operations.”
The adventurous piano salesman stopped at the street corner. Then he crossed the street, walked back down a block, recrossed the street and joined the stream of people again. He pretended not to notice the negro as he carelessly took a card passed to him. Ten steps later he looked at it. It was the same handwriting that was on the first card. It said, “The Green Door.” Three or four cards were dropped onto the ground by people walking near him. Rudolph picked them up. They were all dental advertisements.
The spirit of acventure had beckoned to Rudolf Steiner twice. He slowly walked back to the place where the negro stood by the case of rattling teeth. This time he was not offered a card. He saw that the African only offered the cards to some people. He did not offer Rudolph another card. In fact, he seemed to give Rudolph a look of cold disapproval.
The look hurt the young adventurer. It felf like a silent accusation that he was not good enough. So he stood back from the people hurrying past, and looked at the building where he thought his adventure must wait.
It was five stories high. A small restaurant was in the basement. The first floor, now closed, was a hat shop. The second floor, by the electric sigh, was the dentist’s. Above this were many signs – of furtunetellers, dressmakers, musicians, and doctors. Still higher there were flats.
Rudolf walked quickly into the building and walked up three flights of carpeted steps. Then he stopped. The hallway was a little dark. He saw a green door. For a moment he hesitated, then he walked straight to the green door and knocked on it.
The moment he spent waiting for the door to open was pure adventrue. What might be waiting for him behind that green door! Danger, death, love or ridiculre?
He heard a soft sound, and the door was slowly opened. A girl of about eighteen or nineteen stood there white-faced and weak. She swayed, then fainted. Rudolph caught her and laid her on an old couch inside. He closed the door and looked around the room. It was neat, but she clearly had little money.
The girl lay still. He began to fan her with his hat. That was successful because he accidentally hit her nose, and she opened her eyes. And then the young man saw that her face was the one he had always been looking for The honest gray eyes, the little nose turned cutley up, and the rich brown hair. It seemed the perfect reward for all his wonderful adventures. But her face was very thin and pale.
The girl looked at him calmly, and then smiled.
“I fainted, didn’t I?” she asked weakly. “Well, I’m not surprised. I haven’t eaten anything for three days.”
“Heavens!” cried Rudolph, jumping up. “Wait till I come back.”
He ran out the green door and down the stairs. In twenty minutes he was back again. He knocked on the door with his toe because both his arms were full of bags of food. He laid the food on the table – bread and butter, cold meat, cakes, pies, pickles, oysters, a roasted chicken, and a bottle of milk.
“It’s ridiculous,” said Rudolph, “to go without eating. Dinner is ready.” He helped her to a chair at the table. “And now, if you’ll allow me to be your guest, we’ll have supper.”
Her eyes shone eagerly and she began to eat. She ate like a cute, starving animal. She seemed to think that it was natural that Rudolph was there with all his food. Gradually, the brightness returned to her eyes, and the color to her face. She began to tell him her little story. It was a very common story in the big city. She had worked in a shop for low wages, became sick and lost her job, then lost her hope. Then came the knock of the adventurer upon the green door.
“You have suffered so much,” exclaimed Rudolph.
“It was terrible,” said the girl, sadly.
“Do you have any friends or relatives in the city?”
“No, not one.”
“I am all alone in the world, too,” said Rudolph.
“I am glad of that,” said the girl quickly. And that pleased Rudolph.
Suddenly her eyelids dropped and she sighed deeply.
“I’m very sleey,” she said, “and I feel so good.”
Rudolph rose and took his hat.
“Then I’ll say good-night,” he said. “A long night’s sleep will be good for you.”
He held out his hand and she took it, and said, “good night.” But her eyes silently asked a direct and hopeful question.
“Oh, I’m coming back tomorrow to see how you are.”
Then she asked, “How did you know to knock at my door?”
He looked at her for a moment, remembering the cards. She must have written on them, because she was desperate for help. He decided he would never tell her the truth, so that she would not be embarrassed.
“One of our piano tuners lives in this building,” he said. “I knocked at your door by mistake.”
The last thing he saw in the room before the green door closed was her smile.
At the top of the stairs he stopped and looked around. He walked to the end of the hallway and back. He went up to the floor above and came dack down. Every door in the building was painted green.
He went outside. The African was still there. Rudolph walked up to him and showd him the two cards in his hand.
“Will you tell me why you gave me these cards and what they mean?” he asked.
The African gave a huge smile. His teeth were like a dental advertisement.
“There it is, boss,” he said, pointing down the street. “But I think you are too late for the first act.”
Rudolph saw a little theater. The electric sign advertised its new play, “The Green Door.”
“I’ve been told it’s an excellent play, sir,” said the African. “The producer gave me a dollar to give out a few of his cards along with the dentist’s. May I offer you one of the dentist’s cards, sir?”
Rudolph went to a bar for a glass of beer and a cigar. When he came out, he stopped in front of a lamppost and said to it:
“All the same, I believe it was Fate that led me to her.”
This conclusion proves that Rudolph Steiner was one of the true followers of Romance and Adventure.