@@ -102,45 +102,46 @@ if __name__ == '__main__':
102102## Authenticate and provision DPA VM policies
103103
104104``` python
105- isp_auth = ArkISPAuth()
106- isp_auth.authenticate(
107- auth_profile = ArkAuthProfile(
108- username = username, auth_method = ArkAuthMethod.Identity, auth_method_settings = IdentityArkAuthMethodSettings()
109- ),
110- secret = ArkSecret(secret = ' CoolPassword' ),
111- )
112- print (' Adding DPA Policy' )
113- dpa_service.policies.add_policy(
114- ArkDPAVMAddPolicy(
115- policy_name = ' IT Policy' ,
116- description = ' IT Policy' ,
117- status = ArkDPARuleStatus.Enabled,
118- providers_data = {
119- ArkWorkspaceType.AWS : ArkDPAVMAWSProviderData(
120- account_ids = [' 965428623928' ], tags = [{' key' : ' team' , ' value' : ' IT' }], regions = [], vpc_ids = []
121- )
122- },
123- user_access_rules = [
124- ArkDPAVMAuthorizationRule(
125- rule_name = ' IT Rule' ,
126- user_data = ArkDPAUserData(roles = [' IT' ]),
127- connection_information = ArkDPAVMConnectionInformation(
128- full_days = True ,
129- days_of_week = [],
130- time_zone = ' Asia/Jerusalem' ,
131- connect_as = {
132- ArkWorkspaceType.AWS : {
133- ArkProtocolType.SSH : ' root' ,
134- ArkProtocolType.RDP : ArkDPAVMRDPLocalEphemeralUserConnectionData(
135- local_ephemeral_user = ArkDPAVMLocalEphemeralUserConnectionMethodData(assign_groups = {' Administrators' })
136- ),
137- }
138- },
139- ),
140- )
141- ],
105+ if __name__ == ' __main__' :
106+ isp_auth = ArkISPAuth()
107+ isp_auth.authenticate(
108+ auth_profile = ArkAuthProfile(
109+ username = username, auth_method = ArkAuthMethod.Identity, auth_method_settings = IdentityArkAuthMethodSettings()
110+ ),
111+ secret = ArkSecret(secret = ' CoolPassword' ),
112+ )
113+ print (' Adding DPA Policy' )
114+ dpa_service.policies.add_policy(
115+ ArkDPAVMAddPolicy(
116+ policy_name = ' IT Policy' ,
117+ description = ' IT Policy' ,
118+ status = ArkDPARuleStatus.Enabled,
119+ providers_data = {
120+ ArkWorkspaceType.AWS : ArkDPAVMAWSProviderData(
121+ account_ids = [' 965428623928' ], tags = [{' key' : ' team' , ' value' : ' IT' }], regions = [], vpc_ids = []
122+ )
123+ },
124+ user_access_rules = [
125+ ArkDPAVMAuthorizationRule(
126+ rule_name = ' IT Rule' ,
127+ user_data = ArkDPAUserData(roles = [' IT' ]),
128+ connection_information = ArkDPAVMConnectionInformation(
129+ full_days = True ,
130+ days_of_week = [],
131+ time_zone = ' Asia/Jerusalem' ,
132+ connect_as = {
133+ ArkWorkspaceType.AWS : {
134+ ArkProtocolType.SSH : ' root' ,
135+ ArkProtocolType.RDP : ArkDPAVMRDPLocalEphemeralUserConnectionData(
136+ local_ephemeral_user = ArkDPAVMLocalEphemeralUserConnectionMethodData(assign_groups = {' Administrators' })
137+ ),
138+ }
139+ },
140+ ),
141+ )
142+ ],
143+ )
142144 )
143- )
144145```
145146
146147## View Session Monitoring Sessions And Activities Per Session
0 commit comments