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

Defect Dojo sync frequency from webui is ignored #1484

Open
2 tasks done
Tracked by #860
worming004 opened this issue Sep 5, 2024 · 4 comments
Open
2 tasks done
Tracked by #860

Defect Dojo sync frequency from webui is ignored #1484

worming004 opened this issue Sep 5, 2024 · 4 comments
Labels
defect Something isn't working p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/S Small effort

Comments

@worming004
Copy link
Contributor

Current Behavior

Updating the value of DEFECTDOJO_SYNC_CADENCE(defectdojo.sync.cadence) through web ui have no effect on scheduling. The method to update frequency is by using CRON_EXPRESSION_FOR_DEFECT_DOJO_SYNC through environment variable.

Steps to Reproduce

  1. Start new instance of Hyades
  2. With admin account, navigate to /admin/integrations/defectDojo
  3. Activate DefectDojo Integration, use 60 for frequency
  4. Restart api-server
  5. The synchronisation happens at 2:00AM

Expected Behavior

2 Ways are fine.

  • Web interface can configure the scheduler, the environment variable is removed
  • Web interface remove integration with DefectDojo, the documentation only refer a configuration using environment variable

Hyades Version

(using docker images)

All quarkus component: 0.6.0-SNAPSHOT

hyades-apiserver:5.5.0
hyades-frontend:5.5.0

Repository Type

Hyades apiserver

Browser

N/A

Checklist

@worming004 worming004 added defect Something isn't working in triage labels Sep 5, 2024
@nscuro nscuro added p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/S Small effort and removed in triage labels Sep 5, 2024
@nscuro
Copy link
Member

nscuro commented Sep 5, 2024

Thanks for reporting. Definitely an unintuitive gap right now. Ideally this should be configurable via environment variables and UI. If configured via env vars, the setting should be read-only in the UI. If configured via UI changes should apply immediately (-ish).

To enable the latter, we need to figure out a way to make other API server instances aware of when this config changes, so they can update their schedule. Since there is no central scheduler at the moment.

For context, in DT v4.x it was configurable via UI, but it required a server restart to take effect. Which of course isn't great either.

@worming004
Copy link
Contributor Author

worming004 commented Sep 5, 2024

Thanks for the quick answer and your involvement:)

Only my 2 cents, propose to configure through UI and environment variable adding internal complexity for little added value. Maybe other users have another point of view.

About the decentralized scheduler, maybe I am wrong, but I expect that API server is a single instance. Only other components are horizontally scalable. So, in my mind the Scheduler is always a central and unique component. At least, the diagram in readme page do not show "API Server" service as composed by several instance.

EDIT: fix my terrible phrasing

@nscuro
Copy link
Member

nscuro commented Sep 5, 2024

but I expect that API server is a single instance

Actually, you can scale the API server horizontally, too!

The way concurrent scheduling of the same task is handled, is via locks (https://github.com/lukas-krecan/ShedLock). This works because tasks are now scheduled via cron, whereas in v4.x they were scheduled relative to when the API server started. It is a very simple solution but it allowed us to avoid, or at least delay, introduction of yet another component.

At least, the diagram in readme page do not "API Server" service composed by several instance.

That diagram deserves an update, yes... :D

@nscuro
Copy link
Member

nscuro commented Sep 5, 2024

Only my 2 cents, propose to configure through UI and environment variable adding internal complexity for little added value. Maybe other users have another point of view.

From what I've heard from users so far, configuration is a really subjective thing. You'll see technically averse folks demanding everything to be configurable via environment variables, since it plays better with configuration as code. On the other side you have "normal" users for whom every change would then require opening tickets with their operations team.

I personally am more inclined towards the former, but we can't simply dismiss the latter either. Perhaps the middle-ground is to focus on environment variables short-term, and work on something "better" that supports both use-cases mid- to long-term.

nscuro added a commit that referenced this issue Sep 8, 2024
As per #1484 (comment), the diagram made it look like the API server does not support multiple replicas, when in reality it does.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro mentioned this issue Oct 2, 2024
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/S Small effort
Projects
Status: Todo
Development

No branches or pull requests

2 participants