elastic / elastic/integrations
[Github Audit]: Split the values in the field github.token_scopes into an array
- Dominant language
- Handlebars
- Stars
- 333
- Forks
- 647
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 209
Description
### Integration Name
GitHub [packages/github]
### Dataset Name
github.audit
### Integration Version
unrelated
### Agent Version
unrelated
### OS Version and Architecture
unrelated
### User Goal
The field `github.token_scopes` have information about the scopes of a token being used to make requests to github or when a personal access token is added to an organization.
A token can have multiple scopes and the user should be able to filter by them individually, like `repo`, `read:user`, `read:org` etc, so the field `github.token_scopes` should be an array where every item is a scope of the token being used.
### Existing Features
It is not possible to filter individually by a specific scope as the value is a single string, the workaround is to use wildcard queries instead of searching for the exact scope name.
### What did you see?
Currently the field `github.token_scopes` is a single string containing all the scopes.
### Anything else?
This is a pretty simple improvement, a simple `split` processor in the ingest pipeline like below will work:
```
{
"split": {
"ignore_failure": true,
"ignore_missing": true,
"field": "github.token_scopes",
"separator": ",",
"if": "ctx?.github?.token_scopes != null"
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.