Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add K8S as provider and GKE in GCP #329

Merged
merged 18 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOMOD=$(GOCMD) mod
GOTEST=$(GOCMD) test
GOFLAGS := -v
# This should be disabled if the binary uses pprof
LDFLAGS := -s -w

ifneq ($(shell go env GOOS),darwin)
LDFLAGS := -extldflags "-static"
endif

all: build
build:
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "cloudlist" cmd/cloudlist/main.go
test:
$(GOTEST) $(GOFLAGS) ./...
tidy:
$(GOMOD) tidy
45 changes: 33 additions & 12 deletions PROVIDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Amazon Web Services can be integrated by using the following configuration block
```yaml
- # provider is the name of the provider
provider: aws
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# aws_access_key is the access key for AWS account
aws_access_key: $AWS_ACCESS_KEY
Expand Down Expand Up @@ -35,7 +35,7 @@ Google Cloud Platform can be integrated by using the following configuration blo
```yaml
- # provider is the name of the provider
provider: gcp
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# gcp_service_account_key is the key token of service account.
gcp_service_account_key: '{}'
Expand All @@ -58,7 +58,7 @@ Microsoft Azure can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: azure
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# client_id is the client ID of registered application of the azure account (not requuired if using cli auth)
client_id: $AZURE_CLIENT_ID
Expand Down Expand Up @@ -150,7 +150,7 @@ Heroku can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: heroku
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# heroku_api_token is the authorization token for Heroku account
heroku_api_token: $HEROKU_API_TOKEN
Expand Down Expand Up @@ -181,7 +181,7 @@ Fastly can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: fastly
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# fastly_api_key is the personal API token for fastly account
fastly_api_key: $FASTLY_API_KEY
Expand All @@ -200,7 +200,7 @@ Linode can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: linode
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# linode_personal_access_token is the personal access token for Linode account
linode_personal_access_token: $LINODE_PERSONAL_ACCESS_TOKEN
Expand All @@ -219,7 +219,7 @@ Namecheap can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: namecheap
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# namecheap_api_key is the api key for namecheap account
namecheap_api_key: $NAMECHEAP_API_KEY
Expand All @@ -245,7 +245,7 @@ Alibaba Cloud can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: alibaba
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# alibaba_region_id is the region id of the resources
alibaba_region_id: $ALIBABA_REGION_ID
Expand All @@ -270,7 +270,7 @@ Terraform can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: terraform
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
#tf_state_file is the location of terraform state file (terraform.tfsate)
tf_state_file: path/to/terraform.tfstate
Expand All @@ -284,7 +284,7 @@ Hashicorp Consul can be integrated by using the following configuration block.
provider: consul
# consul_url is the url for consul server
consul_url: http://localhost:8500/
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# consul_ca_file is the path to consul CA file
# consul_ca_file: <path-to-ca-file>.pem
Expand Down Expand Up @@ -312,7 +312,7 @@ Hashicorp Nomad can be integrated by using the following configuration block.
provider: nomad
# nomad_url is the url for nomad server
nomad_url: http://127.0.0.1:4646/
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# nomad_ca_file is the path to nomad CA file
# nomad_ca_file: <path-to-ca-file>.pem
Expand All @@ -339,11 +339,32 @@ Hetzner Cloud can be integrated by using the following configuration block.
```yaml
- # provider is the name of the provider
provider: hetzner
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# auth_token is the is the hetzner authentication token
auth_token: $HETZNER_AUTH_TOKEN
```

References -
- https://docs.hetzner.cloud/#authentication

### Kubernetes

Kubernetes can be integrated by using the following configuration block.

```yaml
- # provider is the name of the provider
provider: kubernetes
# id is the name defined by user for filtering (optional)
id: staging
# kubeconfig is the path to kubeconfig file
kubeconfig: path/to/kubeconfig
# context is the context to be used from kubeconfig file (optional), if not specified, current-context will be used
context: <context-name>
```

References -
- https://www.redhat.com/sysadmin/kubeconfig
- https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html
- https://learn.microsoft.com/en-us/azure/aks/control-kubeconfig-access#get-and-verify-the-configuration-information
- https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#store_info
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ cloudlist -silent | httpx -silent | nuclei -t cves/
- S3
- GCP (Google Cloud Platform)
- Cloud DNS
- GKE
- DO (DigitalOcean)
- Instances
- SCW (Scaleway)
Expand All @@ -159,6 +160,9 @@ cloudlist -silent | httpx -silent | nuclei -t cves/
- Instances
- Openstack
- Instances
- Kubernetes
- Services
- Ingresses

# Configuration file

Expand All @@ -169,7 +173,7 @@ The default provider config file should be located at `$HOME/.config/cloudlist/p

```yaml
- provider: do # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: xxxx
# digitalocean_token is the API key for digitalocean cloud platform
digitalocean_token: $DIGITALOCEAN_TOKEN
Expand All @@ -181,7 +185,7 @@ The default provider config file should be located at `$HOME/.config/cloudlist/p
scaleway_access_token: $SCALEWAY_ACCESS_TOKEN

- provider: aws # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# aws_access_key is the access key for AWS account
aws_access_key: $AWS_ACCESS_KEY
Expand All @@ -197,7 +201,7 @@ The default provider config file should be located at `$HOME/.config/cloudlist/p
gcp_service_account_key: '{xxxxxxxxxxxxx}'

- provider: azure # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# client_id is the client ID of registered application of the azure account (not requuired if using cli auth)
client_id: $AZURE_CLIENT_ID
Expand All @@ -219,25 +223,25 @@ The default provider config file should be located at `$HOME/.config/cloudlist/p
api_token: $CF_API_TOKEN

- provider: heroku # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# heroku_api_token is the api key for Heroku account
heroku_api_token: $HEROKU_API_TOKEN

- provider: linode # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# linode_personal_access_token is the personal access token for linode account
linode_personal_access_token: $LINODE_PERSONAL_ACCESS_TOKEN

- provider: fastly # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# fastly_api_key is the personal API token for fastly account
fastly_api_key: $FASTLY_API_KEY

- provider: alibaba # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# alibaba_region_id is the region id of the resources
alibaba_region_id: $ALIBABA_REGION_ID
Expand All @@ -247,21 +251,21 @@ The default provider config file should be located at `$HOME/.config/cloudlist/p
alibaba_access_key_secret: $ALIBABA_ACCESS_KEY_SECRET

- provider: namecheap # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# namecheap_api_key is the api key for namecheap account
namecheap_api_key: $NAMECHEAP_API_KEY
# namecheap_user_name is the username of the namecheap account
namecheap_user_name: $NAMECHEAP_USER_NAME

- provider: terraform # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
#tf_state_file is the location of terraform state file (terraform.tfsate)
tf_state_file: path/to/terraform.tfstate

- provider: hetzner # provider is the name of the provider
id is the name defined by user for filtering (optional)
# id is the name defined by user for filtering (optional)
id: staging
# auth_token is the is the hetzner authentication token
auth_token: $HETZNER_AUTH_TOKEN
Expand Down Expand Up @@ -307,6 +311,15 @@ The default provider config file should be located at `$HOME/.config/cloudlist/p
username: $OS_USERNAME
# password is Openstack password used to authenticate
password: $OS_PASSWORD

- provider: kubernetes # provider is the name of the provider
# id is the name of the provider id
id: staging
# kubeconfig_file is the path of kubeconfig file
kubeconfig: path/to/kubeconfig
# context is the context to be used from kubeconfig file
context: <context-name>

```

</details>
Expand Down
Loading