tree: 02277f03d436e1e7db5b4c2ce78419a2d4c44d73 [path history] [tgz]
  1. BUILD.bazel
  2. capabilities.go
  3. policies.go
  4. README.md
core/internal/iam/README.md

Smalltown IAM

There are 4 kinds of elements in Smalltown's Authorization system

  • Identities
    • User
    • Key
    • Module
  • Objects
    • Key
    • Secret
    • Module
  • Policies
  • Permissions

Identity

Identities represent an actor that can execute actions like editing or interacting with an object.

Identities possess permissions and properties which can be accessed by policies.

Objects

Objects are things that can be interacted with like keys, secrets or modules.

Each object has a policy that handles authorization of actions performed on it.

When an object is created a default policy is attached which forwards all decisions to the global policy. For the first iteration of the system this policy will not be modifiable.

WARNING: by modifying a policy, an object could become inaccessible!

Permissions

Permissions can be assigned to an identity.

PropertyDescriptionExample
Allowed ActionRegex specifying the allowed actionskey:meta:edit
ObjectRegex specifying the objects this affectskeys:*
MultisigNumber of approvals required2

Optionally a permission can have a multisig flag that requires N approvals from identities with the same permission.

Policies

Policies guard actions that are performed on an object.

By default a global policy governs all objects and global actions using an AWS IAM like model.

Potentially a dynamic model using attachable policies could be implemented in the future to allow for highly custom models.

A potential graphical representation of a future policy:

graphical representation

Global Default Ruleset

This default global policy defines an AWS IAM like permission system.

The following actions are implemented on objects:

CategoryActionDescriptionNote
Objectobject:viewAllow to view the objectCannot be scripted using the policy builder
Objectobject:deleteAllow to delete the object
Objectobject:attach:normalAllow to attach the object to a module slot
Objectobject:attach:exclusiveAllow to attach the object to an exclusive module slot
Objectobject:policy:viewAllow to view the object's attached policy
Objectobject:policy:editAllow to edit the object's attached policy
Objectobject:audit:viewAllow to view the object's audit log
Object:Keykey:sign:eddsaAllow to sign using the key
Object:Keykey:sign:ecdsaAllow to sign using the key
Object:Keykey:sign:rsaAllow to sign using the key
Object:Keykey:encrypt:rsaAllow to encrypt using the key
Object:Keykey:encrypt:desAllow to encrypt using the key
Object:Keykey:encrypt:3desAllow to encrypt using the key
Object:Keykey:encrypt:aesAllow to encrypt using the key
Object:Keykey:decrypt:rsaAllow to decrypt using the key
Object:Keykey:decrypt:desAllow to decrypt using the key
Object:Keykey:decrypt:3desAllow to decrypt using the key
Object:Keykey:decrypt:aesAllow to decrypt using the key
Object:Keykey:auth:hmacAllow to auth messages using the key
Object:Secretsecret:revealAllow to reveal a secret to the identity
Object:Modulemodule:updateAllow to update a module's bytecodeUpdates verify the module signature
Object:Modulemodule:configAllow to configure a moduleAssigning objects to slots requires additional permissions on that object
Object:Modulemodule:call:*Allow to call a function of the moduleFunction names are defined in the module and vary between modules

The following actions are implemented globally:

CategoryActionDescriptionNote
Objectg:key:generateAllow to generate a key
Objectg:key:importAllow to import a key
Objectg:secret:importAllow to import a secret
Objectg:module:installAllow to install a module
Objectg:user:createAllow to create a user
Objectg:user:permission_removeAllow to create a userPrivilege Escalation Risk: Recommend Multisig
Objectg:user:permission_addAllow to create a userPrivilege Escalation Risk: Recommend Multisig
Objectg:cluster:viewAllow to view cluster nodes
Objectg:cluster:addAllow to add a node to the clusterDangerous: Recommend Multisig
Objectg:cluster:removeAllow to remove a node from the clusterDangerous: Recommend Multisig
Objectg:config:editAllow to edit the global config