How to use the qualysapi.settings function in qualysapi

To help you get started, we’ve selected a few qualysapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HASecuritySolutions / VulnWhisperer / deps / qualysapi / qualysapi / config.py View on Github external
if not self._cfgparse.has_option('qualys', 'max_retries'):
            self.max_retries = qcs.defaults['max_retries']
        else:
            self.max_retries = self._cfgparse.get('qualys', 'max_retries')
            try:
                self.max_retries = int(self.max_retries)
            except Exception:
                logger.error('Value max_retries must be an integer.')
                print('Value max_retries must be an integer.')
                exit(1)
            self._cfgparse.set('qualys', 'max_retries', str(self.max_retries))
        self.max_retries = int(self.max_retries)

        #Get template ID... user will need to set this to pull back CSV reports
        if not self._cfgparse.has_option('qualys', 'template_id'):
            self.report_template_id = qcs.defaults['template_id']
        else:
            self.report_template_id = self._cfgparse.get('qualys', 'template_id')
            try:
                self.report_template_id = int(self.report_template_id)
            except Exception:
                logger.error('Report Template ID Must be set and be an integer')
                print('Value template ID must be an integer.')
                exit(1)
            self._cfgparse.set('qualys', 'template_id', str(self.report_template_id))
        self.report_template_id = int(self.report_template_id)

        # Proxy support
        proxy_config = proxy_url = proxy_protocol = proxy_port = proxy_username = proxy_password = None
        # User requires proxy?
        if self._cfgparse.has_option('proxy', 'proxy_url'):
            proxy_url = self._cfgparse.get('proxy', 'proxy_url')