Skip to content

Implemented audit logs in mysql #69

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

Merged
merged 4 commits into from
Mar 31, 2023
Merged

Conversation

sheldor1510
Copy link
Collaborator

@sheldor1510 sheldor1510 requested a review from hakasapl March 30, 2023 19:35
Copy link
Collaborator

@hakasapl hakasapl left a comment

Choose a reason for hiding this comment

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

The PHP implementation and bootstrapping looks good. Something to keep in mind is that the operator will not always be the user object. Admins can access the web portal as their user and modify a user's ssh keys, for example. In that case the admin would be the operator.

I think the best way to do this is by including an optional "operator" parameter for the setsshkeys method, which would be filled in with the global $USER variable.

Any thoughts on this?

@sheldor1510
Copy link
Collaborator Author

sheldor1510 commented Mar 30, 2023

Yes, adding the optional "operator" parameter makes sense for the setsshkeys method.

@hakasapl Can you explain how would I go about getting the global $USER variable? Is that present in some other scope since it's not showing up when I write it in UnityUser.php.

@hakasapl
Copy link
Collaborator

The $USER variable point to the UnityUser object for the person who is currently authenticated. It is set in the resources/init.php file, and will only be available on the panel/* and admin/* pages.

@sheldor1510
Copy link
Collaborator Author

When I tried using the $USER variable in panel/account.php, it is always giving the user who the admin is accessing and not the admin itself. Is there some other way around this?

@hakasapl
Copy link
Collaborator

You're right - I forgot how that worked. I just made a PR but accidentally merged it with my last PR before I could request a review from you. See this commit: e4cd4be

That's now merged, so once you sync your fork you can use the $OPERATOR variable which will always be the user signed in, and the $USER var, which will stay the same.

@sheldor1510 sheldor1510 requested a review from hakasapl March 31, 2023 03:05
Copy link
Collaborator

@hakasapl hakasapl left a comment

Choose a reason for hiding this comment

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

Looks good. I will merge this, I assume you'll make another PR for auditing everything else? I will add a message to the issue listing each case we should have a log for

@hakasapl hakasapl merged commit 611002c into UnityHPC:main Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants