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

Update GitHub audit log path for GitHub Enterprise 2.11 #8

Closed
wants to merge 2 commits into from
Closed

Update GitHub audit log path for GitHub Enterprise 2.11 #8

wants to merge 2 commits into from

Conversation

rashamalek
Copy link
Contributor

@rashamalek rashamalek commented Oct 10, 2017

on ghe 2.11.2 the github-audit path is a link (/var/log/github/audit.log) to /var/log/github-audit.log

this leads to an empty git-download.tsv and an empty result in hubble/housekeeping-git-traffic.

Rotated logs are kept as /var/log/github/audit.log.[1-9].*
This pr changes the ghe-audit log path in hubble/updater/script/gith-download.sh from
/var/log/github/audit.log.1* -> /var/log/github-audit.log.1*

@rashamalek rashamalek changed the title update git-audit log path update git-audit log path in hubble/updater/script/gith-download.sh Oct 10, 2017
@pluehne pluehne self-assigned this Oct 10, 2017
@pluehne pluehne self-requested a review October 10, 2017 20:43
@pluehne pluehne added the bug label Oct 10, 2017
@pluehne
Copy link
Contributor

pluehne commented Oct 10, 2017

Thanks for this pull request, @rashamalek!

It’s interesting to hear that GitHub Enterprise changed the log file location from 2.10 to 2.11.

For now, we shouldn’t assume that users are on GitHub Enterprise ≥ 2.11 necessarily.
For this reason, it would be best to have a switch depending on which version is detected.

I won’t be able to implement the switch in the next days though, as I have many other things to do.

And for your information, I want to add a GitHub Enterprise version check at some point to make sure that Hubble runs on a supported version 😃.

@pluehne pluehne moved this from To Do to In Progress in Hubble Enterprise 0.1.1 Oct 10, 2017
@pluehne pluehne changed the title update git-audit log path in hubble/updater/script/gith-download.sh Update GitHub audit log path for GitHub Enterprise 2.11 Oct 10, 2017
@larsxschneider
Copy link
Collaborator

@rashamalek We can use this command to check the GHE version: https://github.com/larsxschneider/scotty/blob/a68d16339a6da8cd20559ce36533f148e3376d47/lib-ghe.sh#L66-L67

We'll get this in soon as we plan to upgrade to 2.11, too 😄

@@ -4,7 +4,7 @@
#
echo -e "repository\tuser\tcloning?\trequests/day\tdownload/day [B]"

zcat -f /var/log/github/audit.log.1* |
zcat -f /var/log/github-audit.log.1* |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Doing a version check is reasonable, will try to adapt it.

@pluehne
Copy link
Contributor

pluehne commented Oct 11, 2017

Thanks for the update, @rashamalek!

However, I fear hat looking for /var/log/github-audit.log* with a wildcard will not only give us the log files from yesterday, but all of them.
However, we currently plan to gather this data on a daily basis.

I think the best solution would be to select the file locations based on the GitHub Enterprise version in use, and to always take a .1 log file.
What do you think?

@rashamalek
Copy link
Contributor Author

@pluehne Sorry, It was not supposed to be pushed to Autodesk/hubble, It was an internal test, will fix it

@pluehne
Copy link
Contributor

pluehne commented Oct 11, 2017

No worries, you can always rebase this branch 😃.

@larsxschneider
Copy link
Collaborator

@rashamalek I cherry picked your commit and added support for pre 2.11 in #11

@pluehne pluehne moved this from In Progress to Done in Hubble Enterprise 0.1.1 Oct 13, 2017
@pluehne pluehne removed this from Done in Hubble Enterprise 0.1.1 Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants