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

Where to set the Days to reset the IAM Keys #45

Open
KarthikShridhar opened this issue Jun 30, 2020 · 4 comments
Open

Where to set the Days to reset the IAM Keys #45

KarthikShridhar opened this issue Jun 30, 2020 · 4 comments

Comments

@KarthikShridhar
Copy link

Hello rhyeal,

I'm trying to use this script to rotate my keys automatically. But I'm not find the place where you are giving the number of days it should rotate. And I have multiple keys which I want to rotate based on the days they have created but its not working as expected. And the task scheduler which this is creating that also not working as expected. Could you please check once in the windows machine and try to fix this code. If I fix before that I can also prove the same :)

@joesoh
Copy link

joesoh commented Jan 22, 2021

I can see from file homebrew.mxcl.aws-rotate-iam-keys.plist, section StartCalendarInterval controls the run interval.
The default run time is set to run at 0323 daily.

I have not personally modified the run interval, maybe you can refer to the link below, modify and update back if it works?
https://alvinalexander.com/mac-os-x/launchd-plist-examples-startinterval-startcalendarinterval/

@levinotik
Copy link

I too am looking for a way to change the frequency with which aws-rotate-iam-keys rotates keys. I'd prefer every few days or weekly (rather than daily). Is there a way to do this?

@pc-star
Copy link

pc-star commented Apr 5, 2022

@levinotik if you are working with the Windows powershell script, all you have to do it is adding any of the options suggested in the following link, based on your needs :

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks-create

as for my personal case, I am currently trying using /mo 90 ( rotate the key every 90 days ) to be added straight after the -profile default /sc daily values of the script itself.

@mmrwoods
Copy link
Collaborator

That seems a nice idea, but sounds tricky to implement neatly (esp. if it is done in the launch daemon config).

The Homebrew formula hard-codes a daily schedule when generating the plist file, the time is somewhat irrelevant, but it is designed to run daily. You could edit the plist file though and change the schedule to limit it to specific weekdays etc.

Run brew services list, get the path to the plist file, probably ~/Library/LaunchAgents/homebrew.mxcl.aws-rotate-iam-keys.plist, edit it and add a Weekday key/value to the StartCalendarInterval dict.

Unfortunately, your changes will be obliterated if you re-install or upgrade. Maybe the formula installation process could read and respect any existing schedule to fix that. I might take a look sometime. PR for this would be most welcome :-)

Repository owner deleted a comment from hyassine1 Mar 19, 2024
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

No branches or pull requests

5 participants