Skip to content

Conversation

@ahernandez411
Copy link
Owner

No description provided.

{
private Dictionary<string, string> _users = new Dictionary<string, string>();
private const string SqlConnectionString = "Server=localhost;Database=SecurityDb;User Id=sa;Password=MyP@ssw0rd!;";
private const string SqlConnectionString = "Server=localhost;Database=SecurityDb;User Id=sa;Password=MyP@ssw0rd!2;";

Check failure

Code scanning / CodeQL

Hard-coded connection string with credentials

'ConnectionString' property includes hard-coded credentials set in [object creation of type SqlConnection](1).
Comment on lines +113 to +118

Check failure

Code scanning / defsec

Ensure the Function App can only be accessed via HTTPS. The default is false.

Function app does not have HTTPS enforced.
Comment on lines +106 to +111
resource "azurerm_function_app" "bad_example" {
name = "example-function-app"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}

Check warning

Code scanning / defsec

App Service authentication is activated

App service does not have authentication enabled.
Comment on lines +106 to +111
resource "azurerm_function_app" "bad_example" {
name = "example-function-app"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}

Check notice

Code scanning / defsec

Web App has registration with AD enabled

App service does not have an identity type.
Comment on lines +106 to +111
resource "azurerm_function_app" "bad_example" {
name = "example-function-app"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}

Check notice

Code scanning / defsec

Web App uses the latest HTTP version

App service does not have HTTP/2 enabled.
Comment on lines +106 to +111
resource "azurerm_function_app" "bad_example" {
name = "example-function-app"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}

Check notice

Code scanning / defsec

Web App accepts incoming client certificate

App service does not have client certificates enabled.
Comment on lines +61 to +65
name = "bad_example"

retention_policy {
enabled = true
days = 7
}
}

resource "azurerm_network_security_rule" "bad_example" {
name = "bad_example_security_rule"
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
destination_port_range = ["3389"]
source_address_prefix = "*"
destination_address_prefix = "*"
}

resource "azurerm_network_security_group" "example" {
name = "tf-appsecuritygroup"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name

security_rule {
source_port_range = "any"
destination_port_range = ["3389"]
source_address_prefix = "*"
destination_address_prefix = "*"
}

Check notice

Code scanning / defsec

Key vault Secret should have a content type set

Secret does not have a content-type specified.
Comment on lines +61 to +65
name = "bad_example"

retention_policy {
enabled = true
days = 7
}
}

resource "azurerm_network_security_rule" "bad_example" {
name = "bad_example_security_rule"
direction = "Inbound"
access = "Allow"
protocol = "TCP"
source_port_range = "*"
destination_port_range = ["3389"]
source_address_prefix = "*"
destination_address_prefix = "*"
}

resource "azurerm_network_security_group" "example" {
name = "tf-appsecuritygroup"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name

security_rule {
source_port_range = "any"
destination_port_range = ["3389"]
source_address_prefix = "*"
destination_address_prefix = "*"
}

Check notice

Code scanning / defsec

Key Vault Secret should have an expiration date set

Secret should have an expiry date specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants