Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement - Ipsum #3456

Merged
merged 9 commits into from
Feb 27, 2025
Merged

Conversation

baptiste-fourmont
Copy link
Contributor

@baptiste-fourmont baptiste-fourmont commented Feb 20, 2025

Fix the return value from create_author

  File "/usr/local/lib/python3.12/site-packages/stix2/base.py", line 50, in _check_property
    kwargs[prop_name], has_custom = prop.clean(
                                    ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/stix2/properties.py", line 175, in _default_clean
    raise ValueError("must equal '{}'.".format(self._fixed_value))
ValueError: must equal 'identity'.

Proposed changes

  • dict to stix2.Identity into the return value (create_author)
  • Add self.author inside the bundle
  • add cleanup_inconsistent_bundle
  • Remove deprecated method
  • Resolve pylint issues

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

```bash
  File "/usr/local/lib/python3.12/site-packages/stix2/base.py", line 50, in _check_property
    kwargs[prop_name], has_custom = prop.clean(
                                    ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/stix2/properties.py", line 175, in _default_clean
    raise ValueError("must equal '{}'.".format(self._fixed_value))
ValueError: must equal 'identity'.```

Fix the return value
@romain-filigran romain-filigran added this to the PRs backlog milestone Feb 24, 2025
@romain-filigran romain-filigran added the bug use for describing something not working as expected label Feb 24, 2025
@romain-filigran
Copy link
Member

Hello @baptiste-fourmont . Thanks for your contribution. I think that another problem remains in the connector. In fact, the "author" entity seems to never be added to the final STIX bundle.
https://github.com/OpenCTI-Platform/connectors/blob/master/external-import/ipsum/src/external_import_connector/converter_to_stix.py#L41

This result in multiple "Missing reference error" when processing the STIX bundle at the platform level ("unresolvedIds":["identity--4178f14f-6c2a-52d0-8e67-f111c9ad7560"]})

@baptiste-fourmont baptiste-fourmont changed the title Fix - Identity - Ipsum Improvement - Ipsum Feb 25, 2025
@baptiste-fourmont
Copy link
Contributor Author

baptiste-fourmont commented Feb 25, 2025

Hi, should be fixed now @romain-filigran

According to the template changing to 
```python3
last_run_datetime = datetime.fromtimestamp(
                current_timestamp, tz=timezone.utc
            ).strftime("%Y-%m-%d %H:%M:%S")
```
@romain-filigran
Copy link
Member

@baptiste-fourmont : Thanks a lot for your contribution.

@romain-filigran romain-filigran self-requested a review February 27, 2025 10:49
@romain-filigran romain-filigran merged commit 8c095cf into OpenCTI-Platform:master Feb 27, 2025
4 checks passed
@romain-filigran
Copy link
Member

@baptiste-fourmont: I didn't see it the first time but for your information in this case it's not necessary to pass the “add cleanup_inconsistent_bundle” argument when pushing the STIX bundle.

I'll remove this parameter and make some changes mentioned in this issue to be good : #3514

@SamuelHassine SamuelHassine removed the bug use for describing something not working as expected label Feb 28, 2025
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.

3 participants