def attack_surface_coloring(graph, attack_surface):
    """This function takes as input a system topology
       (including the parts that are in its attack surface)
       and its corresponding attack surface
       and produces a color map for the nodes
       based on if they are in the attack surface
       or not.
    """
    color = []

    # takes a two-dimensional list
    # and produces a one-dimensional list
    # so we can check if each node is
    # in the attack surface
    flatten = lambda l: [item for sublist in l for item in sublist]
    flat_attack_surface = flatten(attack_surface)

    for node in graph:
        if node in flat_attack_surface:
            color.append('red')
        else:
            color.append('grey')
    return color