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

Change format for permissions on Windows from string to cJSON #9162

Merged
merged 9 commits into from Jul 9, 2021

Conversation

jotacarma90
Copy link
Member

@jotacarma90 jotacarma90 commented Jun 30, 2021

Related issue
#8585

Description

This PR aims to change the way Windows file permissions will be processed, changing them from string format to a cJSON format.

Logs/Alerts example

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
  • Source installation
  • Review logs syntax and correct language
  • QA templates contemplate the added capabilities
  • Memory tests for Linux
    • Scan-build report
    • Valgrind (memcheck and descriptor leaks check)
  • Memory tests for Windows
    • Scan-build report
    • DrMemory

@jotacarma90 jotacarma90 self-assigned this Jun 30, 2021
@jotacarma90 jotacarma90 linked an issue Jun 30, 2021 that may be closed by this pull request
@jotacarma90 jotacarma90 force-pushed the 8585-win-perm-json branch 2 times, most recently from 4744cc0 to 1e5e17d Compare July 1, 2021 11:38
@jotacarma90 jotacarma90 force-pushed the 8585-win-perm-json branch 3 times, most recently from 612c033 to d103066 Compare July 2, 2021 13:44
@jotacarma90 jotacarma90 changed the base branch from master to 8575-fim-win-perms-improvement July 2, 2021 13:52
jotacarma90 and others added 5 commits July 2, 2021 19:12
Refactors functions related to retrieving permissions in Windows in order to simplify usage and remove duplicated code.
Added some more UTs for changes associated with Windows permissions being in JSON format
@Molter73 Molter73 self-assigned this Jul 7, 2021
@Molter73 Molter73 marked this pull request as ready for review July 7, 2021 14:58
Fix NULL derreferences in decode_ace_json and perm_json_to_old_format.
Fix a memory leak in fim_registry_get_key_data.
Silenced a false positive NULL derreference on lf->fields reported by scan-build.
@Molter73 Molter73 added module/fim File Integrity Monitoring type/enhancement New feature or request platform/windows labels Jul 9, 2021
Added the required code for wazuh_db to properly save a file/registry permissions when it is formatted as JSON.
Added unit tests for the new code.
Copy link
Contributor

@antoniomanuelfr antoniomanuelfr left a comment

Choose a reason for hiding this comment

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

LGTM

@Molter73 Molter73 merged commit f145d2e into 8575-fim-win-perms-improvement Jul 9, 2021
@Molter73 Molter73 deleted the 8585-win-perm-json branch July 9, 2021 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/fim File Integrity Monitoring platform/windows type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor FIM message to hold Windows permissions as JSON
3 participants