Add version and name to the office365 warning list

pull/12/head
Alexandre Dulaunoy 2016-12-06 12:39:45 +01:00
parent 14edcbd433
commit 338241e499
2 changed files with 8 additions and 1 deletions

View File

@ -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"
}

View File

@ -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))