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

Add TLS support for file monitoring #88

Merged
merged 13 commits into from Oct 10, 2017

Conversation

@Shwetajain148
Copy link
Contributor

@Shwetajain148 Shwetajain148 commented Apr 12, 2017

I changed configure-linux.sh and configure-file-monitoring.sh scripts to add TLS support to both the scripts.

These are covering below points.

  • Added TLS support to configure-linux.sh file
  • Added TLS support to configure-file-monitoring.sh file
    • Check if 6514 is open
    • Add insecure parameter
    • Prompt if we should switch to insecure mode if system logs are insecure, or overwrite them with secure mode
    • If silent or no prompt mode is on and system logs are insecure, log a warning and overwrite system config with secure settings
@Shwetajain148
Copy link
Contributor Author

@Shwetajain148 Shwetajain148 commented Apr 13, 2017

@mostlyjason I am testing these changes on different scenarios. I am observing that a couple of changes are needed. Kindly put it on hold for another one day. Thanks.

@@ -2,7 +2,7 @@

#downloads configure-linux.sh
echo "INFO: Downloading dependencies - configure-linux.sh"
curl -s -o configure-linux.sh https://www.loggly.com/install/configure-linux.sh
curl -s -o configure-linux.sh https://raw.githubusercontent.com/Shwetajain148/install-script/tls-support-filemonitoring/Linux%20Script/configure-linux.sh

This comment has been minimized.

@Shwetajain148

Shwetajain148 Apr 17, 2017
Author Contributor

@mchaudhary @mostlyjason For the time being, I have put the custom path here. After the changes will be deployed to the link URL, we can update it later.

@Shwetajain148
Copy link
Contributor Author

@Shwetajain148 Shwetajain148 commented Apr 17, 2017

@mchaudhary @mostlyjason I have tested the script and have made some changes. Now, it is working for me. Kindly review. Thanks

source configure-linux.sh "being-invoked"

########## Variable Declarations - Start ##########
#name of the current script
SCRIPT_NAME=configure-file-monitoring.sh
#version of the current script
SCRIPT_VERSION=1.13
SCRIPT_VERSION=1.14

This comment has been minimized.

@Shwetajain148

Shwetajain148 Apr 17, 2017
Author Contributor

@mchaudhary @mostlyjason Please let me know if 1.14 is not suitable.

else
logMsgToConfigSysLog "WARN" "WARN: Your system logs are being send insecurely. We prefer to send system logs securely so switching to secure configuration."
else
logMsgToConfigSysLog "WARN" "WARN: Your system logs are being send insecurely. We prefer to send system logs securely so switching to secure configuration."

This comment has been minimized.

@mostlyjason

mostlyjason Aug 30, 2017
Contributor

sent...the secure

This comment has been minimized.

@Shwetajain148

Shwetajain148 Sep 1, 2017
Author Contributor

@mchaudhary @mostlyjason, Since this change, was in configure-linux script so I made the above changes in existing PR for configure-linux script here: #102 so that these changes will not depend on this file-monitoring PR to be merged.

\$InputRunFileMonitor
#Add a tag for file events
template (name=\"$CONF_FILE_FORMAT_NAME\" type=\"string\" string=\"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [$LOGGLY_AUTH_TOKEN@41058 $TAG] %msg%\n\")

This comment has been minimized.

@mostlyjason

mostlyjason Aug 30, 2017
Contributor

How is $TAG set?

This comment has been minimized.

@Shwetajain148

Shwetajain148 Sep 1, 2017
Author Contributor

@mostlyjason, From the very beginning, the default tag i.e. file is set into the LOGGLY_FILE_TAG variable if the user has not provided one externally using the parameter -tag in the command. Please refer the below code line-

Ref: https://github.com/loggly/install-script/blob/master/Modular%20Scripts/File%20Monitoring/configure-file-monitoring.sh#L37

Now, the user can pass multiple tags externally which get stored into the same LOGGLY_FILE_TAG variable separated by a comma and iterate inside the addTagsInConfiguration function and finally set into the $TAG variable. Please refer the below code line-

Ref: https://github.com/loggly/install-script/blob/master/Modular%20Scripts/File%20Monitoring/configure-file-monitoring.sh#L347

Once $TAG is set with either one or multiple tags, the same variable is used in the file-monitoring configuration. Please refer the below code line-

Ref: https://github.com/loggly/install-script/blob/master/Modular%20Scripts/File%20Monitoring/configure-file-monitoring.sh#L427

This is how $TAG set.

This comment has been minimized.

@mostlyjason

mostlyjason Sep 1, 2017
Contributor

Okay we should document how to set tags in https://www.loggly.com/docs/configure-syslog-script/. I don't see any descriptions for that parameter

This comment has been minimized.

@Shwetajain148

Shwetajain148 Sep 4, 2017
Author Contributor

@mostlyjason, I have added a Note to tell the users that how they can set the tag for all three file-monitoring, Nginx and Apache script on the document https://www.loggly.com/docs/configure-syslog-script/. I added this information after the Script Usage section, please review.

@mchaudhary mchaudhary merged commit bffc166 into loggly:master Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.