Skip to content

Commit 356d44c

Browse files
committed
README
1 parent 686e53e commit 356d44c

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
# GHAS API scripts
1+
# GitHub Advanced Security (GHAS) API scripts
2+
3+
GitHub Advanced Security offers a range of rich REST APIs to access and manage alerts.
4+
5+
This is a set of scripts that use these APIs to access and manage alerts. The scripts are written in Python and use a wrapper around the API requests to manage authentication, pagination and rate limiting.
6+
7+
> [!WARNING]
8+
> These scripts are not supported by GitHub. They are provided as-is, and come with no support or commitments.
9+
> They are intended to be used as examples, and can be modified to suit your needs
210
311
## Requirements
412

513
- Python 3.10 or higher
614
- Install dependencies with `python3 -mpip install -r requirements.txt`
7-
- Put a GitHub token in your environment in `GITHUB_TOKEN`
15+
- Put a suitable GitHub token in your environment in `GITHUB_TOKEN`
16+
- requires read access to GitHub Advanced Security alerts
17+
- requires read access to the repository, organization or Enterprise you are querying
18+
- Note that Secret Scanning alerts are only available to admins of the repository, organization or Enterprise, a security manager, or where explicitly enabled by the repository owner
819

920
## Usage
1021

11-
The date in `--since` can be specified as `YYYY-MM-DD` or as `Nd` where `N` is the number of days ago. Full ISO formats are also supported. If a timezone is not specified, the date is assumed to be in UTC (`Z` timezone).
22+
Generally, the date in `--since` can be specified as `YYYY-MM-DD` or as `Nd` where `N` is the number of days ago. Full ISO formats are also supported. If a timezone is not specified, the date is assumed to be in UTC (`Z` timezone).
23+
24+
Run each specific script according to the help for each script.
25+
26+
### List secret scanning alerts
1227

1328
```text
1429
usage: list_secret_scanning_alerts.py [-h] [--scope {ent,org,repo}] [--bypassed] [--state {open,resolved}] [--no-include-secret] [--since SINCE] [--json] [--quote-all] [--hostname HOSTNAME] [--debug] name
@@ -35,6 +50,8 @@ options:
3550
--debug, -d Enable debug logging
3651
```
3752

53+
### List code scanning alerts
54+
3855
```text
3956
usage: list_code_scanning_alerts.py [-h] [--scope {ent,org,repo}] [--state {open,resolved}] [--since SINCE] [--json] [--quote-all] [--hostname HOSTNAME] [--debug] name
4057
@@ -57,6 +74,8 @@ options:
5774
--debug, -d Enable debug logging
5875
```
5976

77+
### Replay code scanning alert statusß
78+
6079
```text
6180
usage: replay_code_scanning_alert_status.py [-h] [--scope {ent,org,repo}] [--state {open,resolved}] [--since SINCE] [--json] [--quote-all] [--hostname HOSTNAME] [--debug] name
6281
@@ -79,6 +98,8 @@ options:
7998
--debug, -d Enable debug logging
8099
```
81100

101+
### Replay secret scanning alert status
102+
82103
```text
83104
usage: replay_secret_scanning_result_status.py [-h] [--scope {ent,org,repo}] [--state {open,resolved}] [--since SINCE] [--json] [--quote-all] [--hostname HOSTNAME] [--debug] name
84105
@@ -102,6 +123,8 @@ options:
102123
--debug, -d Enable debug logging
103124
```
104125

126+
### Enrich code scanning alerts
127+
105128
```text
106129
usage: enrich_code_scanning_alerts.py [-h] [--mitre-cwe-csv MITRE_CWE_CSV] [--metadata-format {codeql,parse_ql}] [--debug] [--format {json,html}] [--fields FIELDS] [--groupby GROUPBY] alerts metadata scope
107130
@@ -128,6 +151,8 @@ options:
128151
Field to group the alerts by
129152
```
130153

154+
### Resolve duplicate secret scanning alerts
155+
131156
```text
132157
usage: resolve_duplicate_secret_scanning_alerts.py [-h] [--scope {ent,org,repo}] [--state {open,resolved}] [--since SINCE] [--hostname HOSTNAME] [--debug] [--add-matching-secret OLD_TYPE NEW_TYPE] name
133158

0 commit comments

Comments
 (0)