A repo for the management and storage of ManySecured D3 claims.
To view the D3 types within this repo, please check out the D3DB website.
Overview:
Device types are the core description of an instance of a given device. The type assertion encapsulates the device's details and refers (by GUID reference) to the behaviours, vulnerabilities, and firmware associated with that device. Type assertions operate an inheritance model, where a type assertion can inherit the properties from parent types and then overload/add properties unique to that device type instance.
Device behaviour claims detail the activity the device should and should not exhibit on the network. A behaviour claim is a collection of multiple network activity rules which define the network activity parameters the device should comply with. Behaviour rules are one of two types, expected and malicious. Expected rules detail the activity that a device is expected to conform to under normal operation. Malicious rules define network activity the device should categorically not exhibit (these can usually be inherited from the master behaviour definition for a pre-defined list of known malicious activity).
On a ManySecured enabled router, the router can use the behaviour claim to check the connected device behaves according to its type and identify unexpected behaviour (behaviour that does not match any expected rule) and suspicious behaviour (behaviour that matches a malicious behaviour rule).
Behaviour claims comprise a set of rules and can also elect to inherit the rules from other behaviours into a more comprehensive set of rules, e.g. The behaviour claim for a 3-in-one printer might inherit the behaviour claims of a printer, scanner, and copier.
Firmware assertions are used to describe the firmware versions a device can have, provide links to the spec, and be used to match against known vulnerabilities for that firmware.
Vulnerability assertions allow claims to be made about the vulnerabilities associated with the device. Vulnerability claims are generally auto-populated from the NIST and CVE vulnerability databases but can also be manually added.
For contributing changes to code, please see CONTRIBUTING.md.
manufacturers folder
folder, create/find the folder for the device manufacturer within the alphabetised folder structure. If you organise your files into sub-directories (e.g. by product line or year) they will be searched recursively automatically at compile time.fileName.<d3-type>.d3.yaml
fileName
is the name of the company/organisation/manufacturer associated with the device<d3-type>
is one of the valid D3 types
./examples
folder.cd d3-scripts/ && poetry install
to install the packagespoetry run d3build
to run the D3 compiler against the repo locally. Any issues will manifest as errors.poetry run d3export
to run the exporter locally. This generates CSVs in the same schema as the SQL tables used by ManySecured devices./manufacturers
: Store for YAML D3 claims./manufacturers/D3_CORE
: contains useful common claim definitions./manufacturers_json
: (Auto generated on local compile) Store for the compiled D3 claims, each claim will have all it's inheritance references resolved. The compiled claims are in the JSON format../D3DB
: (Auto generated) Location of the exported D3 claim schemas (all branches) and CSV tables (on the csv
branch)./examples
: example claim and behaviour definitions./d3-scripts
: Folder containing the scripts for compiling the D3 YAML claims./d3-scripts/src/d3_scripts/schemas/
: Folder containing the JSON schemas used in the compilation process should you want topip install d3-cli
This installs the d3-cli tool from the https://github.com/TechWorksHub/d3-cli repository.
d3-cli --mode lint ./manufacturers
to run the D3 linter against the claim files in the manufacturers folder. Any issues will manifest as errors.d3-cli --mode build ./manufacturers
to run the D3 compiler against the repo locally. Any issues will manifest as errors.d3-cli --mode export ./manufacturers
to run the exporter locally. This generates CSVs in the same schema as the SQL tables used by ManySecured devicesd3-cli --mode lint <comma separated directories>
: Checks YAML files conform to the standardd3-cli --mode build <comma separated directories>
: Runs the D3 claim compilerd3-cli --mode export <comma separated directories>
: Convert claims to CSV format for the ManySecured router databased3-cli --uuid
, d3-cli --guid
: Helpers to generate a UUID/GUID to add to your claim definition
uuidgen
on Linux, or https://www.uuidgenerator.net/ onlineThe steps below detail the steps in the compilation process to help you debug the compilation should you encounter an error.
./manufacturers/**/*.*
*.d3.yaml
)*.{behaviour,firmware,inheritence,type,vuln}.d3.yaml
)