Documentation
¶
Overview ¶
Package resourceattribute implements the codec for the resource-attribute data carried in a SYSTEM_RESOURCE_ATTRIBUTE_ACE (MS-DTYP 2.4.4.15). The ACE's ApplicationData is a CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 structure (MS-DTYP 2.4.10.1); this package converts between that binary form and the SDDL attribute-data text `"name",TYPE,flags,value,...` (MS-DTYP 2.5.1.1).
text -> Marshal -> CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 bytes bytes -> Unmarshal -> text
The structure is offset-based: a fixed 16-byte header (Name, ValueType, Reserved, Flags, ValueCount) is followed by an array of ValueCount DWORD offsets, each pointing (from the start of the structure) to a value; the attribute name and the values themselves follow. All integers are little-endian and the whole structure is padded to a DWORD boundary.
Index ¶
Constants ¶
const ( TypeInt64 uint16 = 0x0001 TypeUint64 uint16 = 0x0002 TypeString uint16 = 0x0003 TypeSID uint16 = 0x0005 TypeBoolean uint16 = 0x0006 TypeOctetString uint16 = 0x0010 )
CLAIM_SECURITY_ATTRIBUTE_TYPE value-type codes (MS-DTYP 2.4.10.1).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ResourceAttribute ¶
type ResourceAttribute struct {
Name string
ValueType uint16
Flags uint32
Ints []int64 // TypeInt64, TypeUint64, TypeBoolean
Strings []string // TypeString
SIDs []string // TypeSID (string form)
Octets [][]byte // TypeOctetString
}
ResourceAttribute is the decoded representation of a resource attribute. Exactly one of the value slices is populated, chosen by ValueType.
func Decode ¶
func Decode(data []byte) (*ResourceAttribute, error)
Decode parses CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 bytes.
func Parse ¶
func Parse(attrData string) (*ResourceAttribute, error)
Parse converts SDDL attribute-data text into a ResourceAttribute.
func (*ResourceAttribute) Encode ¶
func (ra *ResourceAttribute) Encode() ([]byte, error)
Encode serializes the ResourceAttribute into binary form.
func (*ResourceAttribute) String ¶
func (ra *ResourceAttribute) String() string
String renders the resource attribute as SDDL attribute-data text (without an outer pair of parentheses).