In this quick demo we will take a look at a "Cloud Native" and security-focused lab in GCP.
You can click here to see the reference diagram for the demo.
cloudbot-call.yml
file is added to repo as a GH action- GCP creds are added to the
Settings
for the repo. - A webhook is created for calls to the Tekton endpoint when commits are made to the repo.
Let's consider what happens when a code change is committed to a GH repository. First, we will see this from the "GitHub user" perspective
- Make a pull reuqest on the
ps-automation
repo- alter the "top level" Dockerfileso BC will trigger some alerts.
- note the
bot
writing a message to the PR. The bot could be modified to do all sorts of actions. - Observe the Tekton pipeline writing results to the PR as a comment
- We can see the code for the bot in GCP.
- We can view the logs.
- All of this was automated via Terraform but there are many ways.
- Consider the Cloud Code extension for VSCode.
The container is passed to gcr.io for storage by the Kaniko task in Tekton.