libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
TOKEN_ACCESS_MASK.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include "ACCESS_MASK.hh"
19
20namespace introvirt {
21namespace windows {
22namespace nt {
23
61
67class TOKEN_ACCESS_MASK final : public ACCESS_MASK {
68 public:
76 bool has(TokenAccessMaskFlag flag) const { return (value() & flag) == flag; }
77
83 void set(TokenAccessMaskFlag flag) { value(value() | flag); }
84
90 void clear(TokenAccessMaskFlag flag) { value(value() & ~flag); }
91
92 AccessMaskType type() const override { return TokenAccessMask; }
93
94 // Constructors and assignment operators
95 TOKEN_ACCESS_MASK() = default;
96 TOKEN_ACCESS_MASK(uint32_t mask) : ACCESS_MASK(mask) {}
97
100};
101
102const std::string& to_string(TokenAccessMaskFlag);
103std::ostream& operator<<(std::ostream&, TokenAccessMaskFlag);
104
106std::ostream& operator<<(std::ostream&, TOKEN_ACCESS_MASK);
107
108} /* namespace nt */
109} /* namespace windows */
110} /* namespace introvirt */
Generic ACCESS_MASK type.
Definition ACCESS_MASK.hh:109
uint32_t value() const
Get the raw value.
Definition ACCESS_MASK.hh:155
AccessMaskType
Definition ACCESS_MASK.hh:111
@ TokenAccessMask
Definition ACCESS_MASK.hh:120
ACCESS_MASK class for token permissions.
Definition TOKEN_ACCESS_MASK.hh:67
TOKEN_ACCESS_MASK(uint32_t mask)
Definition TOKEN_ACCESS_MASK.hh:96
void clear(TokenAccessMaskFlag flag)
Clear the given flag.
Definition TOKEN_ACCESS_MASK.hh:90
TOKEN_ACCESS_MASK(const TOKEN_ACCESS_MASK &)=default
void set(TokenAccessMaskFlag flag)
Set the state of the given flag to enabled.
Definition TOKEN_ACCESS_MASK.hh:83
TOKEN_ACCESS_MASK & operator=(const TOKEN_ACCESS_MASK &)=default
AccessMaskType type() const override
Get the type of access mask.
Definition TOKEN_ACCESS_MASK.hh:92
bool has(TokenAccessMaskFlag flag) const
Check if the given flag is enabled.
Definition TOKEN_ACCESS_MASK.hh:76
@ STANDARD_RIGHTS_READ
Currently defined to equal READ_CONTROL.
Definition ACCESS_MASK.hh:58
@ STANDARD_RIGHTS_WRITE
Currently defined to equal READ_CONTROL.
Definition ACCESS_MASK.hh:61
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
TokenAccessMaskFlag
Valid flags for TOKEN_ACCESS_MASK.
Definition TOKEN_ACCESS_MASK.hh:33
@ TOKEN_ADJUST_PRIVILEGES
Required to enable or disable the privileges in an access token.
Definition TOKEN_ACCESS_MASK.hh:46
@ TOKEN_IMPERSONATE
Required to attach an impersonation access token to a process.
Definition TOKEN_ACCESS_MASK.hh:40
@ TOKEN_ASSIGN_PRIMARY
Definition TOKEN_ACCESS_MASK.hh:36
@ TOKEN_ALL_ACCESS
All possible access rights for a token.
Definition TOKEN_ACCESS_MASK.hh:59
@ TOKEN_QUERY
Required to query an access token.
Definition TOKEN_ACCESS_MASK.hh:42
@ TOKEN_READ
Combines STANDARD_RIGHTS_READ and TOKEN_QUERY.
Definition TOKEN_ACCESS_MASK.hh:54
@ TOKEN_ADJUST_SESSIONID
Required to adjust the session ID of an access token. The SE_TCB_NAME privilege is required.
Definition TOKEN_ACCESS_MASK.hh:52
@ TOKEN_ADJUST_DEFAULT
Required to change the default owner, primary group, or DACL of an access token.
Definition TOKEN_ACCESS_MASK.hh:50
@ TOKEN_QUERY_SOURCE
Required to query the source of an access token.
Definition TOKEN_ACCESS_MASK.hh:44
@ TOKEN_DUPLICATE
Required to duplicate an access token.
Definition TOKEN_ACCESS_MASK.hh:38
@ TOKEN_ADJUST_GROUPS
Required to adjust the attributes of the groups in an access token.
Definition TOKEN_ACCESS_MASK.hh:48
@ TOKEN_WRITE
Combines STANDARD_RIGHTS_READ and TOKEN_QUERY.
Definition TOKEN_ACCESS_MASK.hh:56
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20