TCS Security API Quiz

Test your knowledge of the TCS Security API including methods for preventing XSS, CSRF, SQL injection, path traversal, password hashing, and other security vulnerabilities.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The usage of setRememberToken is

  1. Generally recommended
  2. Generally not recommended
  3. Should always be used
  4. Should not be used at all
Question 2 Multiple Choice (Single Answer)

What are the different levels of logging provided in the API?

  1. Trace, warn, error and fatal
  2. Trace, debug, info, warn, error and fatal
  3. Debug, info, error, fatal
  4. Debug, Warn, Error
Question 3 Multiple Choice (Single Answer)

Which methods in the TCS SAPI can be used to prevent Cross Site Scripting Attacks?

  1. isSafeHTML(java.lang.String context, java.lang.String input, boolean allowNull) and encodeForHTML(java.lang.String input)
  2. isSafeHTML(java.lang.String context, java.lang.String input)
  3. SafeHTML(java.lang.String context, java.lang.String input)
  4. ValidHTML(java.lang.String context, java.lang.String input)
Question 4 Multiple Choice (Single Answer)

What is the base class for all Security related exceptions in the security API?

  1. SecurityException
  2. EnterpriseException
  3. EnterpriseSecurityException
  4. None of the above
Question 5 Multiple Choice (Single Answer)

What is used as the salt value in the hash function available in the TCS SAPI?

  1. A constant value stored as plain text within a configuration file
  2. There is no salt added while calculating the hash value
  3. The accountName is used as the salt value
  4. The salt value is calculated from the password value
Question 6 Multiple Choice (Single Answer)

What is meant by Canonicalization?

  1. Its a form of encoding
  2. Its a form of encryption
  3. Its a form of decryption
  4. Its simply the operation of reducing a possibly encoded string down to its simplest form
Question 7 Multiple Choice (Single Answer)

What is the functionality of the sign() method?

  1. Encrypts the input and returns the encrypted string
  2. Encodes the data
  3. Hashes the data
  4. Create a digital signature for the provided input data and return the signature in a string
Question 8 Multiple Choice (Single Answer)

Which methods in the TCS SAPI can be used to prevent Path Traversal?

  1. isValidDirectory( java.lang.String context, java.lang.String input)
  2. isValidDirectory( java.lang.String context, java.lang.String input) and isValidFileName(java.lang.String context, java.lang.String input)
  3. isSafeDirectoryPath(java.lang.String context, java.lang.String input,boolean allowNull) and isSafeFileName(java.lang.String context, java.lang.String input,boolean allowNull)
  4. ValidateDirectoryPath(java.lang.String context, java.lang.String input,boolean allowNull)
Question 9 Multiple Choice (Single Answer)

What is the method signature for hashing password?

  1. String hashPassword(String password)
  2. String hashPassword(String password, String accountName)
  3. String hashpassword(String password)
  4. None of the above
Question 10 Multiple Choice (Single Answer)

What is the return type of the verifyPasswordStrength() method in the security API?

  1. Boolean
  2. String
  3. Integer
  4. void
Question 11 Multiple Choice (Single Answer)

What is the return type of the isAuthorizedForData() method in the security API?

  1. String
  2. boolean
  3. Integer
  4. void
Question 12 Multiple Choice (Single Answer)

What is the return type of the getCSRFToken() method?

  1. Integer
  2. Byte
  3. String
  4. BigInteger
Question 13 Multiple Choice (Single Answer)

What kind of exception does the method login(HttpServletRequest request, HttpServletResponse response) throw?

  1. LoginException
  2. EnterpriseSecurityException
  3. SecurityException
  4. IntrusionException
Question 14 Multiple Choice (Single Answer)

Which are the default scripting codecs supported by the security API

  1. JavaScript
  2. VBScript
  3. Both of the above
  4. None of the above
Question 15 Multiple Choice (Single Answer)

Which are the default codecs supported to help encode characters to be safely used on OS command shells

  1. Unix Codec
  2. Windows Codec
  3. Unix and Windows Codec
  4. Linux Codec
Question 16 Multiple Choice (Single Answer)

The security API supports codecs for SQL Strings of which of the following databases ?

  1. Oracle
  2. MySQL
  3. Both of the above
  4. Oracle, MySQL, Sybase, DB2
Question 17 Multiple Choice (Single Answer)

What is the functionality of the seal() method ?

  1. Creates a seal that binds a set of data and includes an expiration timestamp
  2. Encodes the data
  3. Hashes the data
  4. Scrambles the data
Question 18 Multiple Choice (Single Answer)

What method is provided within the security API to prevent caching by browsers and proxies?

  1. void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response)
  2. void setNoCacheHeaders(javax.servlet.http.HttpServletRequest request)
  3. boolean setNoCacheHeader(javax.servlet.http.HttpServletResponse response)
  4. void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
Question 19 Multiple Choice (Single Answer)

Which method among the below could be used as a defense against Cross Site Request Forgery?

  1. encryptHiddenField(java.lang.String value)
  2. addCSRFToken(final java.lang.String href)
  3. verifySecureComm(javax.servlet.http.HttpServletRequest request)
  4. setSafeContentType(javax.servlet.http.HttpServletResponse response)
Question 20 Multiple Choice (Single Answer)

Which set of security API methods could be used as the best defense against Cross Site Scripting?

  1. Input Validation and OutPut Encoding
  2. Authentication and Authorization
  3. Data Protection and Cryptography
  4. HTTP and Communication Security