Skip to content

Commit 6d3cec0

Browse files
authored
Merge pull request #8 from CallMeGreg/CallMeGreg/release-cleanup
Call me greg/release cleanup
2 parents a13923c + 1912a5e commit 6d3cec0

File tree

1 file changed

+54
-16
lines changed

1 file changed

+54
-16
lines changed

README.md

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,77 @@
11
# Overview
22
This project is a GitHub CLI (`gh`) extension that provides commands for interacting with secret scanning alerts. Primary uses include:
33
- Listing secret scanning alerts for an enterprise, organization, or repository
4-
- :construction: (TBA) Verifying if a secret is valid (for select providers)
5-
- :construction: (TBA) Opening issues in repos that contain verified secrets
4+
- Verifying if a secret is valid
5+
- Opening issues in repos that contain valid secrets
6+
7+
# Supported Token Types
8+
- GitHub Personal Access Tokens
9+
- Slack API Tokens
610

711
# Pre-requisites
812
- [GitHub CLI](https://github.com/cli/cli#installation)
913
- GitHub Enterprise Server 3.7+ or GitHub Enterprise Cloud
1014

1115
# Installation
12-
```bash
16+
```
1317
gh extension install CallMeGreg/gh-secret-scanning
1418
```
1519

1620
# Usage
1721
Authenticate with your GitHub Enterprise Server or GitHub Enterprise Cloud account:
18-
```bash
22+
```
1923
gh auth login
2024
```
2125

2226
## Alerts subcommand
23-
List secret scanning alerts for an enterprise:
24-
```bash
27+
Target either an enterprise, organization, or repository by specifying the `-e`, `-o`, or `-r` flags respectively. _Exactly one selection from these three flags is required._
28+
29+
```
2530
gh secret-scanning alerts -e <enterprise>
2631
```
2732

28-
List secret scanning alerts for an organization:
29-
```bash
33+
```
3034
gh secret-scanning alerts -o <organization>
3135
```
3236

33-
List secret scanning alerts for a repository:
34-
```bash
37+
```
3538
gh secret-scanning alerts -r <repository>
3639
```
3740

38-
Add flags to specify a GHES server, limit the number of secrets processed, filter for a specific secret provider, display the secret values, generate a csv report, include extra fields, and more:
39-
```bash
40-
gh secret-scanning alerts -e github -u my-github-server.com -l 10 -p slack -s -c -v
41+
Optionally add flags to specify a GHES server, limit the number of secrets processed, filter for a specific secret provider, display the secret values, generate a csv report, include extra fields, and more:
42+
```
43+
gh secret-scanning alerts -e github --url my-github-server.com --limit 10 --provider slack --show-secret --csv --verbose
44+
```
45+
46+
## Verify subcommand
47+
Target either an enterprise, organization, or repository by specifying the `-e`, `-o`, or `-r` flags respectively. _Exactly one selection from these three flags is required._
48+
49+
```
50+
gh secret-scanning verify -e <enterprise>
51+
```
52+
53+
```
54+
gh secret-scanning verify -o <organization>
55+
```
56+
57+
```
58+
gh secret-scanning verify -r <repository>
59+
```
60+
61+
Optionally add flags to specify a GHES server, limit the number of secrets processed, filter for a specific secret provider, display the secret values, generate a csv report, include extra fields, and more:
62+
```
63+
gh secret-scanning verify -e github --url my-github-server.com --limit 10 --provider slack --show-secret --csv --verbose
64+
```
65+
66+
Also, optionally create issue in any repository that contains a valid secret using the `--create-issues` (`-i`) flag:
67+
```
68+
gh secret-scanning verify -e github --url my-github-server.com --create-issues
4169
```
4270

71+
4372
## Help
4473
See available commands and flags by running:
45-
```bash
74+
```
4675
gh secret-scanning -h
4776
```
4877

@@ -55,6 +84,7 @@ Usage:
5584
Available Commands:
5685
alerts Get secret scanning alerts for an enterprise, organization, or repository
5786
help Help about any command
87+
verify Verify alerts for an enterprise, organization, or repository
5888
5989
Flags:
6090
-c, --csv Generate a csv report of the results
@@ -67,7 +97,15 @@ Flags:
6797
-r, --repository string GitHub owner/repository slug
6898
-s, --show-secret Display secret values
6999
-u, --url string GitHub host to connect to (default "github.com")
70-
-v, --verbose Generate verbose output
100+
-v, --verbose Include additional secret alert fields
71101
72102
Use "secret-scanning [command] --help" for more information about a command.
73-
```
103+
```
104+
105+
# Demo
106+
This example first lists the alerts for an organization with the `alerts` subcommand, and then verifies the secrets with the `verify` subcommand. The `-c` flag is used to generate a csv report of the results, and the `-i` flag is used to create an issue in any repository that contains a valid secret.
107+
108+
https://github.com/CallMeGreg/gh-secret-scanning/assets/110078080/58f685a2-52a8-4478-92f9-d7468065ede5
109+
110+
111+

0 commit comments

Comments
 (0)