14 lines
577 B
Python
14 lines
577 B
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""Read-only firewall, mirror and protected-path inspection. No credential dump."""
|
||
|
|
import json
|
||
|
|
from pathlib import Path
|
||
|
|
import sys
|
||
|
|
sys.path[:0]=[str(Path(__file__).resolve().parents[1]/'controller'),'/opt/leaf-controller/controller']
|
||
|
|
from leaf_controller.ops import configured_client, redact
|
||
|
|
|
||
|
|
def main():
|
||
|
|
_,c=configured_client()
|
||
|
|
for path in (['firewall'],['interfaces'],['protocols','ospf'],['protocols','static']):
|
||
|
|
print(json.dumps({'path':path,'data':redact(c.retrieve('showConfig',path).get('data'))}))
|
||
|
|
if __name__=='__main__':main()
|