檢視次數:
安全威脅資訊饋送使用符合TAXII 2.1標準的表述性狀態轉移(REST)應用程式介面(API)提供即時安全威脅資訊。此API可將精選的結構化安全威脅資料整合到您的安全工作流程和工具中。

步驟

  1. 確保您擁有Trend Vision One API 權杖。請參閱設定安全威脅資訊供應的 API
  2. 識別您區域的 TAXII 2.1 探索 URL。
    地區
    TAXII 提要 URL
    美國
    https://api.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2
    歐盟
    https://api.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2
    新加坡
    https://api.sg.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2
    日本
    https://api.xdr.trendmicro.co.jp/v3.0/threatintel/feeds/taxii2
    澳大利亞
    https://api.au.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2
    印度
    https://api.in.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2
    阿拉伯聯合大公國
    https://api.mea.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2
  3. 使用基本或持有者令牌驗證來驗證所有請求。
    • 基本驗證
      • 用戶名:您的商業ID
        尋找您的商業 ID:
        1. 從個人資料選單中選擇「Business Profile」
        2. 複製註冊商業下的商業 ID。
      • 密碼:your_vision_one_api_token
    • Bearer token 驗證
      • 授權:Bearer <your_vision_one_api_token>
  4. 在每個請求中包含以下 HTTP 標頭:
    • 接受: application/taxii+json;version=2
  5. 使用上方區域性 TAXII 2.1 URL 表格查詢伺服器和 API 根端點。集合 ID 針對特定的安全威脅資料物件。
    • GET <TAXII_DISCOVERY_URL>
    • 檢索 API 根資訊:GET <TAXII_DISCOVERY_URL>/api/collections
    • 列出集合:GET <TAXII_DISCOVERY_URL>/api/collections
    用途
    API 路徑
    URL 參數
    資料防護類型
    參數描述
    伺服器偵測
    GET /taxii2/
    取得 API 根資訊
    GET /taxii2/api/
    取得集合
    GET /taxii2/api/collections/
    取得集合
    GET /taxii2/api/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116
    取得 STIX 物件
    GET /taxii2/api/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/objects/
    新增於
    字串,ISO8601 時間戳記
    僅返回date_added大於指定值的物件
    限制
    字串
    每頁物件數量
    預設:1,000
    最小值:1,000
    最大值:10,000
    比對[id]
    字串
    按特定物件 ID 篩選
    比對[type]
    字串
    按物件類型篩選
    下一步
    字串
    分頁標記以檢索下一頁結果
    取得 STIX 物件
    GET /taxii2/api/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/objects/{object_id}
    新增於
    字串,ISO8601 時間戳記
    僅返回date_added大於指定值的物件
    取得物件清單
    GET /taxii2/api/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/manifest/
    新增於
    字串,ISO8601 時間戳記
    僅返回date_added大於指定值的物件
    限制
    字串
    每頁物件數量
    預設:1,000
    最小值:1,000
    最大值:10,000
    比對[id]
    字串
    按特定物件 ID 篩選
    比對[type]
    字串
    按物件類型篩選
    下一步
    字串
    分頁標記以檢索下一頁結果
  6. 請參考以下Python範例進行身份驗證並計算物件。
    套件:
    import requests
    from taxii2client.v21 import Server
    
    
    DISCOVERY_URL = 'https://api.xdr.trendmicro.com/v3.0/threatintel/feeds/taxii2'  # Please refer to appendix: Trend Micro Threat Intelligence Feed for TAXII Discovery URL
    TOKEN = '...'  # Trend Micro Vision One API Token
    BUSINESS_ID = '...'  # Your Business ID
    
    
    class BearerAuth(requests.auth.AuthBase):
        def __init__(self, token):
            self.token = token
        def __call__(self, r):
            r.headers['Authorization'] = f'Bearer {self.token}'
            return r
    
    # Get Server
    # AuthBasic Authentication
    server = Server(DISCOVERY_URL, user=BUSINESS_ID, password=TOKEN)
    # Bearer Token Authentication
    server = Server(DISCOVERY_URL, auth=BearerAuth(TOKEN))
    print(f'Server title: {server.title}')
    print(f'API Roots: {server.api_roots}')
    
    # Get API Root
    api_root = server.api_roots[0]
    print(f'\nAPI Root title: {api_root.title}')
    
    # Get Collections
    collections = api_root.collections
    print('\nCollections:')
    for col in collections:
        print(f'- {col.title} (id: {col.id})')
    
    # Get Collection
    collection = collections[0]
    # or collection = Collection(f'{DISCOVERY_URL}/api/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/, auth=BearerAuth(TOKEN))
    print(f'\nCollection Info:\nID: {collection.id}\nTitle: {collection.title}')
    
    # Get Manifest
    manifest = collection.get_manifest()
    print(f'\nManifest:\n{json.dumps(manifest, indent=2)}')
    
    # Get a STIX Object
    try:
        empty_object = collection.get_object('object-id')
        print(f'\nSTIX Object (empty):\n{json.dumps(empty_object, indent=2)}')
    except Exception as error:
        print(f'Object is not found: {error}')
    
    # Get STIX Objects (single page)
    objects = collection.get_objects()
    print('\nSTIX Objects:')
    for obj in objects['objects']:
        print(json.dumps(obj, indent=2))
    
    # Get STIX Objects (with match["id"])
    objs_by_id = collection.get_objects(id='campaign--8e3e4a78-1b6c-4b4c-97c0-d90f5fcbdc12')
    print(f'\nSTIX Objects (with match["id"]):\n{json.dumps(objs_by_id, indent=2)}')
    
    # Get STIX Objects (with match["type"])
    objs_by_type = collection.get_objects(type='campaign')
    print(f'\nSTIX Objects (with match["type"]):\n{json.dumps(objs_by_type, indent=2)}')
    
    # Get STIX Objects (with as_pages)
    print('\nSTIX Objects (as_pages):')
    yesterday = datetime.datetime.now() - datetime.timedelta(days=1)
    for i, bundle in enumerate(as_pages(collection.get_objects, added_after=yesterday, per_request=1000), 1):
        print(f'Page {i}: {len(bundle["objects"])} {bundle["objects"][-1]["created"]}')