feat: Add initial Dockerfile, Pipfile.lock, and Terraform example for…#158
Open
feat: Add initial Dockerfile, Pipfile.lock, and Terraform example for…#158
Conversation
… infrastructure setup
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Vulnerabilitiesdevsecops-demo/Pipfile.lockOnly included vulnerabilities with severity moderate or higher. License Issuesdevsecops-demo/Pipfile.lock
OpenSSF Scorecard
Scanned Files
|
1 similar comment
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Vulnerabilitiesdevsecops-demo/Pipfile.lockOnly included vulnerabilities with severity moderate or higher. License Issuesdevsecops-demo/Pipfile.lock
OpenSSF Scorecard
Scanned Files
|
Comment on lines
+24
to
+64
| resource "azurerm_network_security_group" "catapp-sg" { | ||
| name = "${var.prefix}-sg" | ||
| location = var.location | ||
| resource_group_name = azurerm_resource_group.myresourcegroup.name | ||
|
|
||
| security_rule { | ||
| name = "HTTP" | ||
| priority = 100 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "80" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "HTTPS" | ||
| priority = 102 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "443" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "SSH" | ||
| priority = 101 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "22" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
| } |
Comment on lines
+24
to
+64
| resource "azurerm_network_security_group" "catapp-sg" { | ||
| name = "${var.prefix}-sg" | ||
| location = var.location | ||
| resource_group_name = azurerm_resource_group.myresourcegroup.name | ||
|
|
||
| security_rule { | ||
| name = "HTTP" | ||
| priority = 100 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "80" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "HTTPS" | ||
| priority = 102 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "443" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "SSH" | ||
| priority = 101 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "22" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
| } |
Comment on lines
+24
to
+64
| resource "azurerm_network_security_group" "catapp-sg" { | ||
| name = "${var.prefix}-sg" | ||
| location = var.location | ||
| resource_group_name = azurerm_resource_group.myresourcegroup.name | ||
|
|
||
| security_rule { | ||
| name = "HTTP" | ||
| priority = 100 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "80" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "HTTPS" | ||
| priority = 102 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "443" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "SSH" | ||
| priority = 101 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "22" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
| } |
Comment on lines
+24
to
+64
| resource "azurerm_network_security_group" "catapp-sg" { | ||
| name = "${var.prefix}-sg" | ||
| location = var.location | ||
| resource_group_name = azurerm_resource_group.myresourcegroup.name | ||
|
|
||
| security_rule { | ||
| name = "HTTP" | ||
| priority = 100 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "80" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "HTTPS" | ||
| priority = 102 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "443" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
|
|
||
| security_rule { | ||
| name = "SSH" | ||
| priority = 101 | ||
| direction = "Inbound" | ||
| access = "Allow" | ||
| protocol = "Tcp" | ||
| source_port_range = "*" | ||
| destination_port_range = "22" | ||
| source_address_prefix = "*" | ||
| destination_address_prefix = "*" | ||
| } | ||
| } |
Comment on lines
+92
to
+129
| resource "azurerm_virtual_machine" "catapp" { | ||
| name = "${var.prefix}-meow" | ||
| location = var.location | ||
| resource_group_name = azurerm_resource_group.myresourcegroup.name | ||
| vm_size = var.vm_size | ||
|
|
||
| network_interface_ids = [azurerm_network_interface.catapp-nic.id] | ||
| delete_os_disk_on_termination = "true" | ||
|
|
||
| storage_image_reference { | ||
| publisher = var.image_publisher | ||
| offer = var.image_offer | ||
| sku = var.image_sku | ||
| version = var.image_version | ||
| } | ||
|
|
||
| storage_os_disk { | ||
| name = "${var.prefix}-osdisk" | ||
| managed_disk_type = "Standard_LRS" | ||
| caching = "ReadWrite" | ||
| create_option = "FromImage" | ||
| } | ||
|
|
||
| os_profile { | ||
| computer_name = var.prefix | ||
| admin_username = var.admin_username | ||
| admin_password = var.admin_password | ||
| } | ||
|
|
||
| os_profile_linux_config { | ||
| disable_password_authentication = false | ||
| } | ||
|
|
||
| tags = {} | ||
|
|
||
| # Added to allow destroy to work correctly. | ||
| depends_on = [azurerm_network_interface_security_group_association.catapp-nic-sg-ass] | ||
| } |
| try: | ||
| print(xs[7]) | ||
| print(xs[8]) | ||
| except: pass |
| try: | ||
| print(xs[7]) | ||
| print(xs[8]) | ||
| except: pass |
| for y in ys: | ||
| try: | ||
| print(str(y+3)) #TypeErrors ahead | ||
| except: continue #not how to handle them |
| except: continue #not how to handle them | ||
|
|
||
| #some imports | ||
| import telnetlib |
|
|
||
| #some imports | ||
| import telnetlib | ||
| import ftplib |
| @@ -0,0 +1,30 @@ | |||
|
|
|||
| from flask import request, render_template, make_response | |||
| def index(): | ||
| name = request.args.get('name') | ||
| author = request.args.get('author') | ||
| read = bool(request.args.get('read')) |
There was a problem hiding this comment.
templateanalyzer found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
checkov found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
| try: | ||
| print(xs[7]) | ||
| print(xs[8]) | ||
| except: pass |
| for y in ys: | ||
| try: | ||
| print(str(y+3)) #TypeErrors ahead | ||
| except: continue #not how to handle them |
|
|
||
| #B303 and B324 | ||
| s = b"I am a string" | ||
| print("MD5: " +hashlib.md5(s).hexdigest()) |
| #B303 and B324 | ||
| s = b"I am a string" | ||
| print("MD5: " +hashlib.md5(s).hexdigest()) | ||
| print("SHA1: " +hashlib.sha1(s).hexdigest()) |
Comment on lines
+27
to
+34
| "flask": { | ||
| "hashes": [ | ||
| "sha256:7b2fb8e934ddd50731893bdcdb00fc8c0315916f9fcd50d22c7cc1a95ab634e2", | ||
| "sha256:cb90f62f1d8e4dc4621f52106613488b5ba826b2e1e10a33eac92f723093ab6a" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==2.0.2" | ||
| }, |
Comment on lines
+43
to
+50
| "jinja2": { | ||
| "hashes": [ | ||
| "sha256:827a0e32839ab1600d4eb1c4c33ec5a8edfbc5cb42dafa13b81f182f97784b45", | ||
| "sha256:8569982d3f0889eed11dd620c706d39b60c36d6d25843961f33f77fb6bc6b20c" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==3.0.2" | ||
| }, |
Comment on lines
+43
to
+50
| "jinja2": { | ||
| "hashes": [ | ||
| "sha256:827a0e32839ab1600d4eb1c4c33ec5a8edfbc5cb42dafa13b81f182f97784b45", | ||
| "sha256:8569982d3f0889eed11dd620c706d39b60c36d6d25843961f33f77fb6bc6b20c" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==3.0.2" | ||
| }, |
Comment on lines
+119
to
+126
| "werkzeug": { | ||
| "hashes": [ | ||
| "sha256:63d3dc1cf60e7b7e35e97fa9861f7397283b75d765afcaefd993d6046899de8f", | ||
| "sha256:aa2bb6fc8dee8d6c504c0ac1e7f5f7dc5810a9903e793b6f715a9f015bdadb9a" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==2.0.2" | ||
| } |
Comment on lines
+119
to
+126
| "werkzeug": { | ||
| "hashes": [ | ||
| "sha256:63d3dc1cf60e7b7e35e97fa9861f7397283b75d765afcaefd993d6046899de8f", | ||
| "sha256:aa2bb6fc8dee8d6c504c0ac1e7f5f7dc5810a9903e793b6f715a9f015bdadb9a" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==2.0.2" | ||
| } |
Comment on lines
+119
to
+126
| "werkzeug": { | ||
| "hashes": [ | ||
| "sha256:63d3dc1cf60e7b7e35e97fa9861f7397283b75d765afcaefd993d6046899de8f", | ||
| "sha256:aa2bb6fc8dee8d6c504c0ac1e7f5f7dc5810a9903e793b6f715a9f015bdadb9a" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==2.0.2" | ||
| } |
Comment on lines
+119
to
+126
| "werkzeug": { | ||
| "hashes": [ | ||
| "sha256:63d3dc1cf60e7b7e35e97fa9861f7397283b75d765afcaefd993d6046899de8f", | ||
| "sha256:aa2bb6fc8dee8d6c504c0ac1e7f5f7dc5810a9903e793b6f715a9f015bdadb9a" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==2.0.2" | ||
| } |
Comment on lines
+119
to
+126
| "werkzeug": { | ||
| "hashes": [ | ||
| "sha256:63d3dc1cf60e7b7e35e97fa9861f7397283b75d765afcaefd993d6046899de8f", | ||
| "sha256:aa2bb6fc8dee8d6c504c0ac1e7f5f7dc5810a9903e793b6f715a9f015bdadb9a" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==2.0.2" | ||
| } |
Comment on lines
+27
to
+34
| "flask": { | ||
| "hashes": [ | ||
| "sha256:7b2fb8e934ddd50731893bdcdb00fc8c0315916f9fcd50d22c7cc1a95ab634e2", | ||
| "sha256:cb90f62f1d8e4dc4621f52106613488b5ba826b2e1e10a33eac92f723093ab6a" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==2.0.2" | ||
| }, |
Comment on lines
+119
to
+126
| "werkzeug": { | ||
| "hashes": [ | ||
| "sha256:63d3dc1cf60e7b7e35e97fa9861f7397283b75d765afcaefd993d6046899de8f", | ||
| "sha256:aa2bb6fc8dee8d6c504c0ac1e7f5f7dc5810a9903e793b6f715a9f015bdadb9a" | ||
| ], | ||
| "markers": "python_version >= '3.6'", | ||
| "version": "==2.0.2" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… infrastructure setup