檢視次數:
Trend 安全威脅資訊饋送使用符合 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. 確保請求包含這些必要的標頭:
    • Authorization: Bearer <yourvisiononeapitoken>
    • Accept: application/taxii+json; version=2.1
  4. 使用上方區域性 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]
    字串
    按物件類型篩選
    下一步
    字串
    分頁標記以檢索下一頁結果
  5. 請參考以下Python範例進行身份驗證並計算物件。
    套件:
    import requests
    from taxii2client.v21 import Server
    
    DISCOVERY_URL = "<your regional TAXII discovery URL>"
    TOKEN = "<your Vision One API token>"
    
    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
    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"]}')