COM 508 Assignment 3
COM 508 Assignment 3
Assignment-3
First name, Last name, Department & Title are called Attributes of Employee
Entity.
Field: Field refers to a combination of one or more characters.
also termed Column.
The smallest unit of data is accessed by the user.
The name of each field is unique.
Chapter- 6
4Q. Why is it Important to Monitor and Control System Output?
Ans: Consider a system that accepts user input via a web interface, performs
business logic with data in a back-end database, and then displays the output to the
user via the web interface.
Security:
A user may inadvertently or intentionally enter an input that escapes
validation or was not tested for, triggering business rule logic such as "SELECT
* FROM TABLE CUSTOMER." This is not a semantic error, and SQL will
proceed as expected, passing the whole data set of the customer table (id,
password, credit card number, and so on) to the application programming
interface. If no checks are performed on the created output, the APIs will easily
send the data to the front-end web interface, and the hacker will not have access
to a gold mine. As a result, any output must be monitored and regulated.
Preventing data scrape bots and denial-of-service attacks :
Bots automate input, and process output quickly, and when done
correctly, can either completely replicate all of the data in your database or
knock your server down with too many resource requests bombarded too
quickly. To preserve resources and private data, checks and restrictions can be
put in place to only send "X" amount of data to a specific IP address in 24
hours.
Formatting :
It would be helpful to monitor the formatting and display it in a clean
format before dumping the result data on the end user.
9Q. What are the benefits and limitations of using data canaries to prevent
buffer or stack overflow?
Ans: The term "data canary" comes from the canaries used in coal mines. If the air
was potentially poisonous to the miners or contained hazardous substances, The
canary would perish if there was inadequate oxygen. The miners were able to flee
before succumbing due to their observation of the canary. In a computing
environment, the data canary value will "die" before the program overruns.
Observing whether the canary is still alive will indicate whether the system has
been compromised. There are three types of canaries in use: terminator, random,
and random XOR. Stack Guard currently supports all three, while Pro Police
supports terminator and random canaries.
Stack buffer overflow problems arise when an application writes more records to a
stack buffer than is allocated for that buffer. By verifying the canary value, the
execution of the affected program can be terminated, preventing it from
misbehaving or from allowing an attacker to take control of it.
A/B testing: We can do A/B testing with the canary. In other words, we present
two alternatives to users and see which one receives the best response. Capacity
testing: Testing the capacity of a big production environment is impossible.
Capacity tests are built into canary deployments. Any performance issues in our
system will become apparent as we gradually migrate users to the canary. We
receive vital feedback from real users. There will be no cold starts: new systems
may take some time to boot up. Canary deployments gradually gain momentum to
avoid cold-start sluggishness.
Easy rollback: If something goes wrong, we can easily revert to the previous
version.
Using automated protection at the language level is the most reliable technique to
avoid or prevent buffer spills. Another solution is run-time bounds-checking,
which eliminates buffer overrun by automatically checking that data supplied to a
buffer is within permitted boundaries.
7Q. Summarize the security issues involved in code deployment for
interpreted languages. What steps should be taken to protect the raw code?
Ans: Securing the web application is a tough & most important task for a company.
A few interpreted languages are JavaScript, Perl & security issues evolve while
code deployment is lacking compile errors. In other object-oriented & traditional
languages compiler plays a vital & vulnerable code detector task, so it can catch
errors and vulnerabilities. Interpreted languages create mismatch errors in code
deployment that might get a chance of attackers. These are scripting-based
languages that could be a security concern.
Interpreted languages run slower and bring more vulnerability to attack. Another
reason for security issues involved in code deployment for interpreted languages is
buffer overflow (which helps in reducing the number of vulnerabilities. The White
Hat issue & Red Hat issues occur in the code deployment view due to the usage of
JavaScript.
The way to secure the raw code is to make use of available tools. Code scanning
tools (SonarQube) ensure the programmers detect the vulnerabilities that occurred
by unfamiliar & easy drops of language code. Another way is to update the code
snippets/packages to help secure the application. Make sure the Code Review is
done by a superior.
10Q. What are the considerations of security you should include in planning
which programming language to use in software development?
Ans: Security concerns of a Firm include Confidentiality, Integrity of the
information.
It should be taken into action from the beginning of the development and this
includes the selection of appropriate tools, database design, security protocols, and
network protocols. If required provide security training & tasks to ensure the
importance of security to a given application.
The code has to be reviewed by the Lead/Manager before the code push to
the repository.
Developed code needs to be scanned by client-approved/allowed tools in the
company.
Code must be examined by the deployment team to avoid vulnerabilities &
security breaches.
If language is mixed with a database connection string, then make sure the
database queries are technically syntax-based.
The repository code must be Encrypted with a set of layers & ensure two-
level accessibility.
Code Standards & Conventions are important to ensure security to start the
development. Practicing to use the inbuilt security features in frameworks &
tools by default. This helps programmers to work the known classes of
issues, rather than the individual.
Make sure the frameworks/library/component are loosely coupled so that
they could be effectively upgraded if required.
Data binding prevents data from being interpreted as control logic by
binding to specific data types.
1Q. Explain buffer overflow in your own words. List and briefly explain
three strategies to defend against this in your programming.
Ans: Buffers are memory storage regions that hold data temporarily while it is
transferred from one location to another. A buffer overflow (or buffer overrun)
occurs when the volume of data exceeds the memory buffer's storage capacity.
As a result, the software attempting to write data to the buffer overwrites the
memory addresses next to it. Buffer overflows can occur in any type of
software. They are typically caused by malformed inputs or a failure to allocate
enough buffer space. If the transaction overwrites executable code, the program
may behave erratically, producing inaccurate results, memory access issues, or
crashing.
Furthermore, newer operating systems have runtime protection. Three common
safeguards are:
Address space randomization (ASLR)—moves data regions' address space
locations at random. Buffer overflow attacks often require knowledge of the
location of executable code, which is made nearly impossible by randomizing
address spaces. to employ the SEH overwrite exploitation approach An SEH
overwrite is accomplished at the functional level by using a stack-based buffer
overflow to overwrite an exception registration record stored on a thread's
stack.
Data execution prevention—marks specific sections of memory as executable
or non-executable, preventing an attack from running code in a non-executable
zone.
Structured exception handler overwrites protection (SEHOP) aids in the
prevention of malicious code from attacking Structured Exception Handling
(SEH), a built-in method for controlling hardware and software exceptions. . An
SEH overwrite is accomplished at the functional level by employing a stack-
based buffer overflow to overwrite an exception registration record kept on a
thread's stack.