Add version and name to the office365 warning list
parent
14edcbd433
commit
338241e499
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"name": "List of known Office 365 URLs and IP address ranges",
|
||||
"description": "Office 365 URLs and IP address ranges",
|
||||
"list": [
|
||||
"2a01:111:f406:8800::/64",
|
||||
|
@ -1334,5 +1335,6 @@
|
|||
"216.32.180.0/23",
|
||||
"2a01:111:f400:7c00::/54",
|
||||
"2a01:111:f403::/48"
|
||||
]
|
||||
],
|
||||
"version": "20161206"
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import requests
|
||||
import xml.etree.ElementTree as ET
|
||||
import json
|
||||
import datetime
|
||||
|
||||
url = 'https://support.content.office.net/en-us/static/O365IPAddresses.xml'
|
||||
r = requests.get(url)
|
||||
|
@ -13,7 +14,11 @@ for address in office365.iter('address'):
|
|||
l.append(address.text.replace('*', ''))
|
||||
|
||||
warninglist = {}
|
||||
warninglist['name'] = 'List of known Office 365 URLs and IP address ranges'
|
||||
d = datetime.datetime.now()
|
||||
warninglist['version'] = "{0}{1:02d}{2:02d}".format(d.year, d.month, d.day)
|
||||
warninglist['description'] = 'Office 365 URLs and IP address ranges'
|
||||
warninglist['list'] = l
|
||||
|
||||
|
||||
print (json.dumps(warninglist))
|
||||
|
|
Loading…
Reference in New Issue