반응형

fortigate automation using rest api python 모듈


늘 누가 만들어둔것에 감사를

조금만 수정해서 쓰거나 기본 양식을 활용하여 만들거나..


굿

반응형

'작업공간 > Tool' 카테고리의 다른 글

paloalto rest api with python  (0) 2020.04.29
안드로이드 디컴파일러(유료)  (2) 2013.02.13
Malware Crawler  (0) 2013.02.12
Retina Free Network Scanner  (2) 2011.04.07
xwodi  (0) 2011.02.28
반응형

paloalto rest api를 사용해서 일단 시스템 리소스 확인하는 거 완성하고

PRTG에 알람 발생시 mattermost 로 incomming webhook에 전송하는걸.. 하려고 했으나..  그게 지원이 좀 힘들어서

arcsight 로 syslog 전송하고 syslog받으면 arcsight에서 내부 sh을 실행하고.. sh 에는 python 파일을 실행하도록 해놓고..

python 은 전달받은 파라메터를 이용하여 mattermost 로 전송

mattermost는 push로 담당자에게 전달..

그리고 다시 또 메세지를 띄우고 incomming webhook으로 다시 전송해서

메세지 분석해서 띄워놓은 python bot에서 추가 rest api를 호출해서 시스템 자원 확인해서 다시 mattermost 에게 전달.. 그 후 다시 담당자에게 push..


일단 여기까지 하려고 하는데

paloalto -> PRTG -> Arcsight -> sh실행 -> python 실행 -> mattermost -> push and incomming webhook -> python bot -> push


paloalto rest api 를 python bot에서 호출해야되니 key 받아서 호출하고.. 필요한 리소스들 가져오는 것까지 짰는데..


python - paloalto rest api module (클릭)


맙소사..

이런게 있었네요...

이미 모듈화가 있었어요 ㅠㅠㅠ 된장....

괜히 고생했어.... ㅠㅠ


[yad2nus@VM mattermost]$ panxapi.py --help

panxapi.py [options] [xpath]

    -d                    delete object at xpath

    -e element            edit XML element at xpath

    -g                    get candidate config at xpath

    -k                    generate API key

    -s                    show active config at xpath

    -S element            set XML element at xpath

    -U cmd                execute dynamic update command

    -C cmd                commit candidate configuration

    --validate            validate candidate configuration

    --force               force commit when conflict

    --partial part        commit specified part

    --sync                synchronous commit

    -A cmd                commit-all (Panorama)

    --ad-hoc query        perform ad hoc request

    --modify              insert known fields in ad hoc query

    -o cmd                execute operational command

    --export category     export files

    --log log-type        retrieve log files

    --report report-type  retrieve reports (dynamic|predefined|custom)

    --name report-name    report name

    --src src             clone source node xpath

                          export source file/path/directory

    --dst dst             move/clone destination node name

                          rename new name

                          export destination file/path/directory

    --move where          move after, before, bottom or top

    --rename              rename object at xpath to dst

    --clone               clone object at xpath, src xpath

    --override element    override template object at xpath

    --vsys vsys           VSYS for dynamic update/partial commit/

                          operational command/report

    -l api_username[:api_password]

    -h hostname

    -P port               URL port number

    --serial number       serial number for Panorama redirection/

                          commit-all/threat-pcap

    --group name          device group for commit-all

    --merge               merge with candidate for commit-all

    --nlogs num           retrieve num logs

    --skip num            skip num logs

    --filter filter       log selection filter

    --interval seconds    log/commit/report job query interval

    --timeout seconds     log/commit/report job query timeout

    --stime time          search time for threat-pcap

    --pcapid id           threat-pcap ID

    -K api_key

    -x                    print XML response to stdout

    -p                    print XML response in Python to stdout

    -j                    print XML response in JSON to stdout

    -r                    print result content when printing response

    --text                print text response to stdout

    -X                    convert text command to XML

    --ls                  print formatted PCAP listing to stdout

    --recursive           recursive export

    -H                    use http URL scheme (default https)

    -G                    use HTTP GET method (default POST)

    -D                    enable debug (multiple up to -DDD)

    -t tag                .panrc tagname

    -T seconds            urlopen() timeout

    --cafile path         file containing CA certificates

    --capath path         directory of hashed certificate files

    --version             display version

    --help                display usage


반응형

'작업공간 > Tool' 카테고리의 다른 글

fortigate automation using rest api python 모듈  (0) 2020.04.30
안드로이드 디컴파일러(유료)  (2) 2013.02.13
Malware Crawler  (0) 2013.02.12
Retina Free Network Scanner  (2) 2011.04.07
xwodi  (0) 2011.02.28

+ Recent posts