Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

[Suggestion] Add module configuration extendability #126

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bekh6ex
Copy link
Contributor

@bekh6ex bekh6ex commented Jul 11, 2019

A possible way to add configuration to individual modules

To try out documentation

./bin/hawkeye modules config files-secrets

strictKeywords: true,
removeAdditional: true,
useDefaults: true
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removeAdditional - remove additional (nondocumented) properties from config object. Might be useful to force module developers documenting all possible config values.
useDefaults - if property is not defined and has default value will modify config object by injecting the property with default value. Just handy.

]
}
]
}
Copy link
Contributor Author

@bekh6ex bekh6ex Jul 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To generate reasonable documentation (help) we can enforce by tests things like:

  • each config should have an example (that is up to date and passes schema test)
  • each property has a title and a type
  • ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we can try to use this definition for cli arguments. Not sure how hard it will be if we want to make it good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... or limit cli arguments to what we have now and allow to pass .hawkeyerc as an argument or even read it from stdIn

@bekh6ex
Copy link
Contributor Author

bekh6ex commented Jul 17, 2019

Currently, when executing ./bin/hawkeye modules config files-secrets I get this output:

[info] Version: v1.6.1
files-secrets module configuration properties:

    files (string[]): List of files containing patterns of suspicious filenames

.hawkeyerc examples:
{
  "moduleConfig": {
    "files-secrets": {
      "files": [
        "path/to/patterns.json"
      ]
    }
  }
}


@bekh6ex bekh6ex changed the title [Proof of concept][DRAFT] Add module configuration extendability [Suggestion] Add module configuration extendability Jul 17, 2019
@bekh6ex
Copy link
Contributor Author

bekh6ex commented Jul 24, 2019

@felixhammerl Any comments on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant