Classic環境で利用できます。
Secure Zone Firewallで発生したトラフィックログを照会します。
リクエスト
リクエスト形式を説明します。リクエスト形式は次の通りです。
メソッド | URI |
---|---|
POST | /{type}/{zone}/getTrafficLog |
リクエストヘッダ
Secure Zone APIで共通して使用されるヘッダの詳細は、Secure Zoneのリクエストヘッダをご参照ください。
リクエストパスパラメータ
パラメータの説明は次の通りです。
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
type |
String | Required | Secure Zoneで提供するファイアウォールタイプ
|
zone |
String | Required | Secure Zoneを構成したゾーン
|
リクエストボディ
リクエストボディの説明は次の通りです。
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
action |
String | Optional | 許可するかどうか
|
countPerPage |
Integer | Optional | ページごとの項目数
|
page |
Integer | Optional | ページインデックス
|
fromDate |
Date | Required | 照会期間の開始日 |
toDate |
Date | Required | 照会期間の終了日 |
timeZone |
String | Optional | タイムゾーン
|
destinationIp |
String | Optional | 目的地の IPアドレス |
port |
String | Optional | 目的地のポート番号 |
protocol |
String | Optional | 目的地のプロトコル |
sourceIp |
String | Optional | 出発地の IPアドレス |
リクエスト例
リクエストのサンプルコードは次の通りです。
curl --location --request POST 'https://securezonefirewall.apigw.ntruss.com/api/v2/szfw/kr2/getTrafficLog'
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'x-ncp-mbr_no: {User number}' \
--header 'Content-Type: application/json' \
--data '{
"fromDate": "2024-07-01T00:32:14.953Z",
"toDate": "2024-07-03T04:59:58.525Z"
}'
レスポンス
レスポンス形式を説明します。
レスポンスボディ
レスポンスボディの説明は次の通りです。
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
action |
String | - | リクエストタイプ |
returnCode |
Integer | - | レスポンスコード |
returnMessage |
String | - | レスポンスメッセージ |
totalCount |
Integer | - | トラフィックログの総数 |
trafficLogList[] |
Array | - | トラフィックログ情報 |
trafficLogList[].receiveDate |
Long | - | ログ発生日(Unix timestamp) |
trafficLogList[].sourceIp |
String | - | 出発地 IPアドレス |
trafficLogList[].sourceServerName |
String | - | 出発地サーバの名前 |
trafficLogList[].destinationIp |
String | - | 目的地 IPアドレス |
trafficLogList[].destinationServerName |
String | - | 目的地サーバの名前 |
trafficLogList[].protocol |
String | - | 目的地プロトコル |
trafficLogList[].service |
String | - | サービス |
trafficLogList[].port |
String | - | 目的地ポート番号 |
trafficLogList[].action |
String | - | 許可するかどうか
|
trafficLogList[].policyName |
String | - | ポリシー名 |
レスポンスステータスコード
NAVERクラウドプラットフォームで共通して使用されるレスポンスステータスコードの詳細は、Ncloud APIのレスポンスステータスコードをご参照ください。
レスポンス例
レスポンスのサンプルコードは次の通りです。
{
"action": "getTrafficLog",
"returnCode": 0,
"returnMessage": "success",
"totalCount": 5,
"trafficLogList": [
{
"receiveDate": 1719982292000,
"sourceIp": "***.***.***.***",
"sourceServerName": "",
"destinationIp": "***.***.***.***",
"destinationServerName": "sv-securezone",
"protocol": "TCP",
"service": "SSH",
"port": "22",
"action": "deny",
"policyName": "Policy(Default Deny)"
},
{
"receiveDate": 1719982286000,
"sourceIp": "***.***.***.***",
"sourceServerName": "",
"destinationIp": "***.***.***.***",
"destinationServerName": "sv-securezone",
"protocol": "TCP",
"service": "SSH",
"port": "22",
"action": "deny",
"policyName": "Policy(Default Deny)"
},
{
"receiveDate": 1719982282000,
"sourceIp": "***.***.***.***",
"sourceServerName": "",
"destinationIp": "***.***.***.***",
"destinationServerName": "sv-securezone",
"protocol": "TCP",
"service": "SSH",
"port": "22",
"action": "deny",
"policyName": "Policy(Default Deny)"
},
{
"receiveDate": 1719982281000,
"sourceIp": "***.***.***.***",
"sourceServerName": "",
"destinationIp": "***.***.***.***",
"destinationServerName": "sv-securezone",
"protocol": "TCP",
"service": "SSH",
"port": "22",
"action": "deny",
"policyName": "Policy(Default Deny)"
},
{
"receiveDate": 1719982279000,
"sourceIp": "***.***.***.***",
"sourceServerName": "",
"destinationIp": "***.***.***.***",
"destinationServerName": "sv-securezone",
"protocol": "TCP",
"service": "SSH",
"port": "22",
"action": "deny",
"policyName": "Policy(Default Deny)"
}
]
}