-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Container Analysis samples [(#2258)](GoogleCloudPlatform/python-docs-…
…samples#2258) added container analysis samples and tests
- Loading branch information
1 parent
d79408e
commit a3985c8
Showing
5 changed files
with
728 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/google-cloud-containeranalysis/samples/snippets/.gitignore
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 @@ | ||
venv* |
54 changes: 54 additions & 0 deletions
54
packages/google-cloud-containeranalysis/samples/snippets/README.md
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,54 @@ | ||
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google | ||
Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" | ||
width="96"/> | ||
|
||
# Google Cloud Container Analysis Samples | ||
|
||
|
||
Container Analysis scans container images stored in Container Registry for vulnerabilities. | ||
Continuous automated analysis of containers keep you informed about known vulnerabilities so | ||
that you can review and address issues before deployment. | ||
|
||
Additionally, third-party metadata providers can use Container Analysis to store and | ||
retrieve additional metadata for their customers' images, such as packages installed in an image. | ||
|
||
|
||
## Description | ||
|
||
These samples show how to use the [Google Cloud Container Analysis Client Library](https://cloud.google.com/container-registry/docs/reference/libraries). | ||
|
||
## Build and Run | ||
1. **Enable APIs** | ||
- [Enable the Container Analysis API](https://console.cloud.google.com/flows/enableapi?apiid=containeranalysis.googleapis.com) | ||
and create a new project or select an existing project. | ||
1. **Install and Initialize Cloud SDK** | ||
- Follow instructions from the available [quickstarts](https://cloud.google.com/sdk/docs/quickstarts) | ||
1. **Authenticate with GCP** | ||
- Typically, you should authenticate using a [service account key](https://cloud.google.com/docs/authentication/getting-started) | ||
1. **Clone the repo** and cd into this directory | ||
|
||
``` | ||
git clone https://github.com/GoogleCloudPlatform/python-docs-samples | ||
cd python-docs-samples | ||
``` | ||
|
||
1. **Set Environment Variables** | ||
|
||
``` | ||
export GCLOUD_PROJECT="YOUR_PROJECT_ID" | ||
``` | ||
|
||
1. **Run Tests** | ||
|
||
``` | ||
nox -s "py36(sample='./container_registry/container_analysis')" | ||
``` | ||
|
||
## Contributing changes | ||
|
||
* See [CONTRIBUTING.md](../../CONTRIBUTING.md) | ||
|
||
## Licensing | ||
|
||
* See [LICENSE](../../LICENSE) | ||
|
6 changes: 6 additions & 0 deletions
6
packages/google-cloud-containeranalysis/samples/snippets/requirements.txt
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,6 @@ | ||
google-cloud-pubsub == 0.42.1 | ||
google-cloud-containeranalysis == 0.1.0 | ||
grafeas == 0.1.0 | ||
pytest | ||
flaky | ||
mock |
Oops, something went wrong.