Developer Guidelines
Developer Guidelines
Application Development
Guidelines for Secure Coding
Contents
1. Document Details 2
2. Document Approvers 2
3. Purpose 3
4. Scope 3
5. Definition 3
6. Guidelines 3
7. Procedure 4
7.1. Application Patching
7.2. Use of Environments
Security Vulnerabilities Checklist (Best Practices for Developers) 4-9
Version History
Version Date Section Change by
1.2 Jan 2023 Reworded few sections and minor changes. Ambar Pande
Version 1.0
2. Document Reviewers
With above in context, making developers aware of secure coding practice, becomes of
paramount importance.
Secure coding for Cyber security is a vast topic. This document intends to provide
development teams about major points to be taken care of while developing code.
4. Scope
The scope of this secure coding guideline applies to all developers and testers which are
involved in development/testing, who have or are responsible for the development of any
Program/Application/API/Microservices. Anyone involved in development may follow these
guidelines for improving application security and thus reducing vulnerabilities.
5. Definition
S.No Term Definition
1 ISMS Information Security Management System
2 IT Information Technology
3 MFA Multi Factor Authentication
6. Guidelines
● All the developers / testers may follow Secure Coding standards while
developing / designing any solution / application.
● Practicing secure software design and other phases of software engineering life
cycle for a structured, small, and simple code. In addition, make use of a secure
coding checklist.
● In order to track changes made to the code or document, use
version/configuration control, this enables easy rollback to a previous version in
case of a serious mistake.
7. Procedure
7.1. Application Patching
Regular scanning of vendor-supplied security patches or mitigation of a reported
vulnerability, in accordance with the Vulnerability Management Standard, are critical
components in protecting the integrity of Network, Systems and Applications.
● Pre-Production/Staging/QA
The applications need to be thoroughly verified using different mechanisms i.e
automated tools, manual tools and QA Testing to remove the fail cases. If any
security vulnerabilities still exists, prior permission shall be taken by the
cybersecurity team before deploying it to production.
● Input Validation: User Input is one of the most important entry points for
any application, this gives attackers a pathway to inject various attack
vectors inside the application. Therefore, it is necessary to take care of
how our applications process the user input which is received. Priority
must be given to filter out and sanitize while rendering user-controllable
● Output Encoding
● Conduct all encoding on a trusted system
● Encode all characters unless they are known to be safe for the
intended interpreter
● Sanitization: Input sanitization should always be carried out in
order to block harmful and unwanted characters.
● Session Management
● Session identifier creation must always be done on a trusted
system.
● Set the domain and path for cookies containing authenticated
session identifiers to an appropriately restricted value for the site.
● Generate a new session identifier on any re-authentication.
● JSON Web Token must be implemented by following the standard
guidelines.
● The token secret must be stored in a key management service
and every time the token must be verified to validate the status of
the token.
● Access Control
● Access controls should fail securely.
● Restrict access to protected URLs to only authorized users.
● Restrict access to protected functions to only authorized users.
● Restrict access to services to only authorized users.
● Restrict access to application data to only authorized users.
● Enforce application logic flows to comply with business rules.
● Restrict access to application data to only authorized users.
● Create an Access Control Policy to document application business
rules, types and authorization access criteria.
● Cryptographic Practices
● All cryptographic functions used to protect secrets from the
application user must be implemented on a trusted system.
● Protect master secrets from unauthorized access.
● Make use of the Key Management service to store the important
key files.
● Cryptographic modules should fail securely.
● Establish and utilize a policy and process for how cryptographic
keys will be managed.
● Data Protection
● Implement least privilege, restrict users to only the functionality,
data and system information that is required to perform their tasks.
● Protect all cached or temporary copies of sensitive data stored on
the server from unauthorized access and purge those temporary
working files as soon as they are no longer required.
● Encrypt highly sensitive stored information, like authentication
verification data, even on the server-side. Always use well-vetted
algorithms, see "Cryptographic Practices".
● Protect server-side source code from being downloaded by a
user.
● Do not store passwords, connection strings or other sensitive
information in clear text or in any non cryptographically secure
manner on the client-side.
● Remove comments in user-accessible production code that may
reveal backend systems or other sensitive information.
● Do not include sensitive information in HTTP GET request
parameters.
● The application should support the removal of sensitive data when
that data is no longer required.
● System Configuration
● Turn off directory listings
● Ensure servers, frameworks and system components are running
the latest approved version.
● Ensure servers, frameworks and system components have all
patches issued for the version in use
● Remove all unnecessary functionality and files.
● Restrict the web server, process and service accounts to the least
privileges possible.
● When exceptions occur, fail securely.
● Database Security
● Use strongly typed parameterized queries.
● Utilize input validation and output encoding and be sure to
address meta characters. If these fail, do not run the database
command.
● Ensure that variables are strongly typed
● Use secure credentials for database access
● The application should use the lowest possible level of privilege
when accessing the database.
● Use stored procedures to abstract data access and allow for the
removal of permissions to the base tables in the database.
● Close the connection as soon as possible.
● Remove or change all default database administrative passwords.
Utilize strong passwords/phrases or implement multi-factor
authentication.
● File Management
● Do not pass user supplied data directly to any dynamic include
function.
● Require authentication before allowing a file to be uploaded
● Limit the type of files that can be uploaded to only those types that
are needed for business purposes
● Validate uploaded files are the expected type by checking file
headers. Checking for file type by extension alone is not sufficient
● Do not save files in the same web context as the application. Files
should either go to the content server or in the database.
● Prevent or restrict the uploading of any file that may be interpreted
by the web server.
● Turn off execution privileges on file upload directories
● Do not pass user supplied data into a dynamic redirect. If this
must be allowed, then the redirect should accept only validated,
relative path URLs
● Do not pass directory or file paths, use index values mapped to
pre-defined list of paths
● Never send the absolute file path to the client
● Ensure application files and resources are read-only
● Scan user uploaded files for viruses and malware
● Firebase Misconfigurations
● Properly Configured Firebase: By default, the database settings
for a database are read and write protected, meaning the read
and write access is not allowed. To store real-time data, write
access to the database must be enabled by setting the “write” flag
to “true.” Remember, that read access is still disabled, and the
“read” flag is set to “false,” as shown in the following screenshot.