そして、このPulseのページ右上の「Download」からCSVやOpenIOC、STIX等の形式でダウンロードできるが、PulseをPrivateにした場合はログイン状態でないとダウンロードできない(Pulse not foundとなった)ため、APIからのアクセスが必要。APIを使って取得するには以下のようにする。
普通にPythonスクリプトを書いてももちろん実行できるのでそこは適宜。 In [n]とかOut [n]というところはipythonのプロンプトなのでコードではありませんのでご注意を。
$ ipython3
Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from OTXv2 import OTXv2, IndicatorTypes
In [2]: otx = OTXv2("================= ここにAPIキーを入れる =================")
In [3]: iocs = otx.get_pulse_indicators("==== Pulse ID を入れる ====")
In [14]: [ioc["indicator"] for ioc in iocs if ioc["type"] == "IPv4"]
Out[14]: ['195.8.66.1']
IoC TypeがdomainのIoCのみ取得
In [15]: [ioc["indicator"] for ioc in iocs if ioc["type"] == "domain"]
Out[15]:
['alucmuhendislik.com',
'atlantarecyclingcenters.com',
'hexacam.com',
'hgssyouth.com',
'miamirecyclecenters.com']
```
IoC TypeがhostnameのIoCのみ取得
In [16]: [ioc["indicator"] for ioc in iocs if ioc["type"] == "hostname"]
Out[16]:
['www.hexacam.com',
'www.miamirecyclecenters.com',
'www.atlantarecyclingcenters.com',
'www.hgssyouth.com',
'www.alucmuhendislik.com']
TypeがURLのIoCのみ取得
In [17]: [ioc["indicator"] for ioc in iocs if ioc["type"] == "URL"]
Out[17]:
['http://www.miamirecyclecenters.com/UYGjkdsc82R/UYGjkdsc82R/UYGjkdsc82R/UYGjkdsc82R/UYGjkdsc82R/UYGjkdsc82R/UYGjkdsc82R/UYGjkdsc82',
'http://alucmuhendislik.com/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf',
'http://alucmuhendislik.com/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf3/njhgftrf',
In [19]: [ioc["indicator"].replace(".", "[.]") for ioc in iocs if ioc["type"] == "hostname"]
Out[19]:
['www[.]hexacam[.]com',
'www[.]miamirecyclecenters[.]com',
'www[.]atlantarecyclingcenters[.]com',
'www[.]hgssyouth[.]com',
'www[.]alucmuhendislik[.]com']
python
In [22]: for typename in set([ioc["type"] for ioc in iocs]):
...: with open("{}.txt".format(typename), "w") as out:
...: out.write("\n".join([ioc["indicator"] for ioc in iocs if ioc["type"] == typename]))
...:
"We've investigated the Vault 8 report and confirm the certificates in our name are fake. Our customers, private keys and services are safe and unaffected" (Eugene Kaspersky)
IDNの仕組みを使うとさらに巧妙になり、たとえばロシア語キリル文字の「а, с, е, о, р, х, у」は、英字アルファベットの「a, c, e, o, p, x, y」と見た目が酷似している。 ordでUnicodeのコードポイントを見てみると「а」は1072、「a」は97であることがわかる。
In [27]: ord("a")
Out[27]: 97
In [26]: ord("а")
Out[26]: 1072
さてこの「а」を活用したIDNを作ると、こうなる。
fаcebook.com
はいわからない。こりゃわからない。それではこれをPunycodeで変換してみると・・・
In [29]: "fаcebook.com".encode("idna")
Out[29]: b'xn--fcebook-2fg.com'
Community Editionで想定されているうちの最も重要なのはおそらくAppの開発なのではないかと。サードパーティーベンダにガンガンAppを開発してもらう環境を提供するという意味が大きいのではないかと予想。または新規ユーザー参入狙いか。まぁ、そのへんは、気にしないでいいか。この手の製品で無償版が提供されているものはほぼ、ない(Splunkは少量なら無償でログサーチだけは使えるもののEnterprise Security Appが使えるわけではないので)ため、業界というか、競合としてはなんだか焦りますよね。
QRadar Community Editionのダウンロードにはユーザー登録が必要。ログイン済なセッションがあった気がするので正直ちょっとよくわからなかったけどおそらくIBM IDの登録は必要で、Community Editionのダウンロードにはさらに追加情報の登録が必要、という感じか。それ自体は難しい手順ではなかった。これが必要ですと言われたら入力して進んでいけば特に問題なくダウンロードまでいけるはず
DSM(=Device Support Module、各種ログをパース、正規化してQRadarに取り込むモジュール)が、大量にあるがCommunity Editionではデフォルトで一部しか有効になっていない。必要に応じて後で自分で追加する必要がある。これは要求スペックを下げるためなのかインストーラーのサイズを小さくするためなのかわからないがおそらくそういうことだろう。まあ限られたものしか使わないだろうからまったくもって構わないのだけど。
どんな機器(ログ)のDSMがあるのか、および、どうやって設定を行うのか(または設定が必用ないのか)の情報は、 IBM Security QRadar SIEM DSM Configuration Guide に載っている。
Myricaフォントにはいろいろな種類が入っているのですが、どうもSublime Text 3ではMyricaM M以外は半角スペースが全角サイズのスペースになってしまうようで、読みづらい、本当に全角が入ってしまった時との違いがわからない、などプログラムのバグにすらなり得るため、ここはかなり重要で、"MyricaM M"を指定するのが現在のところは吉のようです。
Help on class Counter in module collections:
class Counter(builtins.dict)
| Dict subclass for counting hashable items. Sometimes called a bag
| or multiset. Elements are stored as dictionary keys and their counts
| are stored as dictionary values.