internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: python-poetry/poetry

Issue:
add -e/--executable to poetry env info to get the python executable path
- [x] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.
- [x] I have searched the [FAQ](https://python-poetry.org/docs/faq/) and general [documentation](https://python-poetry.org/docs/) and believe that my question is not already covered.

## Feature Request

in addition to the already present `-p/--path` option, add a `-e/--execuatble` option to return the python executable path.

My use case: I'm starting to use Taskfile and poetry on some projects; these project are developed on both linux and windows;

I would like to avoid having to install tools such as mypy in the virtual environment, since they can be run from the outside (this also allows me to have faster CI, I have set up a custom docker image with all the tools needed).

mypy in particular wants to know the exact path of the python executable to work (passed as `--python-executable` option), so having a new `poetry env info --executable` option that outputs the python path  would solve my issue in a cross-platform fashion.



Discussion:
If this feature is important to you, then submitting a merge request with the change you want to see is by far the most likely way to make it happen.



Resolving patch:
diff --git a/src/poetry/console/commands/env/info.py b/src/poetry/console/commands/env/info.py
--- a/src/poetry/console/commands/env/info.py
+++ b/src/poetry/console/commands/env/info.py
@@ -15,7 +15,12 @@ class EnvInfoCommand(Command):
     name = "env info"
     description = "Displays information about the current environment."
 
-    options = [option("path", "p", "Only display the environment's path.")]
+    options = [
+        option("path", "p", "Only display the environment's path."),
+        option(
+            "executable", "e", "Only display the environment's python executable path."
+        ),
+    ]
 
     def handle(self) -> int:
         from poetry.utils.env import EnvManager
@@ -30,6 +35,14 @@ def handle(self) -> int:
 
             return 0
 
+        if self.option("executable"):
+            if not env.is_venv():
+                return 1
+
+            self.line(str(env.python))
+
+            return 0
+
         self._display_complete_info(env)
         return 0
 


Test patch:
diff --git a/tests/console/commands/env/test_info.py b/tests/console/commands/env/test_info.py
--- a/tests/console/commands/env/test_info.py
+++ b/tests/console/commands/env/test_info.py
@@ -58,3 +58,9 @@ def test_env_info_displays_path_only(tester: CommandTester):
     tester.execute("--path")
     expected = str(Path("/prefix")) + "\n"
     assert tester.io.fetch_output() == expected
+
+
+def test_env_info_displays_executable_only(tester: CommandTester):
+    tester.execute("--executable")
+    expected = str(sys.executable) + "\n"
+    assert tester.io.fetch_output() == expected
Repository: bridgecrewio/checkov

Issue:
Checkov fails to start in Windows environments 
**Describe the bug**
After you install Checkov on Windows, running Checkov does nothing.

**To Reproduce**
Steps to reproduce the behavior:
1. Open Powershell/cmd
2. Run cli command  'checkov'
3. Does nothing

**Expected behavior**
The tool running. Magic.

**Screenshots**
I'm not sure showing nothing would help.

**Desktop (please complete the following information):**
 - OS: Windows 10
 - Checkov Version 1.0.173

**Additional context**
I know Windows! Like who cares and tbh ive got WSL2 and it works a dream but customers, customers and their awful locked down... anyway.
I'm using Python37 where i've installed .
If you look in your c:/Python37/scripts folder there is a "checkov" bash script. This is the nub of it this doesn't run! However if you add a batch file "checkov-scan.bat" [or call whatever} with this content:
```cmd
C:\Python37\python C:\Python37\Lib\site-packages\checkov\main.py %1 %2
```
Then when you run "checkov-scan" at your shell, it works! So is there anyway you could package up something similar in a release? please? 
Also I made a python based pre-commit for checkov called checkov-scan - here <https://github.com/JamesWoolfenden/pre-commit>




Discussion:
Worst. Batch. File. Ever.

```
@echo off 
%python_home%\python %python_home%\Lib\site-packages\checkov\main.py %1 %2  
```
I haven't tried this batch file. Would it work in pipenv? Let me know if you'd like to do the PR and get into the contributors list
I can do the PR
Go for it :) 

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -89,7 +89,7 @@
     author_email="support@bridgecrew.io",
     url="https://github.com/bridgecrewio/checkov",
     packages=setuptools.find_packages(exclude=["tests*"]),
