Skip to content

Commit

Permalink
Add github_team
Browse files Browse the repository at this point in the history
  • Loading branch information
Elie committed Feb 24, 2021
1 parent 9ad9c1f commit cd6f294
Show file tree
Hide file tree
Showing 27 changed files with 8,785 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/cmd/scan/supported_resources/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ Below you can find the minimal scope required for driftctl to be able to scan ev

```shell
repo # Required to enumerate public and private repos
read:org # Used to list your organization teams
```

**⚠️ Beware that if you don't set correct permissions for your token, you won't see any errors and all resources will appear as deleted from remote**

## Supported resources

- [x] github_repository
- [x] github_team
1 change: 1 addition & 0 deletions pkg/iac/deserializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ func Deserializers() []deserializer.CTYDeserializer {
awsdeserializer.NewCloudfrontDistributionDeserializer(),

ghdeserializer.NewGithubRepositoryDeserializer(),
ghdeserializer.NewGithubTeamDeserializer(),
}
}
1 change: 1 addition & 0 deletions pkg/iac/terraform/state/terraform_state_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func TestTerraformStateReader_Github_Resources(t *testing.T) {
wantErr bool
}{
{name: "github repository", dirName: "github_repository", wantErr: false},
{name: "github team", dirName: "github_team", wantErr: false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
41 changes: 41 additions & 0 deletions pkg/iac/terraform/state/test/github_team/result.golden.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[
{
"CreateDefaultMaintainer": false,
"Description": "test",
"Etag": "W/\"04b608322c60381373485f1154b7670f1daeb6bdfa9062f7eba05739171fcac0\"",
"Id": "4556715",
"LdapDn": "",
"MembersCount": 1,
"Name": "team1",
"NodeId": "MDQ6VGVhbTQ1NTY3MTU=",
"ParentTeamId": null,
"Privacy": "closed",
"Slug": "team1"
},
{
"CreateDefaultMaintainer": false,
"Description": "test 2",
"Etag": "W/\"1af373c3f173859e7f06690e8e353c21a9a1a90224963e8f162546f1022af224\"",
"Id": "4556719",
"LdapDn": "",
"MembersCount": 1,
"Name": "team2",
"NodeId": "MDQ6VGVhbTQ1NTY3MTk=",
"ParentTeamId": null,
"Privacy": "secret",
"Slug": "team2"
},
{
"CreateDefaultMaintainer": false,
"Description": "test parent team",
"Etag": "W/\"d6fded1b23237d988a0914455547a2e66789bb625fc0a519babe993429facd37\"",
"Id": "4556747",
"LdapDn": "",
"MembersCount": 1,
"Name": "new team with parent",
"NodeId": "MDQ6VGVhbTQ1NTY3NDc=",
"ParentTeamId": 4556715,
"Privacy": "closed",
"Slug": "new-team-with-parent"
}
]
Loading

0 comments on commit cd6f294

Please sign in to comment.