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

Enable/Disable Scenarios via system settings #3169

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/timesketch.conf
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ SIGMA_TAG_DELAY = 5

#-------------------------------------------------------------------------------
# DFIQ - Digital Forensics Investigation Questions
DFIQ_ENABLED = False
DFIQ_PATH = '/etc/timesketch/dfiq/'

# Intelligence tag metadata configuration
Expand Down
2 changes: 1 addition & 1 deletion timesketch/api/v1/resources/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get(self):
JSON object with system settings.
"""
# Settings from timesketch.conf to expose to the frontend clients.
settings_to_return = ["LLM_PROVIDER"]
settings_to_return = ["LLM_PROVIDER", "DFIQ_ENABLED"]
result = {}

for setting in settings_to_return:
Expand Down
2 changes: 1 addition & 1 deletion timesketch/api/v1/resources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,5 +1401,5 @@ def test_system_settings_resource(self):
"""Authenticated request to get system settings."""
self.login()
response = self.client.get(self.resource_url)
expected_response = {"LLM_PROVIDER": "test"}
expected_response = {"DFIQ_ENABLED": False, "LLM_PROVIDER": "test"}
self.assertEqual(response.json, expected_response)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
-->
<template>
<v-container fluid>
<v-card class="mx-3 mt-3 mb-7" outlined :class="$vuetify.theme.dark ? '' : 'context-card-light-grey-background'">
<v-card class="mx-3 mt-3 mb-3" outlined :class="$vuetify.theme.dark ? '' : 'context-card-light-grey-background'">
<v-toolbar flat dense style="background-color: transparent">
<span v-if="isLoading">
<v-progress-circular :size="20" :width="1" indeterminate color="primary" class="mr-3"></v-progress-circular>
Expand Down
7 changes: 5 additions & 2 deletions timesketch/frontend-ng/src/views/Sketch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ limitations under the License.
<v-main class="notransition">
<!-- Scenario context -->
<!--<ts-scenario-navigation v-if="sketch.status && hasTimelines && !isArchived"></ts-scenario-navigation>-->
<ts-question-card v-if="sketch.status && hasTimelines && !isArchived"></ts-question-card>
<ts-question-card v-if="sketch.status && hasTimelines && !isArchived && systemSettings.DFIQ_ENABLED"></ts-question-card>

<router-view
v-if="sketch.status && hasTimelines && !isArchived"
@setTitle="(title) => (this.title = title)"
class="mt-n3"
class="mt-4"
></router-view>
</v-main>

Expand Down Expand Up @@ -465,6 +465,9 @@ export default {
currentRouteName() {
return this.$route.name
},
systemSettings() {
return this.$store.state.systemSettings
},
},
methods: {
archiveSketch: function () {
Expand Down
1 change: 1 addition & 0 deletions timesketch/lib/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class TestConfig(object):
INTELLIGENCE_TAG_METADATA = "./data/intelligence_tag_metadata.yaml"
CONTEXT_LINKS_CONFIG_PATH = "./test_tools/test_events/mock_context_links.yaml"
LLM_PROVIDER = "test"
DFIQ_ENABLED = False
DATA_TYPES_PATH = "./test_data/nl2q/test_data_types.csv"
PROMPT_NL2Q = "./test_data/nl2q/test_prompt_nl2q"
EXAMPLES_NL2Q = "./test_data/nl2q/test_examples_nl2q"
Expand Down
Loading