-
Notifications
You must be signed in to change notification settings - Fork 0
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
Scan for incorrect permissions #29
Conversation
I'm still unsure about what to do when we find incorrect permissions. Mark the pipeline as unstable or failed? Send an email to some users? Something else? |
The pipeline could also be combined with the one that updates the database if we decide that the stage executed here marks the build as unstable if incorrect permissions are found. |
Sending emails to users sounds like a decent option for an action. [email protected] will be forwarded to their contact email. It has to be done from Jenkins as the mailer on NCI is disabled. Does marking unstable mean the database update continues, just has a different symbol and issues a warning? In which case that would be ok. I don't think there is any point stopping updating the database if there are just some files with incorrect permissions/group. |
Basically yes. |
I like the I wonder if now is the right time to think about something like this using the presence of a |
Yes, that's the idea. As long as we are hard-coding the paths, it is safer if the information about the directories is in a single place. I also like the suggestion in #18. At which level should that be implemented: the bash script or in the cookbook? |
It depends on what you want to use it for. If the presence of a The downside is you can't look for a missing The other sticking point: the backup script for the payu (
So it isn't sufficient to simply do
that list would have to be filtered for any subdirectories of other experiment directories. This works:
but is not completely general. Walking the directory tree works better conceptually, stop as soon as you hit a |
Just to be clear, you would continue to want to explicitly do this
|
Just noticed it is still a draft, I am jumping the gun a bit! |
@aidanheerdegen Thanks for the ideas and comments. Probably the best is to get this PR and #25 merged first, as that's more important in the short term. I plan on finishing both PR's tomorrow, so it would be good if you could have a look and approve them tomorrow. I just need to make a few changes beforehand. |
Let me know when you're ready for the review |
@aidanheerdegen Thanks, but this PR still needs some more changes (working on it right now). In the meantime, #25 is actually ready, in case you want to look at it. |
@aidanheerdegen @aekiss This PR is now ready to be reviewed. I've tested this quite extensively, but it would be good to have a second and third pair of eyes going through it. Currently there are a few files with incorrect permissions. They all belong to the user |
Hi @micaeljtoliveira. https://accessdev.nci.org.au/grafana/org/users but that might only show users who have logged into grafana. I made a user lookup dashboard, but you might not be able to access it. https://accessdev.nci.org.au/grafana/d/kZSiZsmnk/user-lookup?orgId=1 Let me know if you can't. |
Sorry, I can't access the dashboard. |
I've changed something, check if you can see it now. |
Works now. Thanks! |
It's a bit weird to use. Click on the funnel (filter) icon on any of the columns to begin filtering by name or user id, and then you can select the matching ones and they'll show a full entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. My only concern is spamming people if emails are sent out every day. Maybe skip sending the email if date +%A
isn't Monday?
…he PBS script into its own bash script.
…ild as unstable if there are problems with the permissions.
…s with bad permissions.
@aekiss I've now changed the script to only send emails on Mondays. I'm now testing the change and will need a new approval on this PR once I confirm that everything is working as expected. |
@aekiss Looks like this is working as expected and can now be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
Adds script to find all the files and directories with incorrect permissions. This runs alongside the update of the database and marks the build as unstable if any incorrect permissions are found. It will also send an email to the owners of the affected files.
There is a currently a Jenkins pipeline to test this: https://accessdev.nci.org.au/jenkins/job/COSIMA/job/Test/
Closes #27