From b37ebf0fee540fec313fd0307e2483fcd070e381 Mon Sep 17 00:00:00 2001 From: oriagmon Date: Wed, 17 Oct 2018 10:44:34 +0300 Subject: [PATCH] Removed note & added parentheses to a return statement condition --- src/README.md | 2 -- src/modules/hunting/secrets.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/README.md b/src/README.md index 868eb65..e18c2fe 100644 --- a/src/README.md +++ b/src/README.md @@ -72,8 +72,6 @@ _The file's (module's) content is imported automatically"_ The second step is to determine what events your Hunter will subscribe to, and from where you can get them. `Convention:` Events should be declared in their corresponding module. for example, a KubeDashboardEvent event is declared in the dashboard discovery module. -`Note:` An hunter located under the `disovery` folder should not import any modules located under the `hunting` folder -in order to prevent circular dependency bugs Following the above example, let's figure out the imports: ```python diff --git a/src/modules/hunting/secrets.py b/src/modules/hunting/secrets.py index 9667a32..18f0587 100644 --- a/src/modules/hunting/secrets.py +++ b/src/modules/hunting/secrets.py @@ -33,7 +33,7 @@ class AccessSecrets(Hunter): logging.debug('Passive Hunter is attempting to access pod\'s secrets directory') # get all files and subdirectories files: self.secrets_evidence = [val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk('/var/run/secrets/')] for val in sublist] - return True if len(self.secrets_evidence) > 0 else False + return True if (len(self.secrets_evidence) > 0) else False def execute(self): if self.get_services():