Skip to content

Commit

Permalink
doc(grype): fmt + minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Oct 12, 2023
1 parent cfc02f4 commit a2cf9f3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
33 changes: 21 additions & 12 deletions grype/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,44 @@
title: Grype
homepage: https://github.com/anchore/grype/
tagline: |
Grype is a vulnerability scanner for container images and filesystems.
Grype is a vulnerability scanner for container images and filesystems.
---

To update or switch versions, run `webi grype@stable` (or `@v0.6`, `@beta`,
etc)
To update or switch versions, run `webi grype@stable` (or `@v0.6`, `@beta`, etc)

### Files

```text
~/.config/envman/PATH.env
~/.grype.yaml
~/.local/bin/grype
```

## Cheat Sheet

> It also helps find vulnerabilites for major operating system and language-specific packages.
> Supports Docker, OCI and Singularity image formats, OpenVEX support for filtering and augmenting scanning results.
> Works with `syft`, a powerful `SBOM` (software bill of materials) tool for container images and filesystems
> It also helps find vulnerabilities for major operating system and
> language-specific packages. Supports Docker, OCI and Singularity image
> formats, OpenVEX support for filtering and augmenting scanning results. Works
> with `syft`, a powerful `SBOM` (software bill of materials) tool for container
> images and file systems
### To scan for vulnerabilities in an image:
### How to for vulnerabilities in an image

```sh
grype <image>
```

### To scan all image layers
### How to scan all image layers

```sh
grype <image> --scope all-layers
```

### To run grype from a Docker container so it can scan a running container
### How to scan a running container

```sh
docker run --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--name Grype anchore/grype:latest \
$(ImageName):$(ImageTag)
--volume /var/run/docker.sock:/var/run/docker.sock \
--name Grype anchore/grype:latest \
my_image_name:my_image_tag
```
8 changes: 4 additions & 4 deletions grype/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
set -u

__init_grype() {

##################
# Install Grype #
##################
Expand All @@ -24,15 +24,15 @@ __init_grype() {
mkdir -p "$(dirname "${pkg_src_cmd}")"

# mv ./grype ~/.local/opt/grype-v0.99.9/bin/grype
mv ./"$pkg_cmd_name"* "$pkg_src"
mv ./"$pkg_cmd_name"* "$pkg_src"
}

# pkg_get_current_version is recommended, but not required
pkg_get_current_version() {
# 'grype --version' has output in this format:
# grype 0.99.9 (rev abcdef0123)
# grype 0.70.0
# This trims it down to just the version number:
# 0.99.9
# 0.70.0
grype --version 2> /dev/null |
head -n 1 |
cut -d ' ' -f 2
Expand Down

0 comments on commit a2cf9f3

Please sign in to comment.