-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update image version in manifest to v0.2.2
- Loading branch information
github-actions
committed
Jul 12, 2021
1 parent
8b57f0f
commit 80f1390
Showing
9 changed files
with
129 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
# Copyright 2021 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: kpt.dev/v1 | ||
kind: Kptfile | ||
metadata: | ||
name: gatekeeper-securitycenter | ||
annotations: | ||
config.kubernetes.io/local-config: 'true' | ||
config.kubernetes.io/local-config: "true" | ||
info: | ||
description: kpt package for gatekeeper-securitycenter |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# `gatekeeper-securitycenter` controller kpt package | ||
|
||
kpt package for the `gatekeeper-securitycenter` Kubernetes controller. | ||
|
||
## Usage | ||
|
||
This package assumes that you have already created the | ||
[prerequisite resources](https://github.com/GoogleCloudPlatform/gatekeeper-securitycenter#prerequisites). | ||
|
||
### Tools required | ||
|
||
- [kpt](https://kpt.dev/installation/) v1.0.0-beta.1 or later | ||
|
||
- [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) | ||
|
||
### Fetch this package | ||
|
||
```sh | ||
VERSION=v0.2.1 | ||
|
||
kpt pkg get https://github.com/GoogleCloudPlatform/gatekeeper-securitycenter.git/manifests@$VERSION manifests | ||
``` | ||
|
||
### Set source name and cluster name | ||
|
||
1. Set the Security Command Center source name: | ||
|
||
```sh | ||
kpt fn eval manifests \ | ||
--image gcr.io/kpt-fn/apply-setters:v0.1 -- \ | ||
"source=$SOURCE_NAME" | ||
``` | ||
|
||
Where `$SOURCE_NAME` is your Security Command Center source in the format | ||
`organizations/$ORGANIZATION_ID/sources/$SOURCE_ID`. | ||
|
||
2. (Optional) Set the cluster name. You can use any name you like, or you can | ||
leave it blank. If you provide a cluster name, it will be visible in | ||
Security Command Center. As an example, you can use your current kubectl | ||
context name: | ||
|
||
```sh | ||
kpt fn eval manifests \ | ||
--image gcr.io/kpt-fn/apply-setters:v0.1 -- \ | ||
"cluster=$(kubectl config current-context)" | ||
``` | ||
|
||
### Add Workload Identity annotation | ||
|
||
If your Google Kubernetes Engine (GKE) cluster uses | ||
[Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity), | ||
add an annotation for the Google service account `FINDINGS_EDITOR_SA` to bind | ||
it to the `gatekeeper-securitycenter-controller` Kubernetes service account: | ||
|
||
```sh | ||
kustomize cfg annotate manifests/ \ | ||
--kind ServiceAccount \ | ||
--name gatekeeper-securitycenter-controller \ | ||
--namespace gatekeeper-securitycenter \ | ||
--kv "iam.gke.io/gcp-service-account=$FINDINGS_EDITOR_SA" | ||
``` | ||
|
||
The Google service account must have the | ||
[Security Center Findings Editor](https://cloud.google.com/iam/docs/understanding-roles#security-center-roles) | ||
Cloud IAM role on the source or at the organization level. | ||
|
||
If you don't use Workload Identity, see the documentation on | ||
[Authenticating to Google Cloud with service accounts](https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform) | ||
for alternative instructions on how to provide Google service account | ||
credentials to the `gatekeeper-securitycenter` controller pods. | ||
|
||
### Setup inventory tracking for the package | ||
|
||
```sh | ||
kpt live init manifests | ||
``` | ||
|
||
### Apply the package | ||
|
||
```sh | ||
kpt live apply manifests --reconcile-timeout=3m --output=table | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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