-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Kubernetes deploy events - Add `logzio-k8s-events` sub chart version `0.0.2`: - Sends Kubernetes deploy events logs. * Update label name with space * Revert "Update label name with space" This reverts commit 6db2d88. * Revert "Revert "Update label name with space"" This reverts commit e13593c. * Update datasource name * Add deploy events agent scripts - Added deploy events datasource scripts per platform and sub type. - Gets token, listener, env_id from agent. - Checks which options were chose. * Update datasource name * Update helm.json * Fix name * Remove space from name & fix env_id * Update staging * Update Kubernetes icons - Updated security logo - Updated deploy events logo - update K8s logo * Fix security typos copy-paste Replace security report with deploy events text as it was copied and not updated. * Revert icons
- Loading branch information
Showing
80 changed files
with
3,864 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
datasources/linux/kubernetes/aks/deployevents/installer/functions.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/bash | ||
|
||
################################################################################################################################# | ||
############################################ LINUX Datasource Installer Functions ############################################### | ||
################################################################################################################################# | ||
|
||
# Loads datasource installer utils functions | ||
# Input: | ||
# --- | ||
# Output: | ||
# --- | ||
function load_installer_utils { | ||
local func_name="${FUNCNAME[0]}" | ||
|
||
local message='Loading installer utils functions ...' | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_log "$LOG_LEVEL_DEBUG" "$message" | ||
|
||
source "$ALL_RESOURCES_LINUX_DIR/datasource_installer_utils.bash" 2>"$TASK_ERROR_FILE" | ||
if [[ $? -ne 0 ]]; then | ||
message="installer.bash ($EXIT_CODE): error loading installer utils functions: $(get_task_error_message)" | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_error "$message" | ||
|
||
IS_AGENT_FAILED=true | ||
run_final | ||
exit $EXIT_CODE | ||
fi | ||
|
||
source "$KUBERNETES_RESOURCES_LINUX_DIR/datasource_installer_utils.bash" 2>"$TASK_ERROR_FILE" | ||
if [[ $? -ne 0 ]]; then | ||
message="installer.bash ($EXIT_CODE): error loading installer utils functions: $(get_task_error_message)" | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_error "$message" | ||
|
||
IS_AGENT_FAILED=true | ||
run_final | ||
exit $EXIT_CODE | ||
fi | ||
|
||
((EXIT_CODE++)) | ||
} | ||
|
||
# Gets environment id | ||
# Input: | ||
# --- | ||
# Output: | ||
# ENV_ID - The environment id | ||
function get_environment_id { | ||
local func_name="${FUNCNAME[0]}" | ||
|
||
local message='Getting environment id ...' | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_log "$LOG_LEVEL_DEBUG" "$message" | ||
|
||
PARAMS=("${GENERAL_PARAMS[@]}") | ||
get_param_value 'envID' | ||
if [[ $? -ne 0 ]]; then | ||
message="installer.bash ($EXIT_CODE): $(get_task_error_message)" | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_task_post_run "write_error \"$message\"" | ||
|
||
return $EXIT_CODE | ||
fi | ||
|
||
local env_id="$PARAM_VALUE" | ||
|
||
if [[ "$env_id" == '' ]]; then | ||
env_id=$(kubectl config current-context 2>"$TASK_ERROR_FILE") | ||
if [[ $? -ne 0 ]]; then | ||
local err=$(get_task_error_message) | ||
if [[ "$err" == *"ERROR"* ]]; then | ||
env_id=$(echo "$RANDOM" | md5sum | cut -c 1-32) | ||
fi | ||
fi | ||
fi | ||
|
||
message="Environment id is '$env_id'" | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_log "$LOG_LEVEL_DEBUG" "$message" | ||
|
||
write_task_post_run "ENV_ID='$env_id'" | ||
} |
30 changes: 30 additions & 0 deletions
30
datasources/linux/kubernetes/aks/deployevents/installer/installer.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
################################################################################################################################# | ||
############################################## LINUX Datasource Installer Script ################################################ | ||
################################################################################################################################# | ||
|
||
# Print title | ||
echo | ||
echo -e '########################################' | ||
echo -e "###$PURPLE_COLOR Security Datasource Installation $WHITE_COLOR###" | ||
echo -e '########################################' | ||
|
||
EXIT_CODE=1 | ||
|
||
# Load datasource installer utils functions | ||
load_installer_utils | ||
|
||
# Get the selected products | ||
execute_task 'get_selected_products' 'Getting selected products' | ||
# Get general params | ||
execute_task 'get_general_params' 'Getting general params' | ||
# Get environment id | ||
execute_task 'get_environment_id' 'Getting environment id' | ||
|
||
DATA_SOURCE_INSTALLER_EXIT_CODE=$EXIT_CODE | ||
|
||
if $IS_LOGS_OPTION_WAS_SELECTED; then | ||
# Run logs script | ||
run_logs | ||
fi |
5 changes: 5 additions & 0 deletions
5
datasources/linux/kubernetes/aks/deployevents/prerequisites/functions.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
################################################################################################################################# | ||
########################################## LINUX Datasource Prerequisites Functions ############################################# | ||
################################################################################################################################# |
5 changes: 5 additions & 0 deletions
5
datasources/linux/kubernetes/aks/deployevents/prerequisites/prerequisites.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
################################################################################################################################# | ||
############################################ LINUX Datasource Prerequisites Script ############################################## | ||
################################################################################################################################# |
42 changes: 42 additions & 0 deletions
42
datasources/linux/kubernetes/aks/deployevents/telemetry/logs/functions.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
################################################################################################################################# | ||
############################################## LINUX Datasource Logs Functions ################################################## | ||
################################################################################################################################# | ||
|
||
# Loads datasource logs utils functions | ||
# Input: | ||
# --- | ||
# Output: | ||
# --- | ||
function load_logs_utils { | ||
local func_name="${FUNCNAME[0]}" | ||
|
||
local message='Loading logs utils functions ...' | ||
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_LOGS" "$LOG_SCRIPT_LOGS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_log "$LOG_LEVEL_DEBUG" "$message" | ||
|
||
source "$ALL_RESOURCES_LINUX_DIR/datasource_logs_utils.bash" 2>"$TASK_ERROR_FILE" | ||
if [[ $? -ne 0 ]]; then | ||
message="logs.bash ($EXIT_CODE): error loading logs utils functions: $(get_task_error_message)" | ||
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_LOGS" "$LOG_SCRIPT_LOGS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_error "$message" | ||
|
||
IS_AGENT_FAILED=true | ||
run_final | ||
exit $EXIT_CODE | ||
fi | ||
|
||
source "$KUBERNETES_RESOURCES_LINUX_DIR/datasource_logs_utils.bash" 2>"$TASK_ERROR_FILE" | ||
if [[ $? -ne 0 ]]; then | ||
message="logs.bash ($EXIT_CODE): error loading logs utils functions: $(get_task_error_message)" | ||
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_LOGS" "$LOG_SCRIPT_LOGS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" | ||
write_error "$message" | ||
|
||
IS_AGENT_FAILED=true | ||
run_final | ||
exit $EXIT_CODE | ||
fi | ||
|
||
((EXIT_CODE++)) | ||
} |
27 changes: 27 additions & 0 deletions
27
datasources/linux/kubernetes/aks/deployevents/telemetry/logs/logs.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
################################################################################################################################# | ||
################################################ LINUX Datasource Logs Script ################################################### | ||
################################################################################################################################# | ||
|
||
# Print title | ||
echo | ||
echo -e '############' | ||
echo -e "###$PURPLE_COLOR Logs $WHITE_COLOR###" | ||
echo -e '############' | ||
|
||
EXIT_CODE=1 | ||
|
||
# Load datasource logs utils functions | ||
load_logs_utils | ||
|
||
# Get Logz.io logs token | ||
execute_task 'get_logzio_logs_token' 'Getting Logz.io logs token' | ||
# Build enable deploy events Helm set | ||
execute_task "build_enable_deploy_events_helm_set" "Building enable deploy events Helm set" | ||
# Build Logz.io deploy events logs listener URL Helm set | ||
execute_task "build_logzio_deploy_events_logs_listener_url_helm_set" "Building Logz.io deploy events logs listener URL Helm set" | ||
# Build Logz.io deploy events logs token Helm set | ||
execute_task "build_logzio_deploy_events_logs_token_helm_set" "Building Logz.io deploy events logs token Helm set" | ||
# Build Deploy events environment id Helm set | ||
execute_task "build_deploy_events_environment_id_helm_set" "Building deploy events environment id Helm set" |
Oops, something went wrong.