diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2bf613a..e7209ca 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,10 +8,10 @@ jobs: steps: - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.x" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 45c1bc5..3131861 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' diff --git a/cefevent/event.py b/cefevent/event.py index 69cfe1c..686cd68 100644 --- a/cefevent/event.py +++ b/cefevent/event.py @@ -48,8 +48,20 @@ def load(self, headers: List[AnyStr], fields: List[Any]): def _validate_field_value(self, field: AnyStr, value: Any): obj = self._reverse_extension_dictionary[field] + # Handle special case of ports + if obj["full_name"].endswith("Port"): + try: + value = int(value) + except: + return False + if not 0 <= value <= 65535: + return False + return value + for dt in obj["data_type"]: if dt in ["Integer", "Long"]: + if dt == "Integer" and value > 2**31-1: + continue try: return int(value) except: diff --git a/setup.py b/setup.py index a11cc73..3b31835 100644 --- a/setup.py +++ b/setup.py @@ -8,13 +8,13 @@ setup( name="cefevent", packages=["cefevent"], - version="0.5.4", + version="0.5.6", description="ArcSight Common Event Format library", long_description=long_description, long_description_content_type="text/markdown", - author="Kamus Hadenes", + author="Henrique Goncalves", author_email="kamus@hadenes.io", url="https://github.com/kamushadenes/cefevent", - download_url="https://github.com/kamushadenes/cefevent/tarball/0.5.4", + download_url="https://github.com/kamushadenes/cefevent/tarball/0.5.6", keywords=["logging", "cef", "arcsight", "event", "security"], )