-    scripts=["bin/checkov"],
+    scripts=["bin/checkov","bin/checkov.bat"],
     long_description=long_description,
     long_description_content_type="text/markdown",
     classifiers=[


Test patch:
Repository: bridgecrewio/checkov

Issue:
Add new check: DynamoDB Accelerator (DAX) encryption at rest enabled
https://www.terraform.io/docs/providers/aws/r/dax_cluster.html#server_side_encryption
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-cluster.html#cfn-dax-cluster-ssespecification


Discussion:

Resolving patch:
diff --git a/checkov/terraform/checks/resource/aws/ECRImmutableTags.py b/checkov/terraform/checks/resource/aws/ECRImmutableTags.py
new file mode 100644
--- /dev/null
+++ b/checkov/terraform/checks/resource/aws/ECRImmutableTags.py
@@ -0,0 +1,23 @@
+from checkov.common.models.enums import CheckResult, CheckCategories
+from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
+
+class ECRImmutableTags(BaseResourceCheck):
+    def __init__(self):
+        name = "Ensure ECR Image Tags are immutable"
+        id = "CKV_AWS_51"
+        supported_resources = ['aws_ecr_repository']
+        categories = [CheckCategories.GENERAL_SECURITY]
+        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
+
+    def scan_resource_conf(self, conf):
+        key="image_tag_mutability"
+        if key in conf.keys():
+            if conf[key] == ['IMMUTABLE']:
+                return CheckResult.PASSED
+            else:
+                return CheckResult.FAILED
+        else:
+            return CheckResult.FAILED
+
+
+check = ECRImmutableTags()


Test patch:
diff --git a/tests/terraform/checks/resource/aws/test_ECRImmutableTags.py b/tests/terraform/checks/resource/aws/test_ECRImmutableTags.py
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/aws/test_ECRImmutableTags.py
@@ -0,0 +1,21 @@
+import unittest
+
+
+from checkov.common.models.enums import CheckResult
+from checkov.terraform.checks.resource.aws.ECRImmutableTags import check
+
+class TestECRImmutableTags(unittest.TestCase):
+
+    def test_failure(self):
+        resource_conf =  {"name": ['bar']}
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+    def test_success(self):
+        resource_conf =  {'image_tag_mutability': ['IMMUTABLE'],"name": ['bar']}
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.PASSED, scan_result)
+
+
+if __name__ == '__main__':
+    unittest.main()
Repository: bridgecrewio/checkov

Issue:
Add new check: DynamoDB Accelerator (DAX) encryption at rest enabled
https://www.terraform.io/docs/providers/aws/r/dax_cluster.html#server_side_encryption
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dax-cluster.html#cfn-dax-cluster-ssespecification


Discussion:

Resolving patch:
diff --git a/checkov/terraform/checks/resource/aws/S3MFADelete.py b/checkov/terraform/checks/resource/aws/S3MFADelete.py
new file mode 100644
--- /dev/null
+++ b/checkov/terraform/checks/resource/aws/S3MFADelete.py
@@ -0,0 +1,17 @@
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+from checkov.common.models.enums import CheckCategories
+
+
+class S3MFADelete(BaseResourceValueCheck):
+    def __init__(self):
+        name = "Ensure S3 bucket has MFA delete enabled"
+        id = "CKV_AWS_52"
+        supported_resources = ['aws_s3_bucket']
+        categories = [CheckCategories.BACKUP_AND_RECOVERY]
+        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
+
+    def get_inspected_key(self):
+        return "versioning/[0]/enabled"
+
+
+scanner = S3MFADelete()


