Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP Service Account Credential as docker env variable for cloud scanner #32

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

shyam0904a
Copy link
Contributor

[+] Added support for passing in Service Account Key Credential content as base64 encoded env variable.
[+] Does this break anything : No, All existing functionality works.

data "google_client_config" "current" {}

resource "google_project_service" "cloud_resource_manager" {
  project = ""
  service = "cloudresourcemanager.googleapis.com"
  disable_on_destroy = false
}

module "cloud_scanner_example_multiple_project" {
  source                   = "deepfence/cloud-scanner/gcp//examples/gce-vm"
  version                  = "0.8.0"
  # gcp service account name
  name                     = "deepfence-cloud-scanner"
  # project_id example: dev1-123456
  project_id               = ""
  # org mode for multiple projects
  isOrganizationDeployment = true
}

resource "google_service_account_key" "cloud_scanner_key" {
  service_account_id = module.cloud_scanner_example_multiple_project.service_account_email
}

output "service_account_email" {
  value = module.cloud_scanner_example_multiple_project.service_account_email
}

output "service_account_key" {
  value     = google_service_account_key.cloud_scanner_key.private_key
  sensitive = true
}

[+] Added support for pasing in Service Account Key Credential content as base64
encoded env variable.
[+] Does this break anything : No, All existing functionality works.

```
data "google_client_config" "current" {}

resource "google_project_service" "cloud_resource_manager" {
  project = ""
  service = "cloudresourcemanager.googleapis.com"
  disable_on_destroy = false
}

module "cloud_scanner_example_multiple_project" {
  source                   = "deepfence/cloud-scanner/gcp//examples/gce-vm"
  version                  = "0.8.0"
  # gcp service account name
  name                     = "deepfence-cloud-scanner"
  # project_id example: dev1-123456
  project_id               = ""
  # org mode for multiple projects
  isOrganizationDeployment = true
}

resource "google_service_account_key" "cloud_scanner_key" {
  service_account_id = module.cloud_scanner_example_multiple_project.service_account_email
}

output "service_account_email" {
  value = module.cloud_scanner_example_multiple_project.service_account_email
}

output "service_account_key" {
  value     = google_service_account_key.cloud_scanner_key.private_key
  sensitive = true
}

```
service/service.go Outdated Show resolved Hide resolved
@ramanan-ravi ramanan-ravi merged commit 8684d47 into deepfence:release-2.4 Oct 10, 2024
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.

3 participants