반응형

출처: http://simplelife.pe.kr/tc/286

 

전에 Activx 를 웹에 올려놨을때 나왔던 문제였는데
링크로 cab 파일을 클릭하면 파일 다운로드가 되어야 하는데
웹에 그냥 text파일인양 열릴때가 있다

그럴때는 아파치 설정 폴더에 보면
mime.types 파일이 있다
이 파일에 보면 아래와 같은 줄일 있을거다
없다면
새로 항목을 만들면 만들면 된다.

application/octet-stream        bin dms lha lzh exe class so dll dmg



위에 웹에 그냥 화면이 풀리는 확장자를 등록하고
아파치를 재시작하면
링크 클릭시에 파일다운로드 받는 창이 뜨는걸 볼수가 있을것이다

반응형
반응형

출처: http://jentalkstoomuch.blogspot.kr/2010/09/writing-custom-ossec-rules-for-your.html

http://ossec-docs.readthedocs.org/en/latest/manual/rules-decoders/create-custom.html

 

 

 

LIDS.pdf

 

 

디코더 설정전

# /var/ossec/bin/ossec-logtest
2013/11/01 10:39:07 ossec-testrule: INFO: Reading local decoder file.
2013/11/01 10:39:07 ossec-testrule: INFO: Started (pid: 32109).
ossec-testrule: Type one log per line.

2013-11-01T10:01:04.600374-04:00 arrakis ossec-exampled[9123]: test connection from 192.168.1.1 via test-protocol1

 

**Phase 1: Completed pre-decoding.
       full event: '2013-11-01T10:01:04.600374-04:00 arrakis ossec-exampled[9123]: test connection from 192.168.1.1 via test-protocol1'
       hostname: 'arrakis'
       program_name: 'ossec-exampled'
       log: 'test connection from 192.168.1.1 via test-protocol1'

**Phase 2: Completed decoding.
       No decoder matched.

 

 

 

 

디코더 설정후

/var/ossec/etc/decoder.xml

 

위 파일에 디코더 룰 설정해야 함

 

<decoder name="ossec-exampled">
  <program_name>ossec-exampled</program_name>
</decoder>

 

2013-11-01T10:01:04.600374-04:00 arrakis ossec-exampled[9123]: test connection from 192.168.1.1 via test-protocol1

**Phase 1: Completed pre-decoding.
       full event: '2013-11-01T10:01:04.600374-04:00 arrakis ossec-exampled[9123]: test connection from 192.168.1.1 via test-protocol1'
       hostname: 'arrakis'
       program_name: 'ossec-exampled'
       log: 'test connection from 192.168.1.1 via test-protocol1'

**Phase 2: Completed decoding.
       decoder: 'ossec-exampled'

 

 

 

 

 

 

 

디코더 상세 설정 후

<decoder name="ossec-exampled-test-connection">
  <parent>ossec-exampled</parent>
  <prematch offset="after_parent">^test connection </prematch> <!-- offset="after_parent" makes OSSEC ignore anything matched by the parent decoder and before -->
  <regex offset="after_prematch">^from (\S+) via (\S+)$</regex> <!-- offset="after_prematch" makes OSSEC ignore anything matched by the prematch and earlier-->
  <order>srcip, protocol</order>
</decoder>
다음과 같이 수정 후 로그를 보면.. 다음과 같다.

 

# /var/ossec/bin/ossec-logtest
2013/11/01 11:03:25 ossec-testrule: INFO: Reading local decoder file.
2013/11/01 11:03:25 ossec-testrule: INFO: Started (pid: 6290).
ossec-testrule: Type one log per line.

2013-11-01T10:01:04.600374-04:00 arrakis ossec-exampled[9123]: test connection from 192.168.1.1 via test-protocol1


**Phase 1: Completed pre-decoding.
       full event: '2013-11-01T10:01:04.600374-04:00 arrakis ossec-exampled[9123]: test connection from 192.168.1.1 via test-protocol1'
       hostname: 'arrakis'
       program_name: 'ossec-exampled'
       log: 'test connection from 192.168.1.1 via test-protocol1'

**Phase 2: Completed decoding.
       decoder: 'ossec-exampled'
       srcip: '192.168.1.1'
       proto: 'test-protocol1'

반응형
반응형

출처: https://groups.google.com/forum/#!topic/fluentd/aotQAmHlTUY

 

ossec.conf:

<syslog_output>
 
<server>192.168.33.29</server>
 
<port>514</port>
 
<level>1</level>
 
<format>json</format>
</syslog_output>

 

 ossec.conf 설정후 아래 명령어를 입력해주어야 한다.

 

/var/ossec/bin/ossec-control enable client-syslog

/var/ossec/bin/ossec-control restart

 

 

위의 명령어만 실행시켜준다면 192.168.33.29 port514 로 syslog가 던져지게 된다.

던져진 syslog를 가공시킬때 fluentd를 이용할 수 있는데 설정 방법은 아래와 같다.

 

 


td-agent.conf

<source>
  type syslog
  port 514
  bind 0.0.0.0
  tag ossec
</source>

<match ossec.**>
  type parser
  key_name message
  format json
  reserve_data yes
  tag elasticsearch.ossec
</match>

 

2014-10-02 02:48:41 +0000 out.ossec: {"host":"natha","ident":"ossec","message":"Integrity checksum changed for: '/etc/td-agent/conf.d/01ossec.conf'","crit":7,"id":551,"component":"natha->syscheck","classification":" ossec,syscheck,","description":"Integrity checksum changed again (2nd time).","file":"/etc/td-agent/c
onf.d/01ossec.conf"
,"md5_old":"'c140e56819d80a855ac3bdf199edc7ac'","md5_new":"'225b664140960fb8c982032a79f54e11'","sha1_old":"'ab9ccbf5a6e4fe95b954b9b991520cce15eb1370'","sha1_new":"'ade1d88272ff4f2075bfc7a511cb22e9e5b91372'"}

반응형
반응형

 

 

 

 

 

 

 

 

 

반응형

+ Recent posts