Review Questions

1. 

What is the term used to describe the act of presenting user-furnished credentials to the system, which evaluates them and assigns an identity?

  1. Authorization

  2. Permission

  3. Authentication

  4. Integration

cauthentication is the process of presenting user-supplied credentials to the system, which evaluates them and assigns an identity based on the information provided. a permission is a specific right held by the application. authorization is used to verify that an application has been granted permission to perform a specific action. integration is not a .net security term.

2. 

Which of the following approaches to security in .NET uses the Thread.CurrentPrincipal.IsInRole method to verify that the current principal is a member of a specific role?

  1. CLR role-based security

  2. .NET Enterprise Services security

  3. Thread safety security

  4. Code access security

aclr role-based security can use the isinrole method or demand a specific principalpermission to verify that the current principal is a member of a role. .net enterprise services security uses the incallerinrole method to check role membership. code access security is used to check security based on the characteristics and origin of an assembly, not roles. thread safety security is not a .net security model.

3. 

To automatically have a method verify that it has permission to access the system environment settings, and throw a security exception if it does not, which of the following attributes would you apply to the method?

  1. <EnvironmentPermission(SecurityAction.Assert, Unrestricted = True)>

  2. <EnvironmentPermissionAttribute (SecurityAction.RequestMinimum, Unrestricted = True)>

  3. <EnvironmentPermissionAttribute(SecurityAction.Demand, Unrestricted = True)>

  4. <EnvironmentPermission(SecurityAction.Demand, Unrestricted = True)>

cthe demand method can be used in a method attribute to verify that the method has a particular code access permission. code access security attribute names are of the format permissionattribute, so the first and last answers cannot be correct. requestminimum can be used at the assembly level to require permissions.

4. 

You are designing an XML Web service that requires passing custom authentication information from the client to the server. The service includes a method that returns a small amount of sensitive data to the client and several methods that return a large amount of nonconfidential data. Which approach to encryption might offer the best performance, while preserving the confidentiality of sensitive information?

  1. Use a custom approach, encrypting the custom authentication headers and the bodies of the messages that return sensitive data.

  2. Use a custom approach, encrypting just the authentication headers.

  3. Use SSL, to automatically encrypt all traffic related to the Web service.

  4. No special approach is required. Sensitive data is automatically encrypted when sent as part of a SOAP message.

ayou should use a custom approach in which the authentication-related headers and bodies of the messages containing confidential data would be the most efficient. encrypting just the authentication headers would not preserve the confidentiality of any message data. using ssl to encrypt all components of every message is not the most efficient approach because ssl can be resource intensive, and one of the messages returns a large amount of data that is not considered sensitive. sensitive data is not automatically encrypted when sent as part of a soap message.

5. 

Which of the following authentication types presents the user with a web page requesting his credentials and then evaluates the credentials furnished by the user when the page is submitted?

  1. Basic authentication

  2. HTML authentication

  3. Integrated Windows authentication

  4. Forms authentication

dforms authentication is a .net authentication method presenting the user with a web page requesting credentials, and evaluating those credentials when the page is submitted. basic authentication is a windows authentication method that requests user credentials via a dialog and transmits them across the network to the domain controller in unencrypted form (unless being run over ssl to encrypt it) for validation. integrated windows authentication is another windows authentication method, which is an improvement over basic authentication because it does not send unencrypted credentials across the network when requesting that the domain controller validate them. there is no such thing as html authentication.

6. 

Which of the following best describes .NET Enterprise Services role-based security?

  1. It is no longer used, because it has been superceded by the CLR’s role-based security mechanism.

  2. It requires that users be assigned to Windows groups, to specify the roles to which they belong.

  3. It can be used only when you are using other Enterprise Services such as transactions.

  4. It requires that classes using it inherit from the ServicedComponent class.

d.net enterprise services role-based security requires that classes using it inherit from the servicedcomponent class, as with any class taking advantage of enterprise services such as transactions and message queuing. it does not require that the programmer access any other .net enterprise services in their code. it peacefully coexists with the newer clr role-based security model; each has advantages and disadvantages that make one or the other the best choice in a specific circumstance. unlike the clr role-based security model, .net enterprise services role-based security enables users to be assigned to roles that do not correspond to windows groups.

