アプリケーション マッピング

10.0.1 では、アプリケーション マッピング API がサポートされています。
nfa1000
Network Flow Analysis
10.0.1 では、アプリケーション マッピング API がサポートされています。
アプリケーション マッピングを使用すると、すべてのエンティティとその相互依存関係を検出およびマップできます。
Network Flow Analysis
は、ToS、ホスト、およびサブネット アプリケーションをサポートしています。アプリケーション マッピング API を使用すると、以下の方法でエンティティを管理できます。
アプリケーション マッピング
単一エンティティの読み取り
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMappings_Id)
メソッド
GET
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings(108)
サンプル レスポンス
{ "@odata.context": "$metadata#applicationMappings",
"protocol": -1,
"description": "11",
"nbar2EngineId": -1,
"endPort": -1,
"nbar2ApplicationId": -1,
"Name": "test",
"ip": "127.0.0.1",
"tos": 12,
"newPort": 11,
"mask": 0,
"ruleType": "Tos",
"ID": 108,
"beginPort": -1
}
一括エンティティの読み取り
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
メソッド
GET
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル レスポンス
{ "@odata.context": "http://localhost:8981/odata/api/$metadata#applicationMappings",
"value":
[
{
"protocol": -1,
"description": "11",
"nbar2EngineId": -1,
"endPort": -1,
"nbar2ApplicationId": -1,
"Name": "test",
"ip": "127.0.0.1",
"tos": 12,
"newPort": 11,
"mask": 0,
"ruleType": "Tos",
"ID": 108,
"beginPort": -1 },
{ "protocol": -1,
"description": "",
"nbar2EngineId": -1,
"endPort": -1,
"nbar2ApplicationId": -1,
"Name": "test",
"ip": "127.0.0.1",
"tos": 1,
"newPort": 11,
"mask": 0,
"ruleType": "Tos",
"ID": 109,
"beginPort": -1
}
]
}
ToS (サービスのタイプ)の作成
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
メソッド
POST
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the application mapping name>",
"newPort" : "<Enter a value between 0 and 65535>",
"tos" : "<Enter the ToS>"
}
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル ペイロード
{
"ruleType" : "All",
"Name" : "Tes1t",
"newPort" :23457,
"tos" : 66
}
サンプル レスポンス
{
"@odata.context": "$metadata#applicationMappings",
"ID": 150,
"description": null,
"protocol": null,
"tos": 66,
"ip": null,
"mask": null,
"beginPort": null,
"endPort": null,
"newPort": 23457,
"nbar2EngineId": null,
"nbar2ApplicationId": null,
"ruleType": "All",
"Name": "Tes1t"
}
ホストの作成
パラメータに値を割り当てる場合は、以下の条件を考慮します。
  • beginPort が -1 である場合、TOS およびプロトコルを -1 に設定する必要があります。
  • beginPort が -1 ではない場合、TOS を -1 ~ 255 の間に設定し、プロトコルを 6 (TCP の場合)または 7 (UDP の場合)にする必要があります。
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
メソッド
POST
例 1
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the application mapping name>",
"newPort" : "<Enter a value between 0 and 65535>",
"beginPort" : "<Enter a value between -1 and 255>>",
"tos" : "<Enter a value between -1 and 255>",
"protocol" : "<Enter-1>",
"ip" : "<Enter the Host IP address>"
}
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル ペイロード
{
"ruleType" : "Host",
"Name" : "Test22",
"newPort" :123,
"beginPort" :-1,
"tos" : -1,
"protocol" : -1,
"ip" : "127.0.0.1"
}
サンプル レスポンス
{
"@odata.context": "$metadata#applicationMappings",
"ID": 152,
"description": null,
"protocol": -1,
"tos": -1,
"ip": "127.0.0.1",
"mask": null,
"beginPort": -1,
"endPort": null,
"newPort": 123,
"nbar2EngineId": null,
"nbar2ApplicationId": null,
"ruleType": "Host",
"Name": "Test22"
}
例 2
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the rule name>",
"newPort" : "<Enter a value between 0 and 65535>",
"beginPort" : "<Enter a value between 0 and 65535>",
"tos" : "<Enter a value between -1 and 255>",
"protocol" : "<Enter 6 or 17>",
"ip" : "<Enter the Host IP address>"
}
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル ペイロード
{
"ruleType" : "Host",
"Name" : "Test211",
"newPort" :888,
"beginPort" :211,
"tos" : -1,
"protocol": 6,
"ip": "127.0.0.1"
}
サンプル レスポンス
{
"ID": 155,
"description": null,
"protocol": 6,
"tos": -1,
"ip": "127.0.0.1",
"mask": null,
"beginPort": 211,
"endPort": null,
"newPort": 888,
"nbar2EngineId": null,
"nbar2ApplicationId": null,
"ruleType": "Host",
"Name": "Test211"
}
サブネットの作成
プロトコル値は、TCP タイプのサブネット アプリケーション マッピングの場合には 6、UDP の場合には 17 にする必要があります。
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
メソッド
POST
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the application mapping name>",
"newPort" : "<Enter a value between 0 and 65535>",
"beginPort" : "<Enter a value between 0 and 65535>",
"endPort" : "<Enter a value between 0 and 65535>",
"protocol" : "<Enter 6 or 17>",
"ip" : "<Enter the Host IP address>"
"mask": "<Enter a value between 0 and 32>"
}
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル ペイロード
{
"ruleType" : "Subnet",
"Name" : "Test4",
"newPort" :23411,
"beginPort" :255,
"endPort" : 255,
"protocol": 6,
"ip": "127.0.0.1",
"mask": 22
}
サンプル レスポンス
{
"@odata.context": "$metadata#applicationMappings",
"ID": 156,
"description": null,
"protocol": 6,
"tos": null,
"ip": "127.0.0.1",
"mask": 22,
"beginPort": 255,
"endPort": 255,
"newPort": 23411,
"nbar2EngineId": null,
"nbar2ApplicationId": null,
"ruleType": "Subnet",
"Name": "Test4"
}
ToS (サービスのタイプ)の編集
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMappings_id)
メソッド
PATCH
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the application mapping name>",
"newPort" : "<Enter a value between 0 and 65535>",
"tos" : "<Enter the ToS>"
}
サンプル リクエスト
{
"ruleType" : "All",
"Name" : "Tes1t",
"newPort" :23457,
"tos" : 66
}
サンプル レスポンス
この API に対するレスポンスはありません。
ホストの編集
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMapping_id)
メソッド
PATCH
例 1
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the application mapping name>",
"newPort" : "<Enter a value between 0 and 65535>",
"beginPort" : "<Enter a value between -1 and 255>>",
"tos" : "<Enter a value between -1 and 255>",
"protocol" : "<Enter-1>",
"ip" : "<Enter the Host IP address>"
}
サンプル リクエスト
{
"ruleType" : "Host",
"Name" : "Test22",
"newPort" :23457,
"beginPort" :-1,
"tos" : -1,
"protocol" : -1,
"ip" : "127.0.0.1"
}
サンプル レスポンス
この API に対するレスポンスはありません。
例 2
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the rule name>",
"newPort" : "<Enter a value between 0 and 65535>",
"beginPort" : "<Enter a value between 0 and 65535>",
"tos" : "<Enter a value between -1 and 255>",
"protocol" : "<Enter 6 or 17>",
"ip" : "<Enter the Host IP address>"
}
サンプル リクエスト
{
"ruleType" : "Host",
"Name" : "Test2",
"newPort" :23457,
"beginPort" :255,
"tos" : -1,
"protocol": 6,
"ip": "127.0.0.1"
}
サンプル レスポンス
この API に対するレスポンスはありません。
サブネットの編集
プロトコル値は、TCP タイプのサブネット アプリケーション マッピングの場合には 6、UDP の場合には 17 にする必要があります。
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMapping_id)
メソッド
PATCH
ペイロード
{
"ruleType" : "<Enter the rule type>",
"Name" : "<Enter the application mapping name>",
"newPort" : "<Enter a value between 0 and 65535>",
"beginPort" : "<Enter a value between 0 and 65535>",
"endPort" : "<Enter a value between 0 and 65535>",
"protocol" : "<Enter 6 or 17>",
"ip" : "<Enter the Host IP address>"
"mask": "<Enter a value between 0 and 32>"
}
サンプル リクエスト
{
"ruleType" : "Subnet",
"Name" : "Test4",
"newPort" :23411,
"beginPort" :255,
"endPort" : 255,
"protocol": 6,
"ip": "127.0.0.1",
"mask": 22
}
サンプル レスポンス
この API に対するレスポンスはありません。
単一エンティティの削除
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMappings_id)
メソッド
DELETE
ペイロード
{
"ApplicationMapping_Id": [<Enter id of the application mapping that should be deleted>]
}
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings(108)
サンプル レスポンス
この API に対するレスポンスはありません。
一括エンティティの削除
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings/com.ca.nfa.odata.removeApplicationMappings
メソッド
POST
ペイロード
{
ApplicationMappingIds: [<Enter the list of ApplicationMapping_Ids separated by a comma>]
}
サンプル リクエスト
以下のリクエストは、アプリケーション マッピング エンティティの一括削除を示しています。
http://127.0.0.1:8080/odata/api/routers/com.ca.nfa.odata.removeApplicationMappings
サンプル ペイロード
{ "ApplicationMappingIds":[4, 5] }
サンプル レスポンス
{
"@odata.context": "$metadata#Collection(com.ca.nfa.odata.applicationMappings)",
"value": [
{
"ID": 4,
"description": "",
"protocol": -1,
"tos": 123,
"ip": "127.0.0.1",
"mask": 0,
"beginPort": -1,
"endPort": -1,
"newPort": 125,
"nbar2EngineId": -1,
"nbar2ApplicationId": -1,
"ruleType": "All",
"Name": "locus-map"
},
{
"ID": 5,
"description": "",
"protocol": -1,
"tos": 124,
"ip": "127.0.0.1",
"mask": 0,
"beginPort": -1,
"endPort": -1,
"newPort": 125,
"nbar2EngineId": -1,
"nbar2ApplicationId": -1,
"ruleType": "All",
"Name": "ftp"
}
]
}
事前定義済みアプリケーション マッピング
事前定義済みアプリケーション マッピングをすべて取得するには、事前定義済みアプリケーション マッピング API を使用します。
単一エンティティの読み取り
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/predefinedApplicationMappings
メソッド
GET
ペイロード
None
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル レスポンス
{ "@odata.context": "http://127.0.0.1:8981/odata/api/$metadata#predefinedApplicationMappings", "value": [ { "newPort": 0, "Description": "TCP Fragments", "Name": "fragment", "ID": 630, "portType": "tcp" }, { "newPort": 1, "Description": "TCP Port Service Multiplexer Port", "Name": "tcpmux", "ID": 68, "portType": "tcp" }, { "newPort": 2, "Description": "Remote Job Entry Protocol", "Name": "rje", "ID": 69, "portType": "tcp" }, { "newPort": 3, "Description": "Compression Process", "Name": "compressnet", "ID": 634, "portType": "tcp" }, { "newPort": 5, "Description": "Remote Job Entry", "Name": "rje", "ID": 636, "portType": "tcp" }, { "newPort": 7, "Description": "Echo Protocol", "Name": "echo", "ID": 70, "portType": "tcp" }, { "newPort": 9, "Description": "Discard Protocol", "Name": "discard", "ID": 72, "portType": "tcp" }, { "newPort": 11, "Description": "Active Users Protocol", "Name": "systat", "ID": 74, "portType": "tcp" }, { "newPort": 13, "Description": "Daytime Protocol", "Name": "daytime", "ID": 76, "portType": "tcp" }, { "newPort": 17, "Description": "Quote of the Day Protocol", "Name": "qotd", "ID": 78, "portType": "tcp" } ], "@odata.nextLink": "http://127.0.0.1:8981/odata/api/predefinedApplicationMappings?$skiptoken=10" }
NBAR2 アプリケーション マッピング ルールの作成
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
メソッド
POST
ペイロード
{ "ruleType": "<Enter the rule type>", "Name": "<Enter the application mapping name>", "Description": "<Enter the mapping description>", "nbar2EngineId": <Enter the NBAR2 Engine ID>, "nbar2ApplicationId": <Enter the NBAR2 Application ID>, "newPort": <Enter a value between 0 and 65535> }
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings
サンプル ペイロード
{ "ruleType": "NBAR2", "Name": "NBAR2_NBAR2", "Description": "NBAR2_NBAR2", "nbar2EngineId": 13, "nbar2ApplicationId": 664421, "newPort": 32324 }
サンプル レスポンス
{ "@odata.context": "$metadata#applicationMappings", "ID": 1, "Description": "NBAR2_NBAR2", "protocol": null, "tos": null, "ip": null, "mask": null, "beginPort": null, "endPort": null, "newPort": 32324, "nbar2EngineId": 13, "nbar2ApplicationId": 664421, "ruleType": "NBAR2", "Name": "NBAR2_NBAR2" }
NBAR2 アプリケーション マッピング ルールの編集
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(NBar2Application_ID)
メソッド
PATCH
ペイロード
{ "ruleType": "<Enter the rule type>", "Name": "<Enter the application mapping name>", "Description": "<Enter the mapping description>", "nbar2ApplicationId": <Enter the NBAR2 Application ID> }
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings(1)
サンプル ペイロード
{ "ruleType": "NBAR2", "Name": "NBAR2_NBAR2_EDIT", "Description": "NBAR2_NBAR2_EDIT", "nbar2ApplicationId": 664422 }
サンプル レスポンス
この API に対するレスポンスはありません。
単一のポート トラフィック ステータスの取得
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings/com.ca.nfa.odata.PortTrafficStatus(port=<port number>)
メソッド
GET
サンプル リクエスト
http://127.0.0.1:8981/odata/api/applicationMappings/com.ca.nfa.odata.PortTrafficStatus(port=161)
サンプル レスポンス
{ "@odata.context": "http://127.0.0.1:8981/odata/api/$metadata#com.ca.nfa.odata.portTrafficStatus", "PortName": "snmp" }