Skip to content

Add SQLite parser for iOS Accounts (Accounts3.sqlite) file#4926

Open
studiawan wants to merge 14 commits intolog2timeline:mainfrom
studiawan:main
Open

Add SQLite parser for iOS Accounts (Accounts3.sqlite) file#4926
studiawan wants to merge 14 commits intolog2timeline:mainfrom
studiawan:main

Conversation

@studiawan
Copy link
Copy Markdown
Contributor

@studiawan studiawan commented Nov 26, 2024

One line description of pull request

Add SQLite parser for iOS Accounts (Accounts3.sqlite) file

Description:

I add/edit several files:

  • Add import ios_accounts to plaso/parsers/sqlite_plugins/init.py
  • Add a new parser plugin ios_accounts.py to plaso/parsers/sqlite_plugins/
  • Add Accounts3.db file to plaso/test_data/
  • Add unit test ios_accounts.py to plaso/tests/parsers/sqlite_plugins/
  • Modify ios.yaml to support iOS account parser plugin (plaso/data/formatters/ios.yaml)
  • Modify timeliner.yaml to support iOS account parser plugin (plaso/data/timeliner.yaml)
  • Add sqlite/ios_accounts in enabled_parser_names (tests/cli/pinfo_tool.py)

Related issue (if applicable): fixes #4135

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:

  • Automated checks (GitHub Actions, AppVeyor) pass
  • No new new dependencies are required or l2tdevtools has been updated
  • Reviewer assigned
  • Test data has a Plaso compatible license

@studiawan
Copy link
Copy Markdown
Contributor Author

studiawan commented Nov 27, 2024

Hi @joachimmetz, I am not sure why test_docs / build (3.12, docs) failed. Can you show me where the error is? Other eight tests are successful.
Thanks a lot.

@joachimmetz
Copy link
Copy Markdown
Member

@studiawan I'm a bit preoccupied at the moment will try to take a look as soon as time permits

self.username = None
self.identifier = None
self.owning_bundle_id = None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style guide nit: have 2 empty lines

"""Retrieves a date and time value from the row.

Args:
query_hash (int): hash of the query, that uniquely
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style guide nit: have 2 indentation spaces

"""iOS accounts event data.

Attributes:
date (dfdatetime.DateTimeValues): date and time the account
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency across the codebase changing this to creation_time

account_type (str): account type.
username (str): user name.
identifier (str): identifier.
owning_bundle_id (str): owning bundle identifier of the app
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style guide nit: id => identifier

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2025

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.10%. Comparing base (11259d3) to head (fc51758).
⚠️ Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
plaso/parsers/sqlite_plugins/ios_accounts.py 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4926      +/-   ##
==========================================
+ Coverage   85.09%   85.10%   +0.01%     
==========================================
  Files         432      433       +1     
  Lines       38792    38827      +35     
==========================================
+ Hits        33009    33043      +34     
- Misses       5783     5784       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joachimmetz
Copy link
Copy Markdown
Member

@studiawan what is the origin of the test data file?

@joachimmetz joachimmetz added the pending reporter input Issue is pending input from the reporter label Mar 2, 2025

Attributes:
account_type (str): account type.
creation_time (dfdatetime.DateTimeValues): date and time the account
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style guide nit: use 2 space indentation.


REQUIRED_STRUCTURE = {
'ZACCOUNT': frozenset([
'ZACCOUNTTYPE', 'ZDATE', 'ZUSERNAME', 'ZIDENTIFIER',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint nit: remove trailing whitespace

@studiawan
Copy link
Copy Markdown
Contributor Author

studiawan commented Sep 21, 2025

@studiawan what is the origin of the test data file?

I am sorry for the late reply, the data is from Digital Corpora https://digitalcorpora.s3.amazonaws.com/s3_browser.html#corpora/mobile/android_13/ios_15_3_1/

So, is the plugin good to be merged?

@joachimmetz
Copy link
Copy Markdown
Member

I am sorry for the late reply, the data is from Digital Corpora

Will need to check the license is compatible

@studiawan
Copy link
Copy Markdown
Contributor Author

For the license, there are no restrictions on the use of this data, source: https://registry.opendata.aws/digitalcorpora/
All of the disk images, memory dumps, and network packet captures available on Digital Corpora are freely available, source: https://digitalcorpora.org/

@joachimmetz
Copy link
Copy Markdown
Member

That is the crux, need to figure out what "no restrictions" mean in the context of FOSS. Also see https://opensource.org/blog/public-domain-is-not-open-source

@joachimmetz joachimmetz removed the pending reporter input Issue is pending input from the reporter label Sep 23, 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.

Add SQLite parser plugin for iOS Accounts

2 participants