100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
WGU D385 PRE-ASSESSMENT EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS $16.49   Add to cart

Exam (elaborations)

WGU D385 PRE-ASSESSMENT EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS

 9 views  0 purchase
  • Course
  • WGU D385
  • Institution
  • WGU D385

WGU D385 PRE-ASSESSMENT EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS

Preview 3 out of 19  pages

  • September 8, 2024
  • 19
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • WGU D385
  • WGU D385
avatar-seller
YANCHY
WGU D385 PRE-ASSESSMENT EXAM 2024/2025 WITH
100% ACCURATE SOLUTIONS



What is the primary defense against log injection attacks? - Precise
Answer ✔✔Sanitize outbound log messages


import logging
import sys
import logging
import sys
#log division by zero error to the log, the output is printed to the screen
def divideByZeroError(dividend, divisor):
logging.basicConfig(stream=sys.stdout,format='%(levelname)s:%
(message)s')


try:
quotient = dividend/divisor
print (quotient)


except Exception as e:
#logging error here, use str(e) as part of the output
if __name__ == '__main__':
dividend = int(input())
divisor = int(input())

,divideByZeroError(dividend,divisor) - Precise Answer
✔✔logging.error("The exception that occured is: %s", str(e))


An attacker exploits a cross-site scripting vulnerability. - Precise Answer
✔✔Access the user's data


Which Python function is prone to a potential code injection attack? -
Precise Answer ✔✔eval()


What are two common defensive coding techniques? - Precise Answer
✔✔Check functional and preconditions and postconditions


# unit test case
import unittest
def multiply_numbers(x, y):
#add your code here
return x * y
# add your code here



class TestForNone(unittest.TestCase):


def test_when_a_is_null(self):
try:

, self.assertIsNone(multiply_numbers(5, None))
except AssertionError as msg:
print(msg)
if __name__ == '__main__':
unittest.main() - Precise Answer ✔✔if x is None:
print("x is a null value")
return y
elif y is None:
print("y is a null value")
return x
else:
return x * y


Which package is meant for internal use by Python for regression
testing? - Precise Answer ✔✔test


from string import Template
CONFIG = {
"API_KEY": "'you've just exposed your secret_key'"
}
class User:
name = ""
email = ""

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller YANCHY. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $16.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83637 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$16.49
  • (0)
  Add to cart