7. 

Which of the following is not a typical step in the encryption of a data item’s .NET cryptographic functions?

  1. Call the CryptoStream.Write method to perform the data encryption.

  2. Call the CryptoStream.Encrypt method to perform the data encryption.

  3. Use the cryptographic algorithm class’s CreateEncryptor method to create an Encryptor object.

  4. Ensure that all data is processed by the encryption algorithm and sent to the output stream by calling the CryptoStream.FlushFinalBlock method.

bencryption is performed via the cryptostream.write method, not its encrypt method. the first step in encrypting data is usually to create an instance of your selected cryptographic algorithm class. next, use that class s createencryptor method to create an encryptor object. then create a cryptostream object, passing the cryptographic algorithm object and encryptor object as parameters. then call the cryptostream.write method, passing the plaintext, to encrypt it. finally, call the cryptostream.flushfinalblock method to finalize the encryption.

8. 

You are designing a class that uses code access security permissions to verify that the code has permission to perform certain operations, such as calling a small amount of unmanaged code (because that functionality is not available natively in .NET). This class can be called from a wide variety of sources, some more trusted than others, but it must always have permission to call the unmanaged code even if its callers do not have permission to call unmanaged code themselves. How can this be accomplished?

  1. Ensure that all possible calling code acquires the permission to call unmanaged code.

  2. Use the <TrustedClassAttribute> to indicate that permissions granted (or not granted) to methods higher in the call stack should not affect the permissions in effect for this class.

  3. This cannot be done, because code access security permissions are always the intersection of all permissions granted to the current stack frame and all other active method stack frames.

  4. Ensure that this assembly is granted the right to call unmanaged code and then use the CodeAccessPermission.Assert method to indicate to the code access security system that its demands for that right are to succeed regardless of caller permissions.

densure that the assembly is granted the permission to call unmanaged code; then use the codeaccesspermission.assert method to indicate that its demands for that right should succeed, regardless of callers permissions.

9. 

Which of the following tools are used to administer .NET code access security polices?

  1. Microsoft .NET Framework Configuration tool

  2. User Manager for Domains

  3. Component Services tool

  4. secutil.exe

athe microsoft .net framework configuration tool is used to view and update .net code access security policies. user manager for domains is used to manage users and group memberships. the component services tool is used to administer application roles for .net enterprise services role-based security. the command-line utility secutil.exe is used to extract public-key information from an assembly; although this is a .net security function somewhat related to code access security (because it accesses evidence), it is not used to administer code access security policies.

10. 

Which of the following is a feature of .NET that helps guard against buffer overflow vulnerabilities?

  1. Authentication

  2. Cryptographic classes

  3. Code verification

  4. Role-based security

ccode verification ensures assembly integrity and performs runtime checking of data types when assignments are made, to minimize opportunities for buffer overflows to occur. cryptographic classes help ensure data privacy, sender authentication, and data integrity, but do not protect against buffer overflows. authentication is used to verify the identity of the caller; although this helps keep unauthorized users out of your system and thus might reduce opportunities for malicious attacks, it offers no guarantees that an authorized user won t accidentally trigger a buffer overflow. role-based security involves checking the effective identity and the roles to which it belongs, and deciding to run, or not run, code based on the results of that check.

11. 

Which method of the CodeAccessPermission class would you use to specify that the code can access only the specified printer and no others?

  1. RevertDeny

  2. Permit

  3. Subset

  4. PermitOnly

dthe permitonly method is used to indicate the only permissions that are granted to the frame. revertdeny removes any deny requests currently in effect for the frame. permit and subset are not valid methods of the codeaccesspermission class.

12. 

You are developing a serviced component that performs some sensitive database operations. You have assigned some users to a role called DBA, and all users to a role called AllUsers in the Component Services tool. You do not have access to Windows groups administration, and no Windows group by the name of DBA exists. You want to ensure that only users assigned the DBA role can access the component methods that you consider sensitive. How would you implement this protection?

  1. Place the attribute <SecurityRoleAttribute("DBA", False)> on the methods considered sensitive.

  2. Place the attribute <SecurityRole ("DBA", True)> on the methods considered sensitive.

  3. Remove all roles except DBA from the component by using the Component Services tool.

  4. Call Permission.Demand, requesting DBA role membership, at the beginning of each sensitive method call.

