Repository: terraform-compliance/cli (language: python)

Issue:
DeprecationWarning: datetime.datetime.utcnow() on version 1.3.48 (using python 3.12)
<!-- Thank you for opening an issue! -->
## Description

When running terraform_compliance 1.3.48 with python 3.12 I'm getting multiple DeprecationWarnings on the usage of datetime.datetime.utcnow(). 

Although terraform_compliance still works, this makes it difficult to read the output.

<!-- A clear and concise description of what the bug is. -->

## To Reproduce
Just run terraform_compliance with any feature file on python 3.12

**Feature File:**
<!-- Can link to the file or paste it below-->
```gherkin
Given I have ....
When it contains ...
Then it must ....
And it must ...
```
**Plan File:**
<!-- Please make sure that your plan doesn't have any confidential information. -->

**Sample Terraform Code:**
<!-- Can link to the file or paste it below. Please make sure that your code doesn't have any confidential information. -->
```hcl
resource "aws_s3_bucket" "example_code" {
   bucket = "This is just a sample code"
}
```

**Used `terraform-compliance` Parameters:**
<!-- If anything other than `-p` and `-f` is being used, please let us know. -->

**Running via Docker:**
<!-- Yes or No --> Yes
<!-- If not running via Docker, this section can be deleted. Otherwise, docker related information goes here. -->

**Error Output:**
<!-- What did happen? -->
```
. Converting terraform plan file.
🚩 Features     : /workspaces/tf_btp_info/tfscripts/tests/
🚩 Plan File    : /workspaces/tf_btp_info/tfscripts/mission_3774/step1/plan.out.json

🚩 Running tests. 🎉

/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:38: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  feature.starttime = datetime.utcnow()
Feature: Certain variables should always be defined  # /workspaces/tf_btp_info/tfscripts/tests/naming_standards.feature
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:44: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  scenario.starttime = datetime.utcnow()

    Scenario Outline: Naming Standard on all available variables
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:50: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  step.starttime = datetime.utcnow()
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:68: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  step.endtime = datetime.utcnow()
        Given I have not defined variable foo or moo
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:50: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  step.starttime = datetime.utcnow()
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:68: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  step.endtime = datetime.utcnow()
        Then scenario should fail
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:62: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  scenario.endtime = datetime.utcnow()

    Examples:
        |  |
/usr/local/lib/python3.12/site-packages/radish/extensions/time_recorder.py:56: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  feature.endtime = datetime.utcnow()

1 features (1 passed)
0 scenarios (0 passed)
0 steps (0 passed)
```

**Expected Behavior:**
<!-- What did you expect to happen? -->
Clean output without deprecation warnings.

**Tested Versions:**
- terraform-compliance version: ```1.3.48``` <!-- terraform-compliance -v -->
- terraform version: ```1.9.1``` <!-- terraform -v -->
- python version: ```3.12.4``` <!-- python -v -->

**Additional Context:**
<!-- Add any other context about the problem here. -->



Discussion / hints:
Same here.

terraform-compliance version: `1.3.48`
terraform version: `1.9.3`
python version: `3.12.4`
Hi, is there any update on this please ?
Sorry for this guys, let me update it.

Fix patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index b43bbba1..975656d3 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -27,7 +27,7 @@ jobs:
 
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
+      uses: github/codeql-action/init@v2
       with:
         languages: ${{ matrix.language }}
         # If you wish to specify custom queries, you can do so here or in a config file.
@@ -38,7 +38,7 @@ jobs:
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
+      uses: github/codeql-action/autobuild@v2
 
     # ℹ️ Command-line programs to run using the OS shell.
     # 📚 https://git.io/JvXDl
@@ -52,4 +52,4 @@ jobs:
     #   make release
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      uses: github/codeql-action/analyze@v2
diff --git a/terraform_compliance/extensions/override_radish_utctime.py b/terraform_compliance/extensions/override_radish_utctime.py
new file mode 100644
index 00000000..073e5d83
--- /dev/null
+++ b/terraform_compliance/extensions/override_radish_utctime.py
@@ -0,0 +1,11 @@
+import radish.extensions.time_recorder
+import datetime
+import mock
+
+def current_utc_time():
+    return datetime.datetime.now(datetime.timezone.utc)
+
+def apply_utctime_patch():
+    # Patch datetime specifically within radish.extensions.time_recorder
+    radish.extensions.time_recorder.datetime = mock.Mock()
+    radish.extensions.time_recorder.datetime.utcnow = current_utc_time
\ No newline at end of file
diff --git a/terraform_compliance/main.py b/terraform_compliance/main.py
index fef47051..503ad25d 100644
--- a/terraform_compliance/main.py
+++ b/terraform_compliance/main.py
@@ -22,8 +22,11 @@
 Step.run = StepOverride.run
 
 from terraform_compliance.extensions.override_radish_hookerrors import handle_exception as handle_exception_override
+from terraform_compliance.extensions.override_radish_utctime import apply_utctime_patch
 from radish import errororacle
+
 errororacle.handle_exception = handle_exception_override
+apply_utctime_patch()
 ##
 #
 


Test patch:
diff --git a/tests/terraform_compliance/common/test_bdd_tags.py b/tests/terraform_compliance/common/test_bdd_tags.py
index 3ae87229..c510b808 100644
--- a/tests/terraform_compliance/common/test_bdd_tags.py
+++ b/tests/terraform_compliance/common/test_bdd_tags.py
@@ -1,20 +1,23 @@
-from unittest import TestCase
+from unittest import TestCase, mock
 from terraform_compliance.common.bdd_tags import look_for_bdd_tags
-from terraform_compliance.common.exceptions import Failure
+from terraform_compliance.extensions.override_radish_utctime import current_utc_time
 from tests.mocks import MockedStep, MockedTags
 
-
 class TestBddTags(TestCase):
 
-    def test_unchanged_step_object(self):
+    @mock.patch('radish.extensions.time_recorder.datetime')
+    def test_unchanged_step_object(self, mock_datetime):
+        mock_datetime.utcnow.side_effect = current_utc_time  # Patches within radish
         step = MockedStep()
         look_for_bdd_tags(step)
         self.assertFalse(step.context.no_failure)
         self.assertIsNone(step.context.failure_class)
 
-    def test_warning_case(self):
+    @mock.patch('radish.extensions.time_recorder.datetime')
+    def test_warning_case(self, mock_datetime):
+        mock_datetime.utcnow.side_effect = current_utc_time  # Patches within radish
         step = MockedStep()
         step.all_tags = [MockedTags(name='warning')]
         look_for_bdd_tags(step)
         self.assertTrue(step.context.no_failure)
-        self.assertEqual(step.context.failure_class, 'warning')
+        self.assertEqual(step.context.failure_class, 'warning')
\ No newline at end of file