This example creates an environment to demonstrate how to execute an assessment with Stratozone.
Resources created:
- app-server-001 (Windows)
- db-server-001 (Linux)
- stratozone-collector (Windows)
- Create or select an existing project
- Open Cloud Shell and clone this repo into the Cloud Shell VM
git clone https://github.com/sylvioneto/terraform_gcp.git
- Ensure the var is set, otherwise set it with
gcloud config set project
command
echo $GOOGLE_CLOUD_PROJECT
- Create a bucket to store your project's Terraform state
gsutil mb gs://$GOOGLE_CLOUD_PROJECT-tf-state
- Enable necessary APIs
gcloud services enable cloudbuild.googleapis.com compute.googleapis.com
- Execute Terraform using Cloud Build.
gcloud builds submit . --config cloudbuild.yaml
Uncomment the tf destroy
step in the cloudbuild.yaml file, and trigger the deployment again.
Create a user/pass common for Linux and Windows machines. Stratozone will use this credential to access the other machines.
E.g stratozone/Welcome@2021
Create the user, then change the password.
$ gcloud compute reset-windows-password app-server-001 --user stratozone --zone southamerica-east1-a
$ gcloud compute reset-windows-password stratozone-collector --user stratozone --zone southamerica-east1-a
Connect to the machine using the gcloud compute ssh
command or the console, then create the user
$ sudo adduser stratozone
Connect to the stratozone-collector vm, install and activate the Strato Probe. Once it's done, you can monitor the collected metrics in the Stratozone Portal.
Linux Target - No authentication methods (server sent: publickey) when trying to access Linux machines.
There are 2 options for this case.
- use a key file instead of user/passo
- Edit the /etc/ssh/sshd_config, change
PasswordAuthentication
toyes
, and restart the servicesudo service ssh restart
.
The Windows firewall in the target machine might be blocking Stratozone collector to reach the target. Turn off the firewall or whitelist the Stratozone collector.
It might happen when machines are not in the same domain, or the stratozone user is local. Add a .\
before the user to indicate is a local login.