aplace the - securityroleattribute(`dba`, false) - attribute on sensitive methods. there is no such attribute as securityrole . if you removed the allusers role from the component, users not assigned to the dba role would not be able to access any features of the component. because the scenario calls for the use of com+ style role-based security, rather than the newer clr-based implementation, you cannot use permission.demand to verify role membership.

13. 

Which of the following statements are true about the Principal object? (Choose all that apply.)

  1. Available principal types include GenericPrincipal, WindowsPrincipal, and CustomPrincipal.

  2. It is contained within an Identity object.

  3. It contains information about the roles for which the user is authorized.

  4. It contains an Identity object.

a, c, d genericprincipal , windowsprincipal , and customprincipal are all valid principal types. a principal object contains information about the roles for which the user is authorized. it also contains an identity object. it is not contained within an identity object.

14. 

What is a hashing algorithm used for?

  1. It provides secure encryption of data.

  2. It generates a statistically unique signature of data.

  3. It decrypts data, when given the proper key string.

  4. It is used to encrypt private keys used in asymmetric cryptography.

ba hashing algorithm is used to generate a statistically unique signature, called a hash value, for a set of data. the signature is normally much smaller in size than the data for which the hash value was computed. it does not encrypt or decrypt data. because a hashing algorithm is not an encryption algorithm, it is not used for the encryption of private keys.

15. 

Which of the following statements are true regarding the effective permissions for an assembly? (Choose all that apply.)

  1. If the assembly asserts permission to access a data file, the access is allowed even if it is disallowed at the Windows operating system level by ACLs that deny access to the file.

  2. If PermitOnly is called twice within a stack frame, the second call to PermitOnly adds to the effective permissions.

  3. They might depend on the origin of the assembly from which the current assembly was called.

  4. If the assembly asserts permission to access a data file, and access is disallowed at the Windows operating system level by ACLs, attempts to access the file in that assembly will not succeed.

b, cif the assembly asserts permission to access a data file, and access to that data file is disallowed at the windows operating system level by acls, attempts to access the file in that assembly will not succeed. effective permissions can be influenced by many types of evidence provided at runtime, including the origin of the assembly s caller. permissions asserted in a visual basic .net program cannot override permissions denied at the windows operating system level. permitonly can be called only once within a stack frame.

Answers

1. 

C Authentication is the process of presenting user-supplied credentials to the system, which evaluates them and assigns an identity based on the information provided. A permission is a specific right held by the application. Authorization is used to verify that an application has been granted permission to perform a specific action. Integration is not a .NET security term.

2. 

A CLR role-based security can use the IsInRole method or demand a specific PrincipalPermission to verify that the current principal is a member of a role. .NET Enterprise Services security uses the InCallerInRole method to check role membership. Code access security is used to check security based on the characteristics and origin of an assembly, not roles. Thread safety security is not a .NET security model.

3. 

C The Demand method can be used in a method attribute to verify that the method has a particular code access permission. Code access security attribute names are of the format PermissionAttribute, so the first and last answers cannot be correct. RequestMinimum can be used at the assembly level to require permissions.

4. 

A You should use a custom approach in which the authentication-related headers and bodies of the messages containing confidential data would be the most efficient. Encrypting just the authentication headers would not preserve the confidentiality of any message data. Using SSL to encrypt all components of every message is not the most efficient approach because SSL can be resource intensive, and one of the messages returns a large amount of data that is not considered sensitive. Sensitive data is not automatically encrypted when sent as part of a SOAP message.

5. 

D Forms authentication is a .NET authentication method presenting the user with a web page requesting credentials, and evaluating those credentials when the page is submitted. Basic authentication is a Windows authentication method that requests user credentials via a dialog and transmits them across the network to the domain controller in unencrypted form (unless being run over SSL to encrypt it) for validation. Integrated Windows authentication is another Windows authentication method, which is an improvement over Basic authentication because it does not send unencrypted credentials across the network when requesting that the domain controller validate them. There is no such thing as HTML authentication.