Test patch:
diff --git a/tests/terraform/checks/resource/aws/test_S3MFADelete.py b/tests/terraform/checks/resource/aws/test_S3MFADelete.py
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/aws/test_S3MFADelete.py
@@ -0,0 +1,37 @@
+import unittest
+
+from checkov.terraform.checks.resource.aws.S3MFADelete import scanner
+from checkov.common.models.enums import CheckResult
+
+
+class TestS3MFADelete(unittest.TestCase):
+
+    def test_failure(self):
+        resource_conf = {"region": ["us-west-2"],
+                         "bucket": ["my_bucket"],
+                         "acl": ["public-read"],
+                         "force_destroy": [True],
+                         "tags": [{"Name": "my-bucket"}]}
+        scan_result = scanner.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+    def test_success(self):
+        resource_conf = {"region": ["us-west-2"],
+                         "bucket": ["my_bucket"],
+                         "acl": ["public-read"],
+                         "force_destroy": [True],
+                         "tags": [{"Name": "my-bucket"}],
+                         "logging": [{"target_bucket": "logging-bucket",
+                                      "target_prefix": "log/"
+                                      }],
+                         "versioning": [
+                             {"enabled": [True]},
+                             {"mfa_delete": [True]}
+                             ]
+                         }
+        scan_result = scanner.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.PASSED, scan_result)
+
+
+if __name__ == '__main__':
+    unittest.main()
Repository: bridgecrewio/checkov

Issue:
Support web proxy https_proxy environment variable
**Is your feature request related to a problem? Please describe.**
checkov does not run behind a web proxy.  Instead, it hangs indefinitely trying to connect to https://www.bridgecrew.cloud/api/v1

**Describe the solution you'd like**
Add web proxy support for proxy indicated in https_proxy environment variable.

**Describe alternatives you've considered**
None

**Additional context**
Before patch behind a web proxy:
```
$ time timeout 5m checkov -d .

real    5m0.007s
user    0m0.504s
sys     0m0.082s
$
```

After patch behind a web proxy:
```
$ time timeout 5m checkov -d .

       _               _
   ___| |__   ___  ___| | _______   __
  / __| '_ \ / _ \/ __| |/ / _ \ \ / /
 | (__| | | |  __/ (__|   < (_) \ V /
  \___|_| |_|\___|\___|_|\_\___/ \_/

by bridgecrew.io | version: 1.0.484


real    0m1.547s
user    0m0.938s
sys     0m0.089s
$
```




Discussion:

Resolving patch:
diff --git a/checkov/common/bridgecrew/platform_integration.py b/checkov/common/bridgecrew/platform_integration.py
--- a/checkov/common/bridgecrew/platform_integration.py
+++ b/checkov/common/bridgecrew/platform_integration.py
@@ -17,7 +17,11 @@
 UNAUTHORIZED_MESSAGE = 'User is not authorized to access this resource with an explicit deny'
 
 DEFAULT_REGION = "us-west-2"
-http = urllib3.PoolManager()
+
+try:
+    http = urllib3.ProxyManager(os.environ['https_proxy'])
+except KeyError:
+    http = urllib3.PoolManager()
 
 
 class BcPlatformIntegration(object):


Test patch:
Repository: bridgecrewio/checkov

Issue:
Add new check: API Gateway should have X-Ray Tracing enabled 
https://www.terraform.io/docs/providers/aws/r/api_gateway_stage.html#xray_tracing_enabled

TracingEnabled: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html


Discussion:

Resolving patch:
diff --git a/checkov/terraform/checks/resource/aws/APIGatewayXray.py b/checkov/terraform/checks/resource/aws/APIGatewayXray.py
new file mode 100644
--- /dev/null
+++ b/checkov/terraform/checks/resource/aws/APIGatewayXray.py
@@ -0,0 +1,18 @@
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+from checkov.common.models.enums import CheckCategories
+
+
+class APIGatewayXray(BaseResourceValueCheck):
+
+    def __init__(self):
+        name = "Ensure API Gateway has X-Ray Tracing enabled"
+        id = "CKV_AWS_73"
+        supported_resources = ['aws_api_gateway_stage']
+        categories = [CheckCategories.LOGGING]
+        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
+
+    def get_inspected_key(self):
+        return "xray_tracing_enabled"
+
+
+check = APIGatewayXray()


