See More

#!/usr/bin/python3 # Version 1.1 import subprocess import sys import datetime import os from include import check1,check2,check3,check4,check5,check6,check7,check8,subscription from html.parser import HTMLParser ################ CSV EXPORT HELPERS ################### # Use HTML Parser class MLStripper(HTMLParser): def __init__(self): self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): return ''.join(self.fed) # Strip HTML tags def strip_tags(html): s = MLStripper() s.feed(html) return s.get_data() # Process a CSV Column: strip HTML tags, wrap with double-quotes, replace double-quotes with single-quotes, replace line breaks with newline def c(text): #return '"'+ str(text).strip().replace("
", "\n").replace("","'").replace("","'").replace('"',"'") + '",' return '"'+ str(text).strip().replace("
", "\n").replace('"',"'") + '",' # Process a CSV Row: Add Subscription name column, add newline subname="" def r(text): return '"' + subname + '",' + text + "\n" ################ HTML HEADER ################### def generate_report(subid,name,cloudname): global subname subname=name html_start = """

Azure CIS Benchmark

Azure CIS Benchmark for """+name+"""

""" html_end = """ """ start_list="
  • \n" end_list="
  • \n" ################ HTML 1.x ############## content1 = """

    CIS Azure 1.x