File: nodekeystest.py

package info (click to toggle)
zeekctl 2.2.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,544 kB
  • sloc: python: 5,639; sh: 1,374; makefile: 71; awk: 24
file content (24 lines) | stat: -rw-r--r-- 602 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Zeekctl test plugin that defines custom node keys.

import ZeekControl.plugin

class NodeKeysTest(ZeekControl.plugin.Plugin):
    def __init__(self):
        super(NodeKeysTest, self).__init__(apiversion=1)

    def name(self):
        return "nodekeystest"

    def pluginVersion(self):
        return 1

    def init(self):
        with open("keys.out", "w") as f:
            for n in self.nodes():
                f.write("key1: %s\n" % n.nodekeystest_key1)
                f.write("key2: %s\n" % n.nodekeystest_key2)

        return True

    def nodeKeys(self):
        return ["key1", "key2"]