Test patch:
diff --git a/tests/terraform/checks/resource/aws/test_APIGatewayXray.py b/tests/terraform/checks/resource/aws/test_APIGatewayXray.py
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/aws/test_APIGatewayXray.py
@@ -0,0 +1,22 @@
+import unittest
+
+from checkov.terraform.checks.resource.aws.APIGatewayXray import check
+from checkov.common.models.enums import CheckResult
+
+
+class TestAPIGatewayXray(unittest.TestCase):
+
+    def test_failure(self):
+        resource_conf = {"xray_tracing_enabled": [False]}
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+
+    def test_success(self):
+        resource_conf = {"xray_tracing_enabled": [True]}
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.PASSED, scan_result)
+
+
+if __name__ == '__main__':
+    unittest.main()
Repository: bridgecrewio/checkov

Issue:
Add new check: Documentdb encryption
Encryption of data at rest
see: https://www.terraform.io/docs/providers/aws/r/docdb_cluster.html


Discussion:
Don't forget CloudFormation too! 
StorageEncrypted: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-docdb-dbcluster.html


Resolving patch:
diff --git a/checkov/terraform/checks/resource/aws/DocDBEncryption.py b/checkov/terraform/checks/resource/aws/DocDBEncryption.py
new file mode 100644
--- /dev/null
+++ b/checkov/terraform/checks/resource/aws/DocDBEncryption.py
@@ -0,0 +1,17 @@
+from checkov.common.models.enums import CheckCategories
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+
+
+class DocDBEncryption(BaseResourceValueCheck):
+    def __init__(self):
+        name = "Ensure DocDB is encrypted at rest (default is unencrypted)"
+        id = "CKV_AWS_74"
+        supported_resources = ['aws_docdb_cluster', 'aws_docdb_cluster_instance']
+        categories = [CheckCategories.ENCRYPTION]
+        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
+
+    def get_inspected_key(self):
+        return "storage_encrypted"
+
+
+check = DocDBEncryption()


Test patch:
diff --git a/tests/terraform/checks/resource/aws/test_DocDBEncryption.py b/tests/terraform/checks/resource/aws/test_DocDBEncryption.py
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/aws/test_DocDBEncryption.py
@@ -0,0 +1,24 @@
+import unittest
+
+from checkov.common.models.enums import CheckResult
+from checkov.terraform.checks.resource.aws.DocDBEncryption import check
+
+
+class TestDocDBEncryption(unittest.TestCase):
+
+    def test_failure(self):
+        resource_conf = {"cluster_identifier": "my-docdb-cluster",
+                         "storage_encrypted": False}
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+    def test_success(self):
+        resource_conf = {"cluster_identifier": "my-docdb-cluster",
+                         "storage_encrypted": True}
+
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.PASSED, scan_result)
+
+
+if __name__ == '__main__':
+    unittest.main()
Repository: bridgecrewio/checkov

Issue:
Add new check: Ensure Global Accelerator flow logs enabled
Attributes -> flow_logs_enabled: https://www.terraform.io/docs/providers/aws/r/globalaccelerator_accelerator.html

CloudFormation does not support Global Accelerator as of yet (except with custom resources).  A link to the feature request is here: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/255




Discussion:

Resolving patch:
diff --git a/checkov/terraform/checks/resource/aws/GlobalAcceleratorAcceleratorFlowLogs.py b/checkov/terraform/checks/resource/aws/GlobalAcceleratorAcceleratorFlowLogs.py
new file mode 100644
--- /dev/null
+++ b/checkov/terraform/checks/resource/aws/GlobalAcceleratorAcceleratorFlowLogs.py
@@ -0,0 +1,17 @@
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+from checkov.common.models.enums import CheckCategories
+
+
+class GlobalAcceleratorAcceleratorFlowLogs(BaseResourceValueCheck):
+    def __init__(self):
+        name = "Ensure Global Accelerator accelerator has flow logs enabled"
+        id = "CKV_AWS_75"
+        supported_resources = ['aws_globalaccelerator_accelerator']
+        categories = [CheckCategories.LOGGING]
+        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
+
+    def get_inspected_key(self):
+        return "attributes/[0]/flow_logs_enabled"
+
+
+check = GlobalAcceleratorAcceleratorFlowLogs()


