rysavy-ondrej / ethanol

An experimental environment for context-based flow artifact analysis.
1 stars 0 forks source link

Simplify the Tag representation in the context model #13

Closed rysavy-ondrej closed 12 months ago

rysavy-ondrej commented 1 year ago

Tag table CREATE TABLE Tags ( ID INT PRIMARY KEY AUTO_INCREMENT, -- Assuming you need an ID field for unique identification TagType VARCHAR(255) NOT NULL, -- Assuming a maximum of 255 characters for type TagKey VARCHAR(255) NOT NULL, -- Assuming a maximum of 255 characters for key TagValue VARCHAR(255) NOT NULL, -- Assuming a single string representation with a max of 255 characters TagDetails JSON -- JSON type for storing structured data specific to the TagType );

ID: This is an auto-incremented integer field that provides a unique identifier for each entry in the table. This wasn't in your original specification, but it's a common practice to have a unique identifier for rows in a table.

TagType: Represents the type of the tag, such as "osbytcpip". The data type is VARCHAR(255), which means it can store any string up to 255 characters in length.

TagKey: This represents the key of the tag. It might be an IP address or flow key or any other string-based identifier. Again, it's a VARCHAR(255) to provide ample space for most use cases.

TagValue: A single string representation of the value related to the tag. This is defined as a VARCHAR(255) to provide a standard length.

TagDetails: This column holds detailed information related to the tag. It's designed to store structured data, hence the JSON data type is used. This allows you to input a JSON formatted string that describes the structure specific to the TagType.

rysavy-ondrej commented 12 months ago

Tags are unified as TagRecord class, with Details property that may contain different tag objects.