Initial Oracle security mirror
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
def validate(root):
|
||||
root=Path(root)
|
||||
catalog=json.loads((root/'state/catalog.json').read_text())
|
||||
assert catalog['advisory_count'] >= 25, 'Incomplete discovery'
|
||||
assert len(catalog['advisories'])==catalog['advisory_count']
|
||||
for item in catalog['advisories']:
|
||||
name=item['url'].split('/')[-1]
|
||||
p=root/'data/advisories'/str(item['year'])/name
|
||||
raw=p.read_bytes().lower()
|
||||
assert b'<html' in raw or b'<!doctype html' in raw, str(p)
|
||||
for p in (root/'data/csaf').rglob('*.json') if (root/'data/csaf').exists() else []:
|
||||
doc=json.loads(p.read_bytes())
|
||||
assert isinstance(doc,dict),str(p)
|
||||
print(f"Validated {catalog['advisory_count']} Oracle advisories")
|
||||
|
||||
if __name__=='__main__':
|
||||
try: validate(sys.argv[1] if len(sys.argv)>1 else '.')
|
||||
except Exception as exc: print(f'INVALID: {exc}',file=sys.stderr); sys.exit(1)
|
||||
Reference in New Issue
Block a user