Browse Source

++scan stuff

__letsencrypt_cert-fix-hooks
Nico Schottelius 2 years ago
parent
commit
bc2948a8a5
  1. 15
      cdist/scan/scan.py
  2. 10
      docs/dev/logs/2020-10-29.org

15
cdist/scan/scan.py vendored

@ -56,6 +56,8 @@ from scapy.all import *
# Datetime overwrites scapy.all.datetime - needs to be imported AFTER
import datetime
import cdist.config
log = logging.getLogger("scan")
class Trigger(object):
@ -120,6 +122,19 @@ class Scanner(object):
with open(fname, "w") as fd:
fd.write(f"{now}\n")
def config(self):
"""
Configure a host
- Assume we are only called if necessary
- However we need to ensure to not run in parallel
- Maybe keep dict storing per host processes
- Save the result
- Save the output -> probably aligned to config mode
"""
def start(self):
self.process = Process(target=self.scan)
self.process.start()

10
docs/dev/logs/2020-10-29.org

@ -54,4 +54,12 @@ VERBOSE: scan: Host fe80::f29f:c2ff:fe7c:275e is alive
VERBOSE: scan: Host fe80::ba69:f4ff:fec5:8db7 is alive
VERBOSE: scan: Host fe80::42b0:34ff:fe6f:f863 is alive
VERBOSE: scan: Host fe80::21b:fcff:feee:f4bc is alive
...
** Better usage -> saving the env
sudo -E cdist scan -b -I wlan0 -vv
** TODO Implement actual configuration step
- Also serves as a nice PoC
- Might need to escape literal IPv6 addresses for scp
** TODO Define how to map link local address to something useful
- via reverse DNS?
- via link local in manifest?
** TODO define ignorehosts?

Loading…
Cancel
Save