0
0
GCPcloud~10 mins

Firewall rule components (target, source, protocol) in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the source IP range for the firewall rule.

GCP
firewall_rule = {
  'name': 'allow-ssh',
  'sourceRanges': ['[1]'],
  'allowed': [{'IPProtocol': 'tcp', 'ports': ['22']}]
}
Drag options to blanks, or click blank then click option'
A10.0.0.256
B192.168.1.1
C255.255.255.0
D0.0.0.0/0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a single IP without CIDR mask
Using invalid IP addresses
2fill in blank
medium

Complete the code to specify the target tags for the firewall rule.

GCP
firewall_rule = {
  'name': 'allow-http',
  'targetTags': ['[1]'],
  'allowed': [{'IPProtocol': 'tcp', 'ports': ['80']}]
}
Drag options to blanks, or click blank then click option'
Adatabase
Binternal-only
Cweb-server
Dssh-access
Attempts:
3 left
💡 Hint
Common Mistakes
Using tags unrelated to the service
Leaving targetTags empty
3fill in blank
hard

Fix the error in the protocol specification of the firewall rule.

GCP
firewall_rule = {
  'name': 'allow-icmp',
  'allowed': [{'IPProtocol': '[1]'}]
}
Drag options to blanks, or click blank then click option'
Aicmp
Budp
Ctcp
Dhttp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'http' as protocol
Using uppercase protocol names
4fill in blank
hard

Fill both blanks to define a firewall rule allowing TCP traffic from a specific source range to target instances.

GCP
firewall_rule = {
  'name': 'allow-custom',
  'sourceRanges': ['[1]'],
  'targetTags': ['[2]'],
  'allowed': [{'IPProtocol': 'tcp', 'ports': ['8080']}]
}
Drag options to blanks, or click blank then click option'
A10.1.0.0/16
Bssh-server
C0.0.0.0/0
Dweb-server
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid IP ranges
Using unrelated target tags
5fill in blank
hard

Fill all three blanks to create a firewall rule allowing UDP traffic on port 53 from any source to DNS servers.

GCP
firewall_rule = {
  'name': 'allow-dns',
  'sourceRanges': ['[1]'],
  'targetTags': ['[2]'],
  'allowed': [{'IPProtocol': '[3]', 'ports': ['53']}]
}
Drag options to blanks, or click blank then click option'
A0.0.0.0/0
Bdns-server
Cudp
Dtcp
Attempts:
3 left
💡 Hint
Common Mistakes
Using TCP instead of UDP
Restricting source IPs incorrectly