Complete the code to identify what a security group controls in cloud networking.
A security group primarily controls [1] to and from cloud resources.
Security groups act like virtual firewalls that control network traffic to and from cloud resources.
Complete the code to specify the type of rules security groups use.
Security groups use [1] rules to allow or deny traffic based on IP addresses and ports.
Security groups use stateful rules, meaning they remember allowed connections and automatically allow return traffic.
Fix the error in the statement about security group rules.
Security groups [1] deny rules; they only allow traffic explicitly.Security groups do not have deny rules; they only allow traffic that matches their rules. All other traffic is implicitly denied.
Fill both blanks to complete the dictionary comprehension that creates a security group rule set allowing only HTTP and HTTPS traffic.
rules = {port: 'allow' for port in [1] if port [2] [80, 443]}The comprehension iterates over ports including 80 and 443, and allows only those ports by checking if the port is in the list [80, 443].
Fill all three blanks to create a dictionary comprehension that maps protocol names to their default ports only if the port number is greater than 20.
protocol_ports = [1]: [2] for [3], [2] in [('http', 80), ('ftp', 21), ('ssh', 22)] if [2] > 20
The comprehension unpacks each tuple into proto (protocol name) and port, mapping proto to port only if port > 20.