コード例 #1
0
def test_get_detects():
    """ searches for the latest detection ID """

    crowdstrike = CrowdstrikeAPI(CLIENT_ID, CLIENT_SECRET)
    response = crowdstrike.get_detects(offset=0, limit=1)
    logger.debug(response)
    assert not response.get('errors')
    # should work, unless you've never had a detection on your account, which would be surprising ^_^
    assert response.get('resources')
コード例 #2
0
def test_get_detections():
    """ pulls information on the last five detections """
    crowdstrike = CrowdstrikeAPI(CLIENT_ID, CLIENT_SECRET)

    response = crowdstrike.get_detects(offset=0, limit=5)
    ids = response.get('resources')
    assert ids

    response = crowdstrike.get_detections(ids=ids)
    logger.debug(response)
    assert not response.get('errors')
    # should work, unless you've never had a detection on your account, which would be surprising ^_^
    assert response.get('resources')