For those who learn some of my earlier weblog posts, that I automated the setup (onboarding) for workshops and hackathons. To date, operating my Terraform scripts to deploy sources and privileges meant permitting entry to them. Because of a (comparatively) new IBM Cloud safety function referred to as time-based restrictions, I can decouple the deployment course of from when entry is feasible.
On this weblog put up, I’m going to present a brief introduction to time-based restrictions. Then, I’ll stroll you thru my use case and the way I applied it:
Overview: Time-based restrictions
Identification and Entry Administration (IAM) means that you can shield your IBM Cloud sources. You’ve in all probability discovered to make the most of entry teams, trusted profiles, service and consumer identities and how you can assign entry. By including time-based restrictions, you’ll be able to scope these entry insurance policies additional to a selected time and date vary (as soon as) or to recurring home windows. The latter might be upkeep home windows—for instance, over the weekend or particular hours in the course of the evening. Typical examples for single occasions (as soon as) are ad-hoc upkeep work for some hours or some scheduled longer duties with a given begin and finish.
When creating a brand new coverage, now you can optionally add situations for when the entry ought to be granted. Within the IBM Cloud console’s browser UI, that non-compulsory step is obtainable (see the picture under). I may have additionally utilized the CLI or API/SDK, however for my automated setup of workshop sources, I picked Terraform:
Situation: Workshops
As mentioned in my weblog “Secure Onboarding for Your Workshops and Hackathons,” I typically must run short-lived tasks. For these tasks, it’s essential to automate the onboarding and offboarding to all the time arrange the workshop surroundings the identical manner. Individuals ought to have entry privileges associated to their function. To this point, I might deploy the sources utilizing Terraform (together with all privileges) and destroy sources and entry after the occasion.
By including time-based restrictions to the entry insurance policies, I’m able to grant entry in levels. As soon as once more, I deploy every little thing with Terraform, together with IAM privileges. Nevertheless, the time-related situations ensure that the insurance policies are solely lively between the beginning and finish instances. They might be set to align with the workshop begin and the official finish (or some hours/days later). With out destroying the sources, entry to them is mechanically minimize off after the workshop.
The next reveals the sample conditions that I added to the shared Terraform code. Yow will discover all of it within the GitHub repository cloud-project-onboarding-terraform and the department workshop_hackathon. The screenshot on the high of this weblog put up reveals the identical situations within the IBM Cloud console.
rule_conditions {
key = "{{surroundings.attributes.current_date_time}}"
operator = "dateTimeGreaterThanOrEquals"
worth = ["2023-07-19T09:00:00+01:00"]
}
rule_conditions {
key = "{{surroundings.attributes.current_date_time}}"
operator = "dateTimeLessThanOrEquals"
worth = ["2023-07-26T09:00:00+01:00"]
}
rule_operator = "and"
sample = "time-based-conditions:as soon as"
Conclusion
Time-based restrictions are an excellent addition to the present IBM Cloud safety features. They let you cut back assigned entry to a single time, date ranges or recurring upkeep home windows, thereby decreasing the assault floor. For my use case of automated onboarding and offboarding, the time-based restrictions enable me to decouple useful resource and privilege deployment from activating entry. This implies I’ve extra flexibility in when to carry out administrative duties.
Need to study extra? Listed below are my solutions:
When you have suggestions, solutions, or questions on this put up, please attain out to me on Twitter (@data_henrik), Mastodon (@data_henrik@mastodon.social) or LinkedIn.