Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5366 +/- ##
==========================================
+ Coverage 85.59% 85.61% +0.01%
==========================================
Files 458 458
Lines 41747 41747
==========================================
+ Hits 35735 35743 +8
+ Misses 6012 6004 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 20, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One line description of pull request
Added a test to check the timeliner attribute mappings and fixed the mappings that do not match event data attributes
Description:
plaso/data/timeliner.yamldefines, per data type, which event data attributes the timeliner turns into events. These attribute names are written a second time in the YAML file, and nothing checks that they still match the event data classes.When they do not match, the error is silent: the timeliner reads the attribute with
getattr(event_data, name, None), so a missing attribute is handled like an empty one, without a warning. Withplace_holder_event, the event data still ends up in the timeline, but with a "Not a time" placeholder event instead of its date and time. Parser tests do not catch this either, since they check event data values and do not run the timeliner.Test
The new
tests/data/timeliner.pyfollows the existingtests/data/presets.py. It readstimeliner.yamlwithYAMLTimelinerConfigurationFileand checks, for every definition, that:Some details:
DATA_TYPEare considered, to exclude event data classes defined by tests and base classes that inherit the data type of their parent;GetAttributeNames()of a new instance. The timeliner processes event data that was read back from storage, which only contains instance attributes, so a mapped attribute that is only set dynamically by a parser is reported as well;utils/export_event_data.py. A TODO marks this exception to be removed once all event data can be instantiated without arguments, which is the case with Changed Windows distributed link tracking event data to be constructed without arguments #5016 #5364.Before the fixes, the test reports:
Fixes
android:sqlite:app_launch: mappedlaunch_time, while the plugin setsstart_time. Changed the mapping tostart_time.ios:health:workouts: mappeddate_time, while the plugin setsstart_timeandend_time. Changed the mapping tostart_timeand addedend_time("Workout End Time"), like the other iOS Health data types that have both, such asios:health:steps. Note that this adds events for the end of workouts.I checked the effect with the timeliner on the test databases:
android:sqlite:app_launchios:health:workoutsmacos:user:entry: removed thelast_written_timemapping.MacOSUserEventDataonly defineslast_login_attempt_time,last_login_timeandlast_password_set_time, and the plugin never setlast_written_time. The mapping was added with the entry in #4397 and appears to be copied fromwindows:registry:sam_users, which has the same 4 mappings, wherelast_written_timeis the last written time of the Registry key.windows:srum:application_usageandwindows:srum:network_usage: removed thelast_connected_timemapping. OnlySRUMNetworkConnectivityUsageEventDatadefines this attribute. Note that_ParseGUIDTablealso setslast_connected_timedynamically on any SRUM event data whose table has aConnectStartTimecolumn, but in the test database only the network connectivity table has this column:ConnectStartTime{DD6636C4-8929-4683-974E-22C046A43763}windows:srum:network_connectivity{973F5D5C-1D90-4944-BE8E-24B94231A174}windows:srum:network_usage{D10CA2FE-6FCF-4F6D-848E-B2E99266FA89}windows:srum:application_usageSo these mappings do not produce events with known data. If you know of SRUM databases where these tables have a
ConnectStartTimecolumn, I will restore them. RestrictingConnectStartTimeto the network connectivity table, together withconnected_timethat is set dynamically but neither initialized nor documented, could be handled in a separate SRUM pull request.The 3 removals do not change the output.
Not covered by this test
The test checks the mappings against the event data, not the other way around. It does not detect:
timeliner.yaml;timeliner.yaml, which is supposed to be checked byutils/check_unused_timeliner_entries.sh. Currently onlysyslog:commenthas no entry;ios:health:all_watch_sleep,ios:health:headphone_audio_levelsandios:health:heart_rate,end_timeis described as "Start Time".Related issue (if applicable): #5016
Notes:
All contributions to Plaso undergo code review.
This makes sure that the code has appropriate test coverage and conforms to the
Plaso style guide.
One of the maintainers will examine your code, and may request changes. Check off the items below in
order, and then a maintainer will review your code.
Checklist: