Account and team / Teams and the simulator
Teams, attachments and the simulator
Group members into teams, attach policies to members and teams, see anyone's effective access, and check a decision with the simulator.
Teams
A team is a named group of members, such as Platform or Finance. A member can be in many teams. Attach a policy to a team and it applies to everyone in it, now and later.
In the console, open Access (IAM) in the sidebar. On the Teams tab press New team, name it, and press Create team. Then, on the team's page, choose someone under Add a member and press Add.
$ pantech iam teams create "Staging operators"$ pantech iam teams members "Staging operators" add ada@example.com- Names are 1 to 64 characters, unique in the organization.
- An organization can have 50 teams.
- Owners and admins manage teams. Only owners can add an admin to a team, remove one, or delete a team with an admin in it.
- Deleting a team detaches its policies from its members. The members and the policies stay.
- When someone leaves the organization, they leave its teams and lose the policies attached to them directly, except policies with a deny in them. Those stay attached, and a deny that reached them through a team is attached to them directly, so being invited back never lifts a deny.
Owners are never affected by policies, so adding an owner to a team changes nothing for them.
Attach a policy
A policy applies to whoever it is attached to: a member directly, or a team. In the console, press Attach on the policy's page (Access (IAM) › Policies), on the team's page, or on a member's page under Effective access.
$ pantech iam policies attach staging-operators --team "Staging operators"$ pantech iam policies attach pol_pantech_read_only --member ada@example.com- A member and a team can each have 10 policies attached.
- Attaching a policy that is already attached changes nothing.
- Detaching takes the access away within 2 seconds.
- Deleting a policy detaches it everywhere.
- Only owners can attach a policy to an admin, or to a team with an admin in it, and only owners can change or detach a policy that applies to an admin.
Owners are emailed a security notice when an attachment, or joining a team, gives a member write access.
Effective access
A member's effective access shows their role, their teams, every policy that applies to them and the team that brought it, and the member baseline. Open Team in the sidebar and choose the member: it is the Effective access panel on their page. Or:
$ pantech iam access ada@example.comOwners, admins and members with iam:Read can see anyone's. Every member can see their own.
To find a member's id, list the organization's members with their role, teams and how many policies they have:
$ pantech iam members --q adaThe simulator
The simulator answers "would this be allowed?" without doing anything. In the console it is the Simulator tab of Access (IAM). Give it a member and an action, and optionally a resource, its name, an address and whether the session used two-factor:
$ pantech iam simulate --user ada@example.com --action instances:Delete --resource vm_06gk3x9tq7m2v8r4y1c5d0zp8w --resource-name prod-api --mfaThe answer is one of:
| Decision | Why |
|---|---|
owner | Owners are always allowed |
admin | An admin, and no deny matched |
allow | A member, and an allow statement matched |
baseline_read | A member reading, with the baseline at read |
explicit_deny | A deny statement matched. The simulator names the policy and the statement |
implicit_deny | Nothing allowed it |
The simulator decides as if the member were signed in to the console, not using an API key, so a key policy plays no part. Leave out the two-factor flag and the session is taken not to have used it.
The simulator is for owners, admins and members with iam:Read, so it can name the policy that decided. A refused request itself never does.
sim, err := c.IAM.Simulate(ctx, pantech.SimulateIAMAccessRequest{
UserID: "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
Action: "instances:Delete",
ResourceName: pantech.Ptr("prod-api"),
MFA: pantech.Ptr(true),
})
if err != nil {
return err
}
fmt.Println(sim.Allowed, sim.Decision)
access, err := c.IAM.GetEffectiveAccess(ctx, "usr_06gk3x9tq7m2v8r4y1c5d0zp8w")const sim = await pantech.iam.simulate({
user_id: "usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
action: "instances:Delete",
resource_name: "prod-api",
mfa: true,
});
console.log(sim.allowed, sim.decision);
const access = await pantech.iam.effectiveAccess("usr_06gk3x9tq7m2v8r4y1c5d0zp8w");sim = client.iam.simulate(
user_id="usr_06gk3x9tq7m2v8r4y1c5d0zp8w",
action="instances:Delete",
resource_name="prod-api",
mfa=True,
)
print(sim["allowed"], sim["decision"])
access = client.iam.effective_access("usr_06gk3x9tq7m2v8r4y1c5d0zp8w")Try a policy in the simulator before you attach it to everyone: attach it to one test member first, simulate, then move it to the team.