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

Show trust discrepancies by default #763

Open
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

egbicker
Copy link
Contributor

@egbicker egbicker commented Feb 7, 2023

Show trust discrepancies by default in the STDB or a message if store is empty

Closes #520

@jw3
Copy link
Member

jw3 commented Feb 14, 2023

@egbicker bunch of conflicts after merging #750

@egbicker
Copy link
Contributor Author

@jw3 Is there a way to request only untrusted files from the backend?

@jw3
Copy link
Member

jw3 commented Feb 21, 2023

Is there a way to request only untrusted files from the backend?

There is not, right now. Is filtering the system trust slow, or do you have some other use case?

@egbicker
Copy link
Contributor Author

I'm having issues filtering the system trust in the GUI layer while getting a performance increase. It looks like I'm going to have to chop up the system.get("system_trust") object before trying to load anything or else we still go through every entry.

@dorschs57
Copy link
Collaborator

I'm having issues filtering the system trust in the GUI layer while getting a performance increase. It looks like I'm going to have to chop up the system.get("system_trust") object before trying to load anything or else we still go through every entry.

Did you try doing some filtering before a trust entry is put on the queue in the process_trust method in TrustFileList. That's running on a separate thread so the performance hit from the UI standpoint shouldn't be too bad.

@egbicker
Copy link
Contributor Author

Thanks @dorschs57 I was working in the wrong spot. That does go quicker, now just have to adjust the loading logic to recognize the different number of items

@egbicker egbicker linked an issue Feb 23, 2023 that may be closed by this pull request
@jw3
Copy link
Member

jw3 commented Mar 2, 2023

@egbicker This does not seem to be functioning for me, can you take a look and confirm it is still gtg

@egbicker
Copy link
Contributor Author

egbicker commented Mar 2, 2023

@jw3 What isn't working for you? It seems to be working on my end

@egbicker
Copy link
Contributor Author

egbicker commented Mar 2, 2023

image

@egbicker egbicker requested a review from dorschs57 April 6, 2023 20:06
@jw3
Copy link
Member

jw3 commented Apr 18, 2023

@egbicker resolve the conflicts here when you have time and I'll review this again.

@egbicker
Copy link
Contributor Author

@jw3 Merges are done, tests worked locally. Looks like something happened to the Ubuntu 20.04 repo between when you commented and now.

@jw3 jw3 marked this pull request as ready for review April 20, 2023 17:42
Copy link
Collaborator

@dorschs57 dorschs57 left a comment

Choose a reason for hiding this comment

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

This still doesn't seem to be working for me. On my rhel8 system, the system trust shows progress to about 15% then jumps right to done with about 14k untrusted files showing. The Toggle button never becomes active in the toolbar either. Is there something else I'm missing?

"toggle": [
UIAction(
name="Toggle",
tooltip="Toggle Displaying Trusted Entries",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs added to the strings.py file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

After your last commit this string still needs moved to the strings.py file.

@egbicker
Copy link
Contributor Author

@dorschs57 I don't know why the toggle button isn't working, I'm seeing it respond as expected on FC34 and FC38. I did just toss up a fix for the loading jumping from low % to done.

@dorschs57
Copy link
Collaborator

dorschs57 commented May 5, 2023

@dorschs57 I don't know why the toggle button isn't working, I'm seeing it respond as expected on FC34 and FC38. I did just toss up a fix for the loading jumping from low % to done.

Your update made it a little better for me. However it still only gets to about 50% and then jumps to completed for me.

I'm still seeing the issue too where the Toggle Display Trust Entries button does not enable after loading. This only happens when I first start start up the application. Here's my steps:

  1. Update my config file at ~/.config/fapolicy-analyzer/config.toml to include
    [ui]
    initial_view = 'trust'
  2. Start application
  3. Toggle the System Trust Database tab
  4. Wait for system trust to load complete
  5. Observe the toggle button is disabled

If I then navigate to another view like Rules and back to the Trust view the button will enable properly after loading is complete.

@jw3
Copy link
Member

jw3 commented May 5, 2023

Ill give this a run next week and see what I see.

@dorschs57
Copy link
Collaborator

Still seeing some issues here:

  1. percentage still jumps from 55% to done when the trusted files being filtered out.
  2. toggling to show all files works, but then the button is disable and I can't toggle back to just the untrusted files.
  3. when I navigate to a different page my view becomes split with the trust view still showing on the top have and the page I navigated to showing in the bottom half.
    image

@egbicker
Copy link
Contributor Author

Something about adding Events to database_admin_pagebroke the dispose condition os I fixed that but I'm no longer seeing either of your first 2 issues on fc34 or 38

@jw3
Copy link
Member

jw3 commented Jun 15, 2023

Toggle button state looks good.

Don't see the multi-view issue.

I do see the trust jump.

Peek 2023-06-15 00-27

That seems like a symptom of not reducing the total number of entries that need added to the view.

@jw3 jw3 modified the milestones: v1.1, v1.2 Jun 24, 2023
@egbicker
Copy link
Contributor Author

Screencast.from.2023-06-26.16-14-38.webm

@jw3 Here's what my fc38 rpm loading looks like on a VM with ~8gb of RAM. I wonder if the skip you're seeing is the thread that's doing the file loading going faster than the thread responsible for redrawing the UI? Lines 229-232 in trust_file_list are removing the trusted files not displayed from the total used in calculating the percentage.

Does the loading of the full trust file database have a skip in the middle as well?

@@ -200,7 +225,11 @@ def process_trust(trust, event):
for data in trust:
if event.is_set():
return
self.__queue.put(self._row_data(data))

if self.show_trusted or not data.status.lower() == "t":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where the trusted files get skipped from being displayed and the total gets decremented

@jw3 jw3 removed this from the v1.2 milestone Sep 18, 2023
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.

By default only show System Trust discrepancies
3 participants