Skip to content

Commit

Permalink
Remove setting up network policies from clamav module
Browse files Browse the repository at this point in the history
  • Loading branch information
rahearn committed Dec 2, 2024
1 parent 7153e77 commit 16c3e87
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 43 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ module "clamav" {
cf_org_name = local.cf_org_name
cf_space_name = local.cf_space_name
app_name = "app_name"
name = "my_clamav_name"
clamav_image = "ghcr.io/gsa-tts/clamav-rest/clamav:TAG_NAME"
max_file_size = "30M"
Expand Down
15 changes: 0 additions & 15 deletions clamav/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ locals {
endpoint = "${var.name}.apps.internal"
}

data "cloudfoundry_app" "app" {
name = var.app_name
org_name = var.cf_org_name
space_name = var.cf_space_name
}

resource "cloudfoundry_app" "clamav_api" {
name = var.name
space_name = var.cf_space_name
Expand Down Expand Up @@ -35,12 +29,3 @@ resource "cloudfoundry_app" "clamav_api" {
MAX_FILE_SIZE = var.max_file_size
}
}

resource "cloudfoundry_network_policy" "clamav_routing" {
provider = cloudfoundry-community
policy {
source_app = data.cloudfoundry_app.app.id
destination_app = cloudfoundry_app.clamav_api.id
port = "61443"
}
}
5 changes: 0 additions & 5 deletions clamav/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@ terraform {
source = "cloudfoundry/cloudfoundry"
version = ">=1.1.0"
}

cloudfoundry-community = {
source = "cloudfoundry-community/cloudfoundry"
version = ">=0.53.1"
}
}
}
17 changes: 0 additions & 17 deletions clamav/tests/creation.tftest.hcl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
mock_provider "cloudfoundry" {}
mock_provider "cloudfoundry-community" {}

variables {
cf_org_name = "gsa-tts-devtools-prototyping"
cf_space_name = "terraform-cloudgov-ci-tests"
app_name = "terraform_cloudgov_app"
name = "terraform-cloudgov-clamav-test"
clamav_image = "ghcr.io/gsa-tts/clamav-rest/clamav:TAG"
max_file_size = "30M"
Expand Down Expand Up @@ -60,21 +58,6 @@ run "test_app_creation" {
condition = lookup(cloudfoundry_app.clamav_api.environment, "PROXY_PASSWORD", null) == null
error_message = "Does not set the PROXY_PASSWORD environment by default"
}

assert {
condition = [for policy in cloudfoundry_network_policy.clamav_routing.policy : policy.source_app] == [data.cloudfoundry_app.app.id]
error_message = "Routing policy allows traffic from the source app"
}

assert {
condition = [for policy in cloudfoundry_network_policy.clamav_routing.policy : policy.destination_app] == [cloudfoundry_app.clamav_api.id]
error_message = "Routing policy allows traffic to the clamav app"
}

assert {
condition = [for policy in cloudfoundry_network_policy.clamav_routing.policy : policy.port] == ["61443"]
error_message = "Routing policy opens up traffic on the internal https port"
}
}

run "test_with_proxy" {
Expand Down
5 changes: 0 additions & 5 deletions clamav/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ variable "cf_space_name" {
description = "cloud.gov space name"
}

variable "app_name" {
type = string
description = "base application name to allow routing to the clamav app"
}

variable "name" {
type = string
description = "name of the clamav scanning application"
Expand Down

0 comments on commit 16c3e87

Please sign in to comment.