Skip to content

Commit

Permalink
Merge pull request #49 from sophos/updated-the-required-python-versio…
Browse files Browse the repository at this point in the history
…n-3.7-doc-string-changes

Updated the required python version 3.7 doc string changes and added check for minimum supported Python version
  • Loading branch information
ramksophos authored Jul 8, 2021
2 parents 6e7ca6c + b357fd6 commit 8fe38b2
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 18 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#v2.0.1
1. Added check for minimum supported Python version.

# v2.0.0
1. New JWT-based authentication for the SIEM API
- You can now use Sophos Central public [API credentials](https://developer.sophos.com/getting-started) to sync alerts and events from the SIEM API.
Expand All @@ -10,7 +13,7 @@
- We have added a new JSON state file to capture the last sync time for alerts and events.
- Configure the path to the state file in config.ini.
4. Drop support for Python 2.x
- You now need Python 3.5+ to use this tool.
- You now need Python 3.6+ to use this tool.

# v1.1.0
## New Features
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ You can view API Swagger Specification by accessing API Access URL from the acce

### Installation ###

Download and extract from [here](https://github.com/sophos/Sophos-Central-SIEM-Integration/archive/v2.0.0.zip) for the latest release.
Download and extract from [here](https://github.com/sophos/Sophos-Central-SIEM-Integration/archive/v2.0.1.zip) for the latest release.
For older version, please consult the Releases section below.
For changes to the API, please consult the API Updates section below.
The script requires Python 3.5+ to run.
We recommend running this script with the latest version of Python 3.7 or newer. We have tested that this program works with Python 3.6 on multiple platforms. However, support for that version of Python will be dropped when it reaches end-of-life.

#### Releases ####

See [changelog](CHANGELOG.md) for full details.

##### [v2.0.1](https://github.com/sophos/Sophos-Central-SIEM-Integration/archive/v2.0.1.zip) #####
* Added check for minimum supported Python version.

##### [v2.0.0](https://github.com/sophos/Sophos-Central-SIEM-Integration/archive/v2.0.0.zip) #####
* New JWT-based authentication for the SIEM API
Expand Down
2 changes: 1 addition & 1 deletion api_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand Down
6 changes: 3 additions & 3 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
token_info = <Copy API Access URL + Headers block from Sophos Central here>


# Client ID and Client Secret for partner
# Client ID and Client Secret for Partners, Organizations and Tenants
# <Copy Client ID and Client Secret from Sophos Central here>
client_id =
client_secret =
# Customer tenant Id
tenant_id =

# Host URL for Oauth token
auth_url =
auth_url = https://id.sophos.com/api/v2/oauth2/token

# whoami API host url
api_host =
api_host = api.central.sophos.com

# format can be json, cef or keyvalue
format = json
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand Down
5 changes: 3 additions & 2 deletions siem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand All @@ -22,8 +22,9 @@
import name_mapping
import config
import api_client
import vercheck

VERSION = "1.0.0"
VERSION = "2.0.1"
QUIET = False
MISSING_VALUE = "NA"
DEFAULT_ENDPOINT = "event"
Expand Down
2 changes: 1 addition & 1 deletion state.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand Down
4 changes: 2 additions & 2 deletions test_regression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand All @@ -16,7 +16,7 @@
"""
This script is for testing regressions after changes to Sophos SIEM.
Requirements
- Python 3.5+ (ActivePython recommended on Windows)
- Python 3.6+ (ActivePython recommended on Windows)
- pycef module to decode CEF output. (https://github.com/DavidJBianco/pycef/)
There is no equivalent for keyvalue, so that test is expected to fail at least half the time.
- Some typical events in Central.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Unit tests for Sophos SIEM Client.
Requirements
- Python 3.5+ (ActivePython recommended on Windows)
- Python 3.6+ (ActivePython recommended on Windows)
"""

import os
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_name_mapping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_siem.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Unit tests for Sophos SIEM.
Requirements
- Python 3.5+ (ActivePython recommended on Windows)
- Python 3.6+ (ActivePython recommended on Windows)
"""

import os
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_state.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
Expand Down
22 changes: 22 additions & 0 deletions vercheck.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3

# Copyright 2019-2021 Sophos Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing permissions and limitations under the
# License.
#
import sys

REQUIRED_VERSION_MAJOR = 3
REQUIRED_VERSION_MINOR = 6

if not (sys.version_info.major == REQUIRED_VERSION_MAJOR and sys.version_info.minor >= REQUIRED_VERSION_MINOR):
print("Sophos SIEM requires Python %d.%d or higher!" % (REQUIRED_VERSION_MAJOR, REQUIRED_VERSION_MINOR))
print("You are using Python %d.%d." % (sys.version_info.major, sys.version_info.minor))
sys.exit(1)

0 comments on commit 8fe38b2

Please sign in to comment.