6. 

D .NET Enterprise Services role-based security requires that classes using it inherit from the ServicedComponent class, as with any class taking advantage of Enterprise Services such as transactions and message queuing. It does not require that the programmer access any other .NET Enterprise Services in their code. It peacefully coexists with the newer CLR role-based security model; each has advantages and disadvantages that make one or the other the best choice in a specific circumstance. Unlike the CLR role-based security model, .NET Enterprise Services role-based security enables users to be assigned to roles that do not correspond to Windows groups.

7. 

B Encryption is performed via the CryptoStream.Write method, not its Encrypt method. The first step in encrypting data is usually to create an instance of your selected cryptographic algorithm class. Next, use that class’s CreateEncryptor method to create an Encryptor object. Then create a CryptoStream object, passing the cryptographic algorithm object and Encryptor object as parameters. Then call the CryptoStream.Write method, passing the plaintext, to encrypt it. Finally, call the CryptoStream.FlushFinalBlock method to finalize the encryption.

8. 

D Ensure that the assembly is granted the permission to call unmanaged code; then use the CodeAccessPermission.Assert method to indicate that its demands for that right should succeed, regardless of callers’ permissions.

9. 

A The Microsoft .NET Framework Configuration tool is used to view and update .NET code access security policies. User Manager for Domains is used to manage users and group memberships. The Component Services tool is used to administer application roles for .NET Enterprise Services role-based security. The command-line utility secutil.exe is used to extract public-key information from an assembly; although this is a .NET security function somewhat related to code access security (because it accesses evidence), it is not used to administer code access security policies.

10. 

C Code verification ensures assembly integrity and performs runtime checking of data types when assignments are made, to minimize opportunities for buffer overflows to occur. Cryptographic classes help ensure data privacy, sender authentication, and data integrity, but do not protect against buffer overflows. Authentication is used to verify the identity of the caller; although this helps keep unauthorized users out of your system and thus might reduce opportunities for malicious attacks, it offers no guarantees that an authorized user won’t accidentally trigger a buffer overflow. Role-based security involves checking the effective identity and the roles to which it belongs, and deciding to run, or not run, code based on the results of that check.

11. 

D The PermitOnly method is used to indicate the only permissions that are granted to the frame. RevertDeny removes any deny requests currently in effect for the frame. Permit and Subset are not valid methods of the CodeAccessPermission class.

12. 

A Place the <SecurityRoleAttribute("DBA", False)> attribute on sensitive methods. There is no such attribute as SecurityRole. If you removed the AllUsers role from the component, users not assigned to the DBA role would not be able to access any features of the component. Because the scenario calls for the use of COM+ style role-based security, rather than the newer CLR-based implementation, you cannot use Permission.Demand to verify role membership.

13. 

A, C, D GenericPrincipal, WindowsPrincipal, and CustomPrincipal are all valid principal types. A Principal object contains information about the roles for which the user is authorized. It also contains an Identity object. It is not contained within an Identity object.

14. 

B A hashing algorithm is used to generate a statistically unique signature, called a hash value, for a set of data. The signature is normally much smaller in size than the data for which the hash value was computed. It does not encrypt or decrypt data. Because a hashing algorithm is not an encryption algorithm, it is not used for the encryption of private keys.

15. 

B, C If the assembly asserts permission to access a data file, and access to that data file is disallowed at the Windows operating system level by ACLs, attempts to access the file in that assembly will not succeed. Effective permissions can be influenced by many types of evidence provided at runtime, including the origin of the assembly’s caller. Permissions asserted in a Visual Basic .NET program cannot override permissions denied at the Windows operating system level. PermitOnly can be called only once within a stack frame.



MCAD/MCSD(c) Visual Basic. NET XML Web Services and Server Components Study Guide
MCAD/MCSD: Visual Basic .NET XML Web Services and Server Components Study Guide
ISBN: 0782141935
EAN: 2147483647
Year: 2005
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net