Test patch:
diff --git a/tests/terraform/checks/resource/aws/test_GlobalAcceleratorAcceleratorFlowLogs.py b/tests/terraform/checks/resource/aws/test_GlobalAcceleratorAcceleratorFlowLogs.py
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/aws/test_GlobalAcceleratorAcceleratorFlowLogs.py
@@ -0,0 +1,41 @@
+import unittest
+
+from checkov.common.models.enums import CheckResult
+from checkov.terraform.checks.resource.aws.GlobalAcceleratorAcceleratorFlowLogs import check
+
+
+class TestGlobalAcceleratorAcceleratorFlowLogs(unittest.TestCase):
+
+    def test_failure(self):
+        resource_conf = {"name": "Example"}
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+    def test_failure_full(self):
+        resource_conf = {
+            "name": "Example",
+            "attributes": [
+                {
+                    "flow_logs_enabled": [False]
+                }
+            ],
+        }
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+    def test_success(self):
+        resource_conf = {
+            "name": "Example",
+            "attributes": [
+                {
+                    "flow_logs_enabled": [True]
+                }
+            ],
+        }
+
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.PASSED, scan_result)
+
+
+if __name__ == '__main__':
+    unittest.main()
Repository: bridgecrewio/checkov

Issue:
Add new check: API Gateway should have access logging enabled 
access_log_settings: https://www.terraform.io/docs/providers/aws/r/api_gateway_stage.html#access_log_settings

AccessLogSetting: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html


Discussion:

Resolving patch:
diff --git a/checkov/terraform/checks/resource/aws/APIGatewayAccessLogging.py b/checkov/terraform/checks/resource/aws/APIGatewayAccessLogging.py
new file mode 100644
--- /dev/null
+++ b/checkov/terraform/checks/resource/aws/APIGatewayAccessLogging.py
@@ -0,0 +1,22 @@
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+from checkov.common.models.enums import CheckCategories
+from checkov.common.models.consts import ANY_VALUE
+
+
+class APIGatewayAccessLogging(BaseResourceValueCheck):
+
+    def __init__(self):
+        name = "Ensure API Gateway has Access Logging enabled"
+        id = "CKV_AWS_76"
+        supported_resources = ['aws_api_gateway_stage']
+        categories = [CheckCategories.LOGGING]
+        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
+
+    def get_inspected_key(self):
+        return "access_log_settings/[0]/destination_arn"
+
+    def get_expected_value(self):
+        return ANY_VALUE
+
+
+check = APIGatewayAccessLogging()


Test patch:
diff --git a/tests/terraform/checks/resource/aws/test_APIGatewayAccessLogging.py b/tests/terraform/checks/resource/aws/test_APIGatewayAccessLogging.py
new file mode 100644
--- /dev/null
+++ b/tests/terraform/checks/resource/aws/test_APIGatewayAccessLogging.py
@@ -0,0 +1,30 @@
+import unittest
+
+from checkov.common.models.enums import CheckResult
+from checkov.terraform.checks.resource.aws.APIGatewayAccessLogging import check
+
+
+class TestAPIGatewayAccessLogs(unittest.TestCase):
+
+    def test_failure(self):
+        resource_conf = {
+            "rest_api_id": "Example",
+        }
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.FAILED, scan_result)
+
+    def test_success(self):
+        resource_conf = {
+            "rest_api_id": "Example",
+            "access_log_settings": [
+                {
+                    "destination_arn": "some-arn"
+                }
+            ],
+        }
+        scan_result = check.scan_resource_conf(conf=resource_conf)
+        self.assertEqual(CheckResult.PASSED, scan_result)
+
+
+if __name__ == '__main__':
+    unittest.main()