이벤트 뿌려주는 쪽에서 문제 발생.
버퍼 파싱 관련 부분들을 모두 다시 작성해야 할 것 같다.
이벤트 뿌려주는 쪽에서 문제 발생.
버퍼 파싱 관련 부분들을 모두 다시 작성해야 할 것 같다.
AMI 관련 문자열 파싱문제 발생..
한참을 골머리를 썩이다가 겨우 해결법을 찾은 것 같다.
내일은 strsep() 을 한번 이용해보자.
AST_MODULE undeclared 오류는 asterisk 소스가 없는 상황에서 관련 plugin 들을 컴파일할 때 나타나는 오류이다.
해결을 위해서는..
error AST_MODULE undeclared 관련 에러 발생시… 소스에 다음을 추가하자.
#ifndef AST_MODULE
#define AST_MODULE “app_mymodule”
#endif
하지만, asterisk 소스가 있는 상황에서도 위와 같은 오류가 있다면, makefile 에서 asterisk include 위치를 확인해보자.
dCAA – Digium Certified Asterisk Administrator.
관리자로서의 Asterisk 에 대한 이해도와 사용능력을 평가하는 시험이다.
예전 Asterisk 관련 시험에 대해 알아보면서 알게 되서 등록만 해 놓은채, 시험은 보지 않고 있었다.
왜냐하면.. 그땐 Asterisk 에 대해서 별로 아는게 없었고, 무엇보다 자신감이 없었기 때문이다.
그러다가 오늘 도서관에서 공부하면서 문득 생각이 났다.
지금 아니면 또 언제 해볼 수 있을까?
내친김에 후다닥 시험을 봤다.
온라인으로 문제를 풀 수가 있어서 그때그때마다 검색으로도 답을 찾을 수 있었다.
심지어는 제한시간조차 없었다.
Asterisk 에 대한 기본적인 이해와 관시만 있으면 누구나 풀 수 있을 것 같았다.
그래도 한번씩 헷갈리는 문제가 나오기도 했었다.
그래서일까.. 첫번째 시도는 보기좋게 실패.
하지만 두번째 시도에서는 결국 통과했다. 🙂
아래는 그 결과물~ ㅎㅎㅎ
Asterisk Server 를 생성하고 계속해서 Brute-force Attack 이 들어왔다.
비록 뚫린 흔적은 발견하지 못했지만 계속해서 들어오는 Brute Force Attack 은 내게 계속해서 “방심하면 뚫린다”라는 긴장감을 주었다..
그래서 그 방지책으로 fail2ban 설정을 찾을 수 있었고, 아래의 내용으로 fail2ban 설정 후, 안심할 수 있었다.
Asterisk 관련 fail2ban 스크립트 설정법
jail2ban.conf
logpath 가 약간 이상하게 잡혀있는데, 이는 Freepbx 를 설치해서 기본 로그 파일 경로가 수정되었기 때문이다.
[asterisk-iptables] enabled = true filter = asterisk action = iptables-allports[name=ASTERISK, protocol=all] logpath = /var/log/asterisk/full maxretry = 5 bantime = 259200 findtime = 8640
filter.d/asterisk.conf
# Fail2Ban configuration file
#
#
# $Revision: 250 $
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
#before = common.conf
[Definition]
#_daemon = asterisk
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "<HOST>" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P<host>S+)
# Values: TEXT
#
# Asterisk 1.4 use the following failregex
failregex = NOTICE.* .*: Registration from '.*' failed for '<HOST>' - Wrong password
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Wrong password
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - No matching peer found
NOTICE.* .*: Registration from '.*' failed for '<HOST>' - No matching peer found
NOTICE.* .*: Registration from '.*' failed for '<HOST>' - Username/auth name mismatch
NOTICE.* .*: Registration from '.*' failed for '<HOST>' - Device does not match ACL
NOTICE.* .*: Registration from '.*' failed for '<HOST>' - Peer is not supposed to register
NOTICE.* .*: Registration from '.*' failed for '<HOST>' - ACL error (permit/deny)
NOTICE.* .*: Registration from '.*' failed for '<HOST>' - Device does not match ACL
NOTICE.* <HOST> failed to authenticate as '.*'$
NOTICE.* .*: No registration for peer '.*' (from <HOST>)
NOTICE.* .*: Host <HOST> failed MD5 authentication for '.*' (.*)
NOTICE.* .*: Failed to authenticate user .*@<HOST>.*
NOTICE.* .*: Sending fake auth rejection for device .*<sip:.*@<HOST>>;tag=.*
NOTICE.* .*: Registration from '".*".*' failed for '<HOST>' - No matching peer found
NOTICE.* .*: Registration from '".*".*' failed for '<HOST>:.*' - No matching peer found
NOTICE.* .*: Registration from '".*".*' failed for '<HOST>' - Wrong password
NOTICE.* .*: Registration from '".*".*' failed for '<HOST>:.*' - Wrong password
# In Asterisk 1.8 use the same as above, but after <HOST> add :.* before the single quote. This is because in Asterisk 1.8, the log file includes a port number which 1.4 did not.
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
출처: http://www.voip-info.org/wiki/view/Fail2Ban+%28with+iptables%29+And+Asterisk