-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from cloudskiff/add_github_repository
Add support for github_repository
- Loading branch information
Showing
41 changed files
with
9,322 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Sometimes mock use unexported struct | ||
inpackage: true | ||
testonly: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Supported remotes | ||
|
||
- [AWS](aws.md) | ||
- [AWS](aws.md) | ||
- [Github](github.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Github | ||
|
||
## Authentication | ||
|
||
To use driftctl, we need credentials to make authenticated requests to github. Just like the terraform provider, we retrieve config from [environment variables](https://registry.terraform.io/providers/integrations/github/latest/docs#argument-reference). | ||
|
||
```bash | ||
$ GITHUB_TOKEN=14758f1afd44c09b7992073ccf00b43d GITHUB_ORGANIZATION=my-org driftctl scan --to github+tf | ||
``` | ||
|
||
## Least privileged policy | ||
|
||
Below you can find the minimal scope required for driftctl to be able to scan every github supported resources. | ||
|
||
```shell | ||
repo # Required to enumerate public and private repos | ||
``` | ||
|
||
**⚠️ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
pkg/iac/terraform/state/test/github_repository/result.golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ | ||
"AllowMergeCommit": true, | ||
"AllowRebaseMerge": true, | ||
"AllowSquashMerge": true, | ||
"ArchiveOnDestroy": null, | ||
"Archived": false, | ||
"AutoInit": null, | ||
"DefaultBranch": "main", | ||
"DeleteBranchOnMerge": false, | ||
"Description": "this is a private repo", | ||
"Etag": "W/\"04420b05933b55f136bb12b9c8d1748e67e143b290d72ecadd0fd2d4f4a3048a\"", | ||
"FullName": "driftctl-test/private-repo", | ||
"GitCloneUrl": "git://github.com/driftctl-test/private-repo.git", | ||
"GitignoreTemplate": null, | ||
"HasDownloads": false, | ||
"HasIssues": false, | ||
"HasProjects": false, | ||
"HasWiki": false, | ||
"HomepageUrl": "", | ||
"HtmlUrl": "https://github.com/driftctl-test/private-repo", | ||
"HttpCloneUrl": "https://github.com/driftctl-test/private-repo.git", | ||
"Id": "private-repo", | ||
"IsTemplate": false, | ||
"LicenseTemplate": null, | ||
"Name": "private-repo", | ||
"NodeId": "MDEwOlJlcG9zaXRvcnkzMzkwNzY5NjQ=", | ||
"Private": true, | ||
"RepoId": 339076964, | ||
"SshCloneUrl": "[email protected]:driftctl-test/private-repo.git", | ||
"SvnUrl": "https://github.com/driftctl-test/private-repo", | ||
"Topics": null, | ||
"Visibility": "private", | ||
"VulnerabilityAlerts": false, | ||
"Pages": [], | ||
"Template": [] | ||
}, | ||
{ | ||
"AllowMergeCommit": true, | ||
"AllowRebaseMerge": true, | ||
"AllowSquashMerge": true, | ||
"ArchiveOnDestroy": null, | ||
"Archived": false, | ||
"AutoInit": null, | ||
"DefaultBranch": "main", | ||
"DeleteBranchOnMerge": false, | ||
"Description": "", | ||
"Etag": "W/\"3e7a2583fb97097c8acbcb4c289e46fc0db70341071c5f55972bbd3270a2b957\"", | ||
"FullName": "driftctl-test/public-repo", | ||
"GitCloneUrl": "git://github.com/driftctl-test/public-repo.git", | ||
"GitignoreTemplate": null, | ||
"HasDownloads": false, | ||
"HasIssues": false, | ||
"HasProjects": false, | ||
"HasWiki": false, | ||
"HomepageUrl": "", | ||
"HtmlUrl": "https://github.com/driftctl-test/public-repo", | ||
"HttpCloneUrl": "https://github.com/driftctl-test/public-repo.git", | ||
"Id": "public-repo", | ||
"IsTemplate": false, | ||
"LicenseTemplate": null, | ||
"Name": "public-repo", | ||
"NodeId": "MDEwOlJlcG9zaXRvcnkzMzkwNzY5Nzg=", | ||
"Private": false, | ||
"RepoId": 339076978, | ||
"SshCloneUrl": "[email protected]:driftctl-test/public-repo.git", | ||
"SvnUrl": "https://github.com/driftctl-test/public-repo", | ||
"Topics": null, | ||
"Visibility": "public", | ||
"VulnerabilityAlerts": false, | ||
"Pages": [], | ||
"Template": [] | ||
} | ||
] |
Oops, something went wrong.