-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild and aecure network in google cloud chelenge.txt
69 lines (22 loc) · 3 KB
/
build and aecure network in google cloud chelenge.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
##############################################################################################################################################################333
Task 1:Check the firewall rules. Remove the overly permissive rules.
gcloud compute firewall-rules delete open-access
##################################################################################################################################################################3
Task 2:Navigate to Compute Engine in the Cloud Console and identify the bastion host. The instance should be stopped. Start the instance.
gcloud compute instances start bastion --zone us-central1-b
#########################################################################################################################################################################################
Task 3:The bastion host is the one machine authorized to receive external SSH traffic. Create a firewall rule that allows SSH (tcp/22) from the IAP service. The firewall rule should be enabled on bastion via a network tag.
gcloud compute firewall-rules create ssh-ingress --allow=tcp:22 --source-ranges 35.235.240.0/20 --target-tags ssh-ingress --network acme-vpc
gcloud compute instances add-tags bastion --tags=ssh-ingress --zone=us-central1-b
##############################################################################################################################################################################################333
Task 4:The juice-shop server serves HTTP traffic. Create a firewall rule that allows traffic on HTTP (tcp/80) to any address. The firewall rule should be enabled on juice-shop via a network tag.
gcloud compute firewall-rules create http-ingress --allow=tcp:80 --source-ranges 0.0.0.0/0 --target-tags http-ingress --network acme-vpc
gcloud compute instances add-tags juice-shop --tags=http-ingress --zone=us-central1-b
#######################################################################################################################################################################################333
Task 5:You need to connect to juice-shop from the bastion using SSH. Create a firewall rule that allows traffic on SSH (tcp/22) from acme-mgmt-subnet network address. The firewall rule should be enabled on juice-shop via a network tag.
gcloud compute firewall-rules create internal-ssh-ingress --allow=tcp:22 --source-ranges 192.168.10.0/24 --target-tags internal-ssh-ingress --network acme-vpc
gcloud compute instances add-tags juice-shop --tags=internal-ssh-ingress --zone=us-central1-b
##################################################################################################################################################################################3333333333
Task 6:In the Compute Engine instances page, click the SSH button for the bastion host. Once connected, SSH to juice-shop.
In the Compute Engine instances page, click the SSH button for the bastion host. Once connected, SSH to juice-shop.
ssh [internal IP address of juice-shop]