'Check if HTTPS responses have the Strict-Transport-Security header set.
:param request: The HTTP request object.
:param response: The HTTP response object
:return: None, all results are saved in the kb.'

def grep(self, request, response):

    if (self._reports > MAX_REPORTS):
        return
    if (request.get_url().get_protocol() != 'https'):
        return
    (sts_header_value, _) = response.get_headers().iget(STS_HEADER, None)
    if (sts_header_value is not None):
        return
    self._reports += 1
    desc = 'The    web    server    uses    HTTPS    but    does    not    set    the        Strict-Transport-Security    header.'
    i = Info('Missing    Strict    Transport    Security    header', desc, response.id, self.get_name())
    i.set_url(response.get_url())
    i[STSInfoSet.ITAG] = response.get_url().get_domain()
    self.kb_append_uniq_group(self, 'strict_transport_security', i, group_klass=STSInfoSet)
