From 1087e221e3fea23b2525e6983febf41eca224737 Mon Sep 17 00:00:00 2001 From: Dan Dye Date: Wed, 6 May 2026 20:14:49 -0400 Subject: [PATCH 1/3] chore: update copyright year to 2026 in python files and pre-commit config --- .license-header.txt | 2 +- .pre-commit-config.yaml | 2 +- docs/conf.py | 2 +- src/logstory/__init__.py | 2 +- src/logstory/auth.py | 2 +- src/logstory/ingestion.py | 2 +- src/logstory/logstory.py | 2 +- src/logstory/main.py | 2 +- src/logstory/usecases/NETWORK_ANALYSIS/__init__.py | 14 ++++++++++++++ src/logstory/usecases/__init__.py | 14 ++++++++++++++ tests/analyze_all_timestamps.py | 2 +- tests/test_auth.py | 2 +- tests/test_change_map_implementation.py | 2 +- tests/test_double_update_fix.py | 2 +- tests/test_group_only_replacement.py | 2 +- tests/test_logstory.py | 2 +- tests/test_main.py | 2 +- tests/test_sysmon_pattern_edge_cases.py | 2 +- tests/test_timestamp_patterns.py | 2 +- tests/test_windows_sysmon_patterns.py | 2 +- tests/test_yaml.py | 8 ++++---- tests/timestamp_extractor.py | 2 +- usecases/generate_usecase_docs.py | 2 +- 23 files changed, 52 insertions(+), 24 deletions(-) diff --git a/.license-header.txt b/.license-header.txt index b8b57d1..274f837 100644 --- a/.license-header.txt +++ b/.license-header.txt @@ -1,4 +1,4 @@ -Copyright 2025 Google LLC +Copyright 2026 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 146d1a0..fbf476d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -151,7 +151,7 @@ repos: rev: v2.4.1 hooks: - id: codespell - args: ['--skip', '*.zip,*.log,*.json', '--ignore-words-list', 'crate,ans,ect,hist,nd'] + args: ['--skip', '*.zip,*.log,*.json', '--ignore-words-list', 'crate,ans,ect,hist,nd,thw'] exclude: '^(\.git/|__pycache__|\.egg-info|dist/|build/|docs/_build/)' # YAML validation specific to our timestamp configs diff --git a/docs/conf.py b/docs/conf.py index f6639ed..1000df1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/__init__.py b/src/logstory/__init__.py index 862d3ce..e3e3ee7 100644 --- a/src/logstory/__init__.py +++ b/src/logstory/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/auth.py b/src/logstory/auth.py index 9b699b7..75055bd 100644 --- a/src/logstory/auth.py +++ b/src/logstory/auth.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/ingestion.py b/src/logstory/ingestion.py index fa5fde6..0e260c6 100644 --- a/src/logstory/ingestion.py +++ b/src/logstory/ingestion.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/logstory.py b/src/logstory/logstory.py index e7228fe..9b4ce18 100644 --- a/src/logstory/logstory.py +++ b/src/logstory/logstory.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/main.py b/src/logstory/main.py index 00d7816..2719eee 100644 --- a/src/logstory/main.py +++ b/src/logstory/main.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py b/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py index e69de29..a087f1b 100644 --- a/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py +++ b/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2026 Google LLC +# +# 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. + diff --git a/src/logstory/usecases/__init__.py b/src/logstory/usecases/__init__.py index e69de29..a087f1b 100644 --- a/src/logstory/usecases/__init__.py +++ b/src/logstory/usecases/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2026 Google LLC +# +# 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. + diff --git a/tests/analyze_all_timestamps.py b/tests/analyze_all_timestamps.py index 150faff..52ca1c9 100755 --- a/tests/analyze_all_timestamps.py +++ b/tests/analyze_all_timestamps.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_auth.py b/tests/test_auth.py index 8943750..3a79d03 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_change_map_implementation.py b/tests/test_change_map_implementation.py index 83a5f76..0b32baf 100644 --- a/tests/test_change_map_implementation.py +++ b/tests/test_change_map_implementation.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_double_update_fix.py b/tests/test_double_update_fix.py index 862cde3..7a863f5 100644 --- a/tests/test_double_update_fix.py +++ b/tests/test_double_update_fix.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_group_only_replacement.py b/tests/test_group_only_replacement.py index d99fbfc..ce54dd1 100644 --- a/tests/test_group_only_replacement.py +++ b/tests/test_group_only_replacement.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_logstory.py b/tests/test_logstory.py index c37e93b..f8cb6d9 100644 --- a/tests/test_logstory.py +++ b/tests/test_logstory.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_main.py b/tests/test_main.py index 12e8d79..ef36e9b 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_sysmon_pattern_edge_cases.py b/tests/test_sysmon_pattern_edge_cases.py index 1f92e2c..0dd88be 100644 --- a/tests/test_sysmon_pattern_edge_cases.py +++ b/tests/test_sysmon_pattern_edge_cases.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_timestamp_patterns.py b/tests/test_timestamp_patterns.py index ac6584d..3f927ea 100755 --- a/tests/test_timestamp_patterns.py +++ b/tests/test_timestamp_patterns.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_windows_sysmon_patterns.py b/tests/test_windows_sysmon_patterns.py index a9aebab..e0978db 100644 --- a/tests/test_windows_sysmon_patterns.py +++ b/tests/test_windows_sysmon_patterns.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test_yaml.py b/tests/test_yaml.py index 5d05e5c..44561aa 100644 --- a/tests/test_yaml.py +++ b/tests/test_yaml.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -101,9 +101,9 @@ def validate_base_time_format(filepath): ) dateformat = timestamp["dateformat"] - if dateformat == 'epoch': + if dateformat == "epoch": format_type = "epoch" - elif dateformat == 'windowsfiletime': + elif dateformat == "windowsfiletime": format_type = "windowsfiletime" else: format_type = "dateformat" @@ -191,7 +191,7 @@ def validate_epoch_dateformat_consistency(filepath): ) # Validate dateformat values - valid_magic_formats = ['epoch', 'windowsfiletime'] + valid_magic_formats = ["epoch", "windowsfiletime"] if dateformat not in valid_magic_formats and not isinstance(dateformat, str): raise ValueError( f"Entry '{entry_name}' timestamp {i}: dateformat must be a string" diff --git a/tests/timestamp_extractor.py b/tests/timestamp_extractor.py index b12061d..cee2cf4 100644 --- a/tests/timestamp_extractor.py +++ b/tests/timestamp_extractor.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/usecases/generate_usecase_docs.py b/usecases/generate_usecase_docs.py index 8b32dae..456758c 100644 --- a/usecases/generate_usecase_docs.py +++ b/usecases/generate_usecase_docs.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From fa26fac2beb4696cd341f4c6068ab9d443141bb1 Mon Sep 17 00:00:00 2001 From: Dan Dye Date: Wed, 6 May 2026 20:24:41 -0400 Subject: [PATCH 2/3] chore: update copyright year to 2026 in yaml configs and remaining files --- cloudbuild.yaml | 2 +- src/logstory/logtypes_entities_timestamps.yaml | 2 +- src/logstory/logtypes_events_timestamps.yaml | 2 +- src/logstory/usecases/NETWORK_ANALYSIS/__init__.py | 1 - src/logstory/usecases/__init__.py | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 972031b..ada6dc7 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -8,4 +8,4 @@ images: # Option 2: Build from local wheel (uses local changes) # To use: gcloud builds submit --config cloudbuild-wheel.yaml -# See cloudbuild-wheel.yaml for building with local wheel file \ No newline at end of file +# See cloudbuild-wheel.yaml for building with local wheel file diff --git a/src/logstory/logtypes_entities_timestamps.yaml b/src/logstory/logtypes_entities_timestamps.yaml index 4f7d6e0..c1f786d 100644 --- a/src/logstory/logtypes_entities_timestamps.yaml +++ b/src/logstory/logtypes_entities_timestamps.yaml @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/logtypes_events_timestamps.yaml b/src/logstory/logtypes_events_timestamps.yaml index 073565d..e2e7408 100644 --- a/src/logstory/logtypes_events_timestamps.yaml +++ b/src/logstory/logtypes_events_timestamps.yaml @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py b/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py index a087f1b..f8cb6d9 100644 --- a/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py +++ b/src/logstory/usecases/NETWORK_ANALYSIS/__init__.py @@ -11,4 +11,3 @@ # 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. - diff --git a/src/logstory/usecases/__init__.py b/src/logstory/usecases/__init__.py index a087f1b..f8cb6d9 100644 --- a/src/logstory/usecases/__init__.py +++ b/src/logstory/usecases/__init__.py @@ -11,4 +11,3 @@ # 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. - From 30511fa787ad0b325e893ea94fdca6e0b3b1d9d4 Mon Sep 17 00:00:00 2001 From: Dan Dye Date: Wed, 6 May 2026 20:30:45 -0400 Subject: [PATCH 3/3] refactor: resolve ruff linting errors in auth and ingestion modules --- src/logstory/auth.py | 2 +- src/logstory/ingestion.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logstory/auth.py b/src/logstory/auth.py index 75055bd..1ae8524 100644 --- a/src/logstory/auth.py +++ b/src/logstory/auth.py @@ -136,7 +136,7 @@ def get_credentials(self) -> Credentials: if self._credentials: return self._credentials - # Priority: service_account_info > credentials_path > secret_manager + # Priority: service_account_info then credentials_path then secret_manager if self.service_account_info: self._credentials = service_account.Credentials.from_service_account_info( self.service_account_info, scopes=self.SCOPES diff --git a/src/logstory/ingestion.py b/src/logstory/ingestion.py index 0e260c6..a2088f2 100644 --- a/src/logstory/ingestion.py +++ b/src/logstory/ingestion.py @@ -133,7 +133,7 @@ def post_entities( self, log_type: str, entries: list[dict[str, Any]], - labels: list[dict[str, str]], + labels: list[dict[str, str]], # noqa: ARG002 ) -> None: """Post entities using legacy API.""" uri = f"{self.get_base_url()}/v2/entities:batchCreate"