Skip to content

Commit

Permalink
fix: example scripts & formatting (#2)
Browse files Browse the repository at this point in the history
* fix: example scripts & formatting

* Trigger build

* fix: updated examples

* fix: restoring existing-service-account-gar example
  • Loading branch information
Mike Laramie authored Nov 3, 2021
1 parent 3ae843b commit 0daab76
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
18 changes: 9 additions & 9 deletions examples/configure-lacework-gar-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ The fields required for this example are:
|------|-------------|------|
| `lacework_integration_name` | Set this to whatever you would like the integration to be named. | `string` |
| `registry_domain` | The GAR domain, which specifies the location where you store the images. Defaults to us-docker.pkg.dev| `string` |
| `limit_by_tag` | An image tag to limit the assessment of images with matching tag. If you specify limit_by_tag and limit_by_label limits, they function as an AND. Supported field input are mytext\*mytext, mytext, mytext\*, or mytext. Only one \* wildcard is supported. Defaults to \*. | `string` |
| `limit_by_tags` | An image tag to limit the assessment of images with matching tag. If you specify limit_by_tag and limit_by_label limits, they function as an AND. Supported field input are mytext\*mytext, mytext, mytext\*, or mytext. Only one \* wildcard is supported. Defaults to \*. | `string` |
| `limit_by_label` | An image label to limit the assessment of images with matching label. If you specify limit_by_tag and limit_by_label limits, they function as an AND. Supported field input are mytext\*mytext, mytext, mytext\*, or mytext. Only one \* wildcard is supported. Defaults to \*. | `string` |
| `limit_by_repos` | A comma-separated list of repositories to assess. This should be defined as a string. (without spaces recommended) | `string` |
| `limit_by_repositories` | A comma-separated list of repositories to assess. This should be defined as a string. (without spaces recommended) | `string` |
| `limit_num_imgs` | The maximum number of newest container images to assess per repository. Must be one of 5, 10, or 15. Defaults to 5. | `string` |
|`non_os_packages` | Whether or not Lacework should scan container images for additional application librarys beyond OS packages | `boolean`|


Create a `main.tf` with the following code:
Expand All @@ -21,16 +22,15 @@ provider "google" {}
provider "lacework" {}
module "lacework_svc_account" {
source = "lacework/gar/gcp"
version = "~> 1.0"
module "lacework_gar" {
lacework_integration_name = "Example GAR integration"
registry_domain = "us-docker.pkg.dev"
limit_by_tag = "example*"
limit_by_label = "example*"
limit_by_repos = "foo,bar"
limit_by_tags = ["example*"]
limit_by_label = ["example*"]
limit_by_repositories = ["foo","bar"]
limit_num_imgs = "10"
non_os_packages = true
}
```

Expand Down
10 changes: 6 additions & 4 deletions examples/configure-lacework-gar-integration/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
provider "google" {}
provider "google" {
}

provider "lacework" {}

Expand All @@ -8,8 +9,9 @@ module "lacework_gar" {
# configure the Lacework Artifact Registry integration
lacework_integration_name = "Example GAR integration"
registry_domain = "us-docker.pkg.dev"
limit_by_tag = "example*"
limit_by_label = "example*"
limit_by_repos = "foo,bar"
limit_by_tags = ["example*"]
limit_by_label = ["example*"]
limit_by_repositories = ["foo","bar"]
limit_num_imgs = "10"
non_os_package_support = true
}
4 changes: 2 additions & 2 deletions examples/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ provider "lacework" {}
provider "google" {}
module "lacework_gar" {
source = "lacework/gar/gcp"
version = "~> 1.0"
source = "lacework/gar/gcp"
version = "~> 0.1"
}
```

Expand Down
6 changes: 3 additions & 3 deletions examples/environment-variables-gar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ provider "google" {}
provider "lacework" {}
module "lacework_gar" {
source = "lacework/gar/gcp"
version = "~> 1.0"
source = "lacework/gar/gcp"
version = "~> 0.1"
}
```

For detailed information on integrating Lacework with Google Container Registry see [Integrate Google Container Registry](https://support.lacework.com/hc/en-us/articles/360047770014-Integrate-Google-Container-Registry)
For detailed information on integrating Lacework with Google Artifact Registry see [Integrate Google Artifact Registry](https://support.lacework.com/hc/en-us/articles/1500009169561-Integrate-Google-Artifact-Registry)
4 changes: 2 additions & 2 deletions examples/existing-service-account-gar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ provider "google" {}
provider "lacework" {}
module "lacework_svc_account" {
module "lacework_gar" {
source = "lacework/gar/gcp"
version = "~> 1.0"
version = "~> 0.1"
use_existing_service_account = true
service_account_name = "my-service-account"
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ resource "lacework_integration_gar" "default" {
value = values(var.limit_by_label)
}
*/
non_os_package_support = var.non_os_package_support
non_os_package_support = var.non_os_package_support

depends_on = [time_sleep.wait_time]
}
Expand Down
16 changes: 8 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "required_gar_apis" {
type = map(any)
default = {
resourcemanager = "cloudresourcemanager.googleapis.com"
resourcemanager = "cloudresourcemanager.googleapis.com"
artifactregistry = "artifactregistry.googleapis.com"
}
}
Expand Down Expand Up @@ -55,22 +55,22 @@ variable "registry_domain" {
}

variable "limit_by_tags" {
type = list(any)
default = []
type = list(any)
default = []
description = "An image tag to limit the assessment of images with matching tag. If you specify limit_by_tag and limit_by_label limits, they function as an AND. Supported field input are mytext*mytext, mytext, mytext*, or mytext. Only one * wildcard is supported. Defaults to empty."
}

variable "limit_by_label" {
type = list(any)
type = list(any)
default = [{
"" = ""
}]
description = "An image label to limit the assessment of images with matching label. If you specify limit_by_tag and limit_by_label limits, they function as an AND. Input is \"key\" = \"value\". Defaults to empty."
}

variable "limit_by_repositories" {
type = list(any)
default = []
type = list(any)
default = []
description = "A comma-separated list of repositories to assess. Defaults to empty (will assess all repositories in the registry)."
}

Expand All @@ -81,7 +81,7 @@ variable "limit_num_imgs" {
}

variable "non_os_package_support" {
type = bool
default = true
type = bool
default = true
description = "Whether or not the integration should check non-os packages in the container for vulnerabilities. Defaults to true"
}

0 comments on commit 0daab76

Please sign in to comment.