'Ensure that Cheetah code is not importing Python modules
that may allow for advanced priveledges by ensuring we whitelist
the imports that we allow'

def check_for_invalid_imports(self, data):

    lines = data.split('\n')
    for line in lines:
        if (line.find('#import') != (-1)):
            rest = line.replace('#import', '').replace('    ', '').strip()
            if (self.settings and (rest not in self.settings.cheetah_import_whitelist)):
                raise CX(('potentially    insecure    import    in    template:    %s' % rest))
