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

[v2] Blank names for containers in filters in report form #1438

Closed
2 of 6 tasks
jatin-baweja opened this issue Aug 4, 2023 · 10 comments
Closed
2 of 6 tasks

[v2] Blank names for containers in filters in report form #1438

jatin-baweja opened this issue Aug 4, 2023 · 10 comments
Assignees
Labels
bug Something isn't working needs-triage Indicates that issue is not yet triaged and assigned

Comments

@jatin-baweja
Copy link
Contributor

Describe the bug
Container names are blank in filters dropdown on report form.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Integrations'
  2. Click on 'Create New Report'
  3. Select 'Vulnerability' as 'Resource' and 'Container' as 'Node Type'
  4. Check the 'Container' select box under 'Advanced Filter'

Expected behavior
It should not list checkboxes with blank names.

Screenshots
blank_container_filter_checkboxes

Components/Services affected

  • UI/Frontend
  • API/Backend
  • Agent
  • Deployment/YAMLs
  • CI/CD Integration
  • Other (specify)

Additional context
Add any other context about the problem here.

@jatin-baweja jatin-baweja added bug Something isn't working needs-triage Indicates that issue is not yet triaged and assigned labels Aug 4, 2023
@ramanan-ravi
Copy link
Collaborator

This is most probably a backend issue @jatin-baweja. Can you confirm?

@manV
Copy link
Member

manV commented Aug 4, 2023

@jatin-baweja can you outline which filter to use if I need to search container except deleted?

@jatin-baweja
Copy link
Contributor Author

This is most probably a backend issue @jatin-baweja. Can you confirm?

@ramanan-ravi Multiple places where we may require stopped containers in the search. Since at this specific place we do not require so, we can use a filter

@jatin-baweja can you outline which filter to use if I need to search container except deleted?

@manV NotContains filter:

"not_contains_filter": {
  "filter_in": {
    "docker_container_state": [
      "deleted"
    ]
  }
}

@manV
Copy link
Member

manV commented Aug 17, 2023

Let's say we run a scan on a container, and then the container get deleted/stopped. but we still want to download report. in this case above filter will filter out deleted container and I will not be able to download report for it.

My question is, shall we allow download report for deleted containers?

Why we empty the name if container is stopped?

@jatin-baweja @ramanan-ravi

@manV
Copy link
Member

manV commented Aug 17, 2023

We already have active flag in container search results, how is that different from stopped status?

@jatin-baweja
Copy link
Contributor Author

jatin-baweja commented Aug 17, 2023

Let's say we run a scan on a container, and then the container get deleted/stopped. but we still want to download report. in this case above filter will filter out deleted container and I will not be able to download report for it.

My question is, shall we allow download report for deleted containers?

Why we empty the name if container is stopped?

For such cases, the container has been removed from the host. There is a possibility that a new container can be spawned with the same name, but with no similar property(not even the same image). I don't think we can merge the new and old containers with the same name. One thing I can think of is using the digest as the name for deleted containers. But we wouldn't want to show such containers on the UI, as the number of deleted containers might increase over time and make it difficult for the user to select running containers with all the digests from deleted containers mixed with names of running containers. We can have a checkbox as an option to list deleted containers(for users who would want to have deleted containers in the list) and based on that, we can make the call to the containers API with or without the filter. Default for the checkbox would be to not list deleted containers

We already have active flag in container search results, how is that different from stopped status?

Active flag is different in as it pertains to the running status of the deepfence sensor, versus the stopped status which pertains to container state. A container may still be in running state, but will be inactive if the sensor on the host has been disconnected. I'm not sure if they can be merged, but need to look deeper into any use cases for having both
@manV

@ramanan-ravi
Copy link
Collaborator

ramanan-ravi commented Aug 17, 2023

@manV Can you fill the containers dropdown with node_name instead of docker_container_name?
Users can search a container in a certain host.

I am also setting container id in node_name when container name is not there.

We already have active flag in container search results, how is that different from stopped status?

Active flag in search containers api should work now. No need to set any additional filters.

@manV
Copy link
Member

manV commented Aug 18, 2023

Action items for frontend

  1. Use node_name on all drop-downs for display purposes.
  2. Double check usage of active flag, on integration advanced filters, consider "include dead nodes" checkbox to filter and populate advanced filter drop-down.

cc. @milan-deepfence

@milan-deepfence
Copy link
Contributor

  1. Use node_name on all drop-downs for display purposes. Fixed in: UI v2 fix 1438 #1458

@milan-deepfence
Copy link
Contributor

  1. Double check usage of active flag, on integration advanced filters, consider "include dead nodes" checkbox to filter and populate advanced filter drop-down.
    Fixed in: send agent running and active flag for searches wherever it requires #1460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Indicates that issue is not yet triaged and assigned
Projects
None yet
Development

No branches or pull requests

4 participants