Skip to content

Container Analysis samples #2258

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

Merged
merged 32 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2eefd56
added container analysis samples and tests
daniel-sanche Feb 16, 2018
4510418
added v1 libraries
daniel-sanche Jun 11, 2019
210451c
updated region tags
daniel-sanche Jun 11, 2019
121796a
removed doc comments
daniel-sanche Jun 11, 2019
84caf87
removed update samples
daniel-sanche Jun 11, 2019
17269c2
updated parameters to be consistent with other languages
daniel-sanche Jun 11, 2019
f688b38
resolved compiler errors
daniel-sanche Jun 11, 2019
4669433
got client working for development
daniel-sanche Jun 12, 2019
0894f76
added sample note
daniel-sanche Jun 12, 2019
c5cb60a
updated create_occurrence
daniel-sanche Jun 12, 2019
132fc5c
got pubsub working
daniel-sanche Jun 12, 2019
d5498f1
implemented poll_discovery_occurrence
daniel-sanche Jun 13, 2019
2e70dd2
use runtimeerror
daniel-sanche Jun 13, 2019
ca20894
implemented find_vulnerabilities and find_high_severity
daniel-sanche Jun 13, 2019
104c27a
moved imports into functions
daniel-sanche Jun 13, 2019
e2a7d35
replaces " with '
daniel-sanche Jun 13, 2019
37a6247
added comments to samples
daniel-sanche Jun 13, 2019
8144f75
use released libraries
daniel-sanche Jun 20, 2019
0c2e311
updated client creation in samples
daniel-sanche Jun 20, 2019
de15238
fixed broken tests
daniel-sanche Jun 20, 2019
bed1dcb
fixed linter issues
daniel-sanche Jun 20, 2019
95ba536
Merge branch 'master' into container-analysis-ga
daniel-sanche Jun 20, 2019
2940dda
updated topic
daniel-sanche Jul 3, 2019
fdd94cc
added README
daniel-sanche Jul 3, 2019
6c252b3
fixed typo
daniel-sanche Jul 3, 2019
e8f79f8
readme fixes
daniel-sanche Jul 4, 2019
67f2b0f
updated pubsub version
daniel-sanche Jul 4, 2019
601dbb5
reverted pubsub topic
daniel-sanche Jul 4, 2019
0c318db
create topic if needed
daniel-sanche Jul 8, 2019
b3203e7
add instructions for authentication to README
daniel-sanche Jul 8, 2019
cccf56c
Merge branch 'master' into container-analysis-ga
daniel-sanche Jul 9, 2019
8e603f3
replaced pytest with nox in README
daniel-sanche Jul 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions container_registry/container_analysis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv*
54 changes: 54 additions & 0 deletions container_registry/container_analysis/README.md
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 container_registry/container_analysis/requirements.txt
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
Loading