Expand description
Security primitives and capabilities for Twizzler.
This crate provides the core security infrastructure including capabilities, delegations, gates, and security contexts.
§Features
kernel- Enable kernel-space functionalityuser- Enable user-space functionality (mutually exclusive withkernel)
Structs§
- Cap
- A capability that represents authorization for a Security Context to access an object.
- CapFlags
- Flags pertaining to a
CapCurrently only used to set which hashing scheme to use when forming a capability. - CtxMap
Item - This type is stored inside the
CtxMap. The map serves to store information about whereCaps andDels are stored inside theSecCtxobject. - Del
- A Delegation, which can be used to delegate capabilities into other security contexts. Currently not implemented
- Gate
- Gates are a range into an object that a
Cap/Delprovides access to. Typically Gates are set to the entire object, but can be defined to the byte-level. This primitive is used to support Secure API Calls TODO: link more info about secure api calls - Mask
- Used to store
Maskdata that will be applied to permissions granted by aSecCtxfor specific target object. - Perms
Info - Information about protections for a given object within a context.
- Revoc
- Specifies when a Capability is invalid. Currenty is a time in ns from unix epoch but plan to change later.
- SecCtx
- A User-space representation of a Security Context.
- SecCtx
Base - The base of a Security Context, holding a map to the capabilities and delegations stored inside, masks on targets
- SecCtx
Flags - Flags for a
SecCtx. - Signature
- Represents a Scheme agnostic Signature;
- Signing
Key - Helper type for keybuffer
An Objects
SigningKey, used in creatingCaps andDels. Is agnostic over SigningSchemes. - Verifying
Key - An Objects
SigningKey, used to create an Object. Is also reffered to as an Objects’kuid. The kernel uses this key to verify anyCaps orDels. Is agnostic over SigningSchemes.
Enums§
- CtxMap
Item Type - The type of item stored inside the map inside the
SecCtx. - DelInner
- A delegation can hold a Delegation or a Capability
- Hashing
Algo - The hashing algorithm used when creating a
Cap - Signing
Scheme - The signing scheme used when creating a
Cap
Constants§
- MAP_
ITEMS_ PER_ OBJ - arbitrary number of map items per target object
- MASKS_
MAX - completely arbitrary amount of mask entries in a security context
- MAX_
KEY_ SIZE - The maximum key size the security system supports NOTE: can be increased while preserving backwards compatibility.
- OBJECT_
ROOT_ OFFSET - The root offset into the object, after the size of the base.
- SEC_
CTX_ MAP_ LEN - completely arbitrary amount of capabilites and delegations in a security context
Traits§
- Secure
Builder Ext - An extension trait for the ObjectBuilder from the
twizzlercrate that allows for the creation of objects that have restrained default permissions.