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

Rhigdon updates merge and obfuscate #29

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -54,6 +54,7 @@
PROD_RSYSLOG = 2
PROD_UNSUPPORTED = -1

LOGGLY_DOMAIN = "gen2.loggly.com"
LOGGLY_SYSLOG_SERVER = "logs-01.loggly.com"
LOGGLY_SYSLOG_PORT = 514
DISTRIBUTION_ID = "41058"
@@ -80,10 +81,9 @@
"to manually re-configure syslog for Loggly.")
STR_SYSLOG_DAEMON_MESSAGE = ("\nSyslog daemon (%s) is not running. "
"Please start %s daemon and try again.\n")
REST_URL_GET_AUTH_TOKEN = ("http://%s.loggly.com/apiv2/customer")
REST_URL_GET_SEARCH_ID = ("http://%s.loggly.com"
"/apiv2/search?q=%s&from=-2h&until=now&size=10")
REST_URL_GET_SEARCH_RESULT = ("http://%s.loggly.com/apiv2/events?rsid=%s")
REST_URL_GET_AUTH_TOKEN = ("http://%s.%s/apiv2/customer")
REST_URL_GET_SEARCH_ID = ("http://%s.%s/apiv2/search?q=%s&from=-2h&until=now&size=10")
REST_URL_GET_SEARCH_RESULT = ("http://%s.%s/apiv2/events?rsid=%s")
USER_NAME_TEXT = ("Enter the username that you use to log into your Loggly account.")
ACCOUNT_NAME_TEXT = ("Enter your Loggly account name. This is your subdomain. "
"For example if you login at mycompany.loggly.com,"
@@ -94,7 +94,7 @@

_LOG_SOCKET = None
OUR_PROGNAME = "configure-syslog"
LOGGLY_AUTH_TOKEN = "f5b38b8c-ed99-11e2-8ee8-3c07541ea376"
LOGGLY_AUTH_TOKEN = "MWVjNGU4ZTEtZmJiMi00N2U3LTkyOWItNzVhMWJmZjVmZmUw"

This comment has been minimized.

@ivangonekrazy

ivangonekrazy Aug 31, 2013
Contributor

https://configsyslog.gen2.loggly.com/tokens doesn't seem to have this token. Do we want to encode 1ec4e8e1-fbb2-47e7-929b-75a1bff5ffe0 instead?

This comment has been minimized.

@ivangonekrazy

ivangonekrazy Aug 31, 2013
Contributor

verified the actual token is encoded in there.

This comment has been minimized.

@vinhn

vinhn Aug 31, 2013

Why obfuscate? If the customer configured this by hand, they'd need to see the raw auth token (which they'd own), and configure using the raw value.

By obfuscating it here, I'm sure a user will wonder if they need to do the same if configuring things manually.

Same thing in examples on how to post events via HTTP. Those examples must show the raw auth token. So we should be consistent here.

On Aug 30, 2013, at 6:41 PM, Ivan Tam notifications@github.com wrote:

In configure-syslog.py:

@@ -94,7 +94,7 @@

_LOG_SOCKET = None
OUR_PROGNAME = "configure-syslog"
-LOGGLY_AUTH_TOKEN = "f5b38b8c-ed99-11e2-8ee8-3c07541ea376"
+LOGGLY_AUTH_TOKEN = "MWVjNGU4ZTEtZmJiMi00N2U3LTkyOWItNzVhMWJmZjVmZmUw"
https://configsyslog.gen2.loggly.com/tokens doesn't seem to have this token. Do we want to encode 1ec4e8e1-fbb2-47e7-929b-75a1bff5ffe0 instead?


Reply to this email directly or view it on GitHub.


RSYSLOG_PROCESS = "rsyslogd"
SYSLOG_NG_PROCESS = "syslog-ng"
@@ -842,7 +842,7 @@ def get_json_data(url, user, password):
sys_exit(reason = "%s" % e)

def get_auth(loggly_user, loggly_password, loggly_subdomain):
url = (REST_URL_GET_AUTH_TOKEN % (loggly_subdomain))
url = (REST_URL_GET_AUTH_TOKEN % (loggly_subdomain, LOGGLY_DOMAIN))
data = get_json_data(url, loggly_user, loggly_password)
auth_tokens = data["tokens"]
if not auth_tokens or AUTH_TOKEN_FAIL in LOGGLY_QA:
@@ -1129,14 +1129,14 @@ def doverify(loggly_user, loggly_password, loggly_subdomain):
Logger.printLog("Sending message (%s) to Loggly server (%s)"
% (dummy_message, LOGGLY_SYSLOG_SERVER))
os.popen("logger -p INFO '%s'" % dummy_message).read()
search_url = REST_URL_GET_SEARCH_ID % (loggly_subdomain, unique_string)
search_url = REST_URL_GET_SEARCH_ID % (loggly_subdomain, LOGGLY_DOMAIN, unique_string)
# Implement REST APIs to search if dummy message has been sent.
wait_time = 0
while wait_time < VERIFICATION_SLEEP_INTERAVAL:
Logger.printLog("Sending search request. %s" % search_url)
data = get_json_data(search_url, loggly_user, loggly_password)
rsid = data["rsid"]["id"]
search_result_url = REST_URL_GET_SEARCH_RESULT % (loggly_subdomain, rsid)
search_result_url = REST_URL_GET_SEARCH_RESULT % (loggly_subdomain, LOGGLY_DOMAIN, rsid)
Logger.printLog("Sending search result request. %s" % search_result_url)
data = get_json_data(search_result_url, loggly_user, loggly_password)
total_events = data["total_events"]
@@ -1217,7 +1217,7 @@ def log(msg, prio = 'info', facility = 'local0'):
'app-name': OUR_PROGNAME,
'procid': os.getpid(),
'msgid': '-',
'loggly-auth-token': LOGGLY_AUTH_TOKEN,
'loggly-auth-token': base64.decodestring(LOGGLY_AUTH_TOKEN),
'loggly-pen': int(DISTRIBUTION_ID),
'msg': msg,
}
@@ -1228,7 +1228,6 @@ def log(msg, prio = 'info', facility = 'local0'):

if not _LOG_SOCKET: # first time only...
_LOG_SOCKET = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

_LOG_SOCKET.sendto(fullmsg.encode('utf-8'),
(LOGGLY_SYSLOG_SERVER, LOGGLY_SYSLOG_PORT))

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.