This file contains hidden or 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
export PROJECT_ID=`gcloud config get-value core/project` | |
export PROJECT_NUMBER=`gcloud projects describe $PROJECT_ID --format='value(projectNumber)'` | |
gcloud iam service-accounts create ocsp-svc | |
gcloud container clusters create cluster-1 --workload-pool=$PROJECT_ID.svc.id.goog | |
kubectl create namespace ns1 | |
kubectl create serviceaccount --namespace ns1 ksa-1 | |
gcloud iam service-accounts add-iam-policy-binding \ |
This file contains hidden or 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
import os | |
import json | |
import time | |
from google.auth import impersonated_credentials | |
from google.auth.transport.requests import AuthorizedSession, Request | |
import google.oauth2.credentials | |
from google.cloud import iam_credentials_v1 | |
# export GCLOUD_USER=`gcloud config get-value core/account` |
This file contains hidden or 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
from flask import Flask | |
import os | |
import json | |
import time | |
from google.auth import compute_engine | |
from werkzeug.exceptions import HTTPException | |
from google.auth.transport.requests import AuthorizedSession, Request | |
import google.oauth2.credentials | |
from google.cloud import iam_credentials_v1 |
This file contains hidden or 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
package remote | |
import ( | |
"crypto/hmac" | |
"crypto/sha256" | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"io" | |
"net/http" |
This file contains hidden or 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
package remote | |
import ( | |
"context" | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"strconv" | |
"sync" |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"io" | |
logging "cloud.google.com/go/logging/apiv2" | |
"golang.org/x/net/context" | |
"google.golang.org/genproto/googleapis/cloud/audit" | |
loggingpb "google.golang.org/genproto/googleapis/logging/v2" |
This file contains hidden or 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
package main | |
import ( | |
"context" | |
"encoding/base64" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" |
This file contains hidden or 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
bq query --nouse_legacy_sql ' | |
SELECT | |
DISTINCT(id), service_name,severity,external_desc, begin,`end` , modified | |
FROM | |
gcp-status-log.status_dataset.status | |
WHERE | |
service_name = "Google Compute Engine" | |
ORDER BY | |
modified | |
' |
This file contains hidden or 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
package main | |
/* | |
Issue self-signed JWTs signBlob on Cloud Run, Cloud Functions, GCE, GKE | |
Assume the environment is running as `your_svc_account@project_id.iam.gserviceaccount.com ` | |
This file contains hidden or 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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"math/rand" | |
"net" | |
"net/http" |