Skip to content

Conversation

@chrisr3d
Copy link
Member

As the validation happens on MISP and the idea was not to duplicate it on PyMISP, we simply added it as a new PyMISP tool to make sure we can validate MISP Events that are dict or MISPEvent and pushed to other tools without going through MISP, such as misp-stix or cti-transmute

- Behaves like the built-in validation with
  `modifyBeforeValidation` and `validate`
- Will include also the tooling to use this
  validation on PyMISP objects or JSON format to
  validate data that is not coming from MISP
…attributes

- Avoiding issues with non str values that don't
  support some str built-in operations
- Avoiding issues with wrong filename|hash value
  format
- Avoiding issues with wrong composite attribute
  value format
…s in events

- Takes dict or MISPEvent as input
- Prepares the attribute values for validation
- Validates the attribute values
- Returns the validated Event with only valid Attributes
- Logs warning messages with the skipped values
@Rafiot
Copy link
Member

Rafiot commented Nov 26, 2025

Looks great, should I merge it?

… validation

- As validation should not be a change per se, we
  do not want the `edited` flag to be set when we
  set the value field in attributes, or the
  `Attribute` field in MISP objects
- This avoids `timestamp` fields to be skipped
  when using `.to_json()`
- As PyMISP already handles properly the different
  possible types of input given to `from_dict`, it
  makes more sense here to test whether the type
  we're expecting is NOT one of the PyMISP classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants