A business launches a new customer portal. Clients can sign in, upload documents, review invoices, and follow the progress of their work. The interface looks professional, the application performs well, and the development team has tested the main workflows. From the outside, everything appears ready.
Then someone notices something unusual. Changing a record identifier in an API request returns information belonging to another customer. The user is properly signed in, but the application has not verified whether that particular record belongs to them. No password was stolen. No sophisticated exploit was required. The system simply trusted an authenticated request more than it should have.
This is the kind of weakness that illustrates why application security cannot be treated as a final checklist before deployment. Security depends on decisions made much earlier: how users are represented, where permissions are enforced, how data is separated, which services can communicate, and what the application assumes about the information it receives.
Security by design means addressing those questions as part of the architecture and development process. It does not promise that software will never contain vulnerabilities. It creates a disciplined approach for reducing avoidable weaknesses, limiting the consequences of failures, and making security controls easier to maintain as the application evolves.
What Security by Design Means in Practice
Security by design is often discussed as a principle, but its practical meaning is straightforward: important security decisions should be made before the application depends on assumptions that are difficult to change.
For example, an application intended to serve multiple businesses should establish its customer and organization boundaries before developers begin creating hundreds of database queries. A platform that handles financial documents should define access permissions before implementing file sharing. A service that connects to external providers should establish how credentials are stored and restricted before those integrations are deployed.
The alternative is to add security controls around an architecture that was never designed to support them. That approach often produces scattered permission checks, inconsistent behavior, and exceptions that become increasingly difficult to understand.
- Identify sensitive information and critical business operations during requirements analysis.
- Define trust boundaries between users, organizations, applications, and external services.
- Establish authentication and authorization responsibilities before implementing protected workflows.
- Minimize the information and privileges available to each component.
- Design logging, monitoring, and recovery capabilities alongside normal application behavior.
- Review security assumptions whenever new features or integrations are introduced.
Authentication and Authorization Are Different Problems
Authentication answers a specific question: who is making this request? A user may prove their identity through a password, passkey, or another supported authentication method. Once that process succeeds, the application can associate the request with an authenticated identity.
Authorization answers a different question: what is that identity allowed to do? A customer may be permitted to view their own invoices but not those of another customer. An employee may manage assigned projects without having access to financial administration. An administrator may have broader operational permissions while still being restricted from certain security-sensitive actions.
Confusing these two responsibilities is a common source of application vulnerabilities. A valid session does not automatically authorize access to every resource. Likewise, knowing a document identifier or API endpoint does not establish permission to use it.
Broken Access Control: A Risk That Often Looks Like Normal Application Behavior
Broken access control occurs when an application allows someone to perform an operation or retrieve information beyond their intended permissions. It is particularly dangerous because the request may look entirely legitimate. The user is authenticated, the endpoint exists, and the database returns a valid record.
Consider a document endpoint that accepts a file identifier. The frontend displays only documents associated with the current customer, but the backend retrieves files using the identifier alone. If another identifier is supplied, the backend may return a document belonging to someone else.
The correct solution is not simply to hide identifiers or make them difficult to guess. The backend must verify that the authenticated user has permission to access the requested file. That check should account for the document's organization, ownership, sharing rules, and any other relevant restrictions.
This class of weakness is closely related to Broken Object Level Authorization, commonly abbreviated BOLA, in API security discussions. It is one reason the OWASP API Security Top 10 emphasizes authorization at the object level.
- Apply authorization checks on the server rather than relying on frontend visibility.
- Verify access to individual records, not only to application routes.
- Include organization or tenant boundaries in protected data operations.
- Review create, read, update, delete, export, and download permissions separately.
- Test whether one authorized user can access another user's resources.
- Ensure administrative privileges are explicitly granted and appropriately scoped.
Protecting Data in Multi-Tenant Applications
Many modern software platforms serve multiple organizations from shared infrastructure. A project management system might support several construction companies. An accounting portal may serve numerous independent clients. A business platform may host separate workspaces, each with its own users, records, integrations, and billing arrangements.
This architecture is commonly called multi-tenancy. It can simplify deployment and infrastructure management, but it introduces an important security requirement: data belonging to one tenant must not become accessible to another without an explicitly authorized sharing relationship.
A tenant identifier in a database table is useful, but it does not provide isolation by itself. The application must consistently enforce tenant boundaries throughout its services, database queries, background jobs, file storage, search indexes, and integrations.
The risk becomes greater when developers assume that every request carries a trustworthy workspace identifier. If the backend accepts that identifier without verifying the user's membership or permissions, the application may expose records across organizational boundaries.
- Derive authorized tenant context from verified identity and membership information.
- Enforce tenant restrictions in data access and business operations.
- Scope file storage, background processing, and integration credentials appropriately.
- Prevent shared caches from returning information across tenant boundaries.
- Test tenant isolation using separate users, organizations, and permission levels.
- Audit privileged cross-tenant operations and explicitly authorized sharing.
Designing Permissions That Reflect How a Business Actually Works
Role-based access control, or RBAC, assigns permissions according to defined roles. A business application might distinguish customers, employees, managers, and administrators. This is a useful starting point because it provides a consistent way to describe responsibilities.
However, real business permissions are often more specific than a role name. Two employees may share the same role but work on different projects. A client may have access to one organization but not another. A manager may approve certain expenses while larger transactions require additional authorization.
For these cases, role-based permissions may need to be combined with resource relationships, ownership rules, or contextual conditions. The objective is to express the actual business policy clearly rather than adding special cases throughout the codebase.
Permission design should also account for changes over time. Employees leave, clients change representatives, projects close, and organizations reorganize. Access that was appropriate six months ago may no longer be justified.
Secure API Design Starts at the Service Boundary
An API is a controlled entry point into application functionality. It may expose customer records, financial operations, documents, or administrative actions. Protecting the endpoint requires more than checking whether a token is present.
The service should validate the caller's identity, determine the permissions associated with that identity, validate the requested operation, and limit the information returned. Input validation and authorization serve different purposes: valid input can still describe an unauthorized operation.
API responses also deserve attention. Returning an entire database object may expose internal fields that the requesting application does not need. Explicit response contracts help reduce accidental disclosure and make interfaces easier to maintain.
- Use authenticated service interfaces for protected operations.
- Validate request structure, types, limits, and business constraints.
- Apply authorization before accessing or modifying sensitive resources.
- Return only the fields required by the requesting application.
- Protect sensitive operations against excessive requests and abuse.
- Avoid exposing credentials, stack traces, or internal implementation details in public responses.
- Maintain clear API contracts and review changes for security impact.
Sessions, Cookies, and the Risk of Account Compromise
A secure login page is only one part of session security. After authentication, the application must maintain a reliable association between requests and the authenticated identity. If session credentials are exposed, reused improperly, or not invalidated when necessary, an attacker may be able to act as the legitimate user.
For browser-based applications, cookie attributes such as Secure, HttpOnly, and SameSite can help reduce specific risks when configured appropriately. Session expiration, revocation, and reauthentication for sensitive actions also matter. The correct design depends on the application's authentication model and threat environment.
Cross-site scripting and cross-site request forgery are separate concerns that must be addressed through appropriate output handling, browser protections, request validation, and session design. No single cookie attribute or HTTP header eliminates every risk.
Securing Customer Documents and File Uploads
Customer portals frequently handle documents that are more sensitive than the information displayed on public websites. Contracts, invoices, identification documents, financial records, project files, and correspondence may all pass through the same application.
A file upload feature introduces several responsibilities. The application must determine who can upload files, which record they belong to, who may retrieve them, and how long they should remain available. It must also consider file type validation, size limits, malicious content, storage security, and safe preview behavior.
One common mistake is assuming that a file becomes private simply because its download link is not shown publicly. If the storage location is accessible without authorization, the interface provides little protection. File access must be controlled at the delivery boundary, whether files are served through an application endpoint or a properly restricted storage service.
- Associate each uploaded file with an authorized owner, organization, or business record.
- Validate file types and enforce reasonable size limits.
- Apply malware scanning or other content inspection where the risk warrants it.
- Use private storage and controlled download or preview mechanisms.
- Protect against unsafe filenames, path traversal, and executable content.
- Define retention, deletion, and access revocation requirements.
- Record sensitive document access when auditability is required.
Encryption Protects Data, but It Does Not Replace Access Control
Encryption is essential for protecting sensitive information, particularly when data travels between systems or is stored in environments where unauthorized access is a concern. HTTPS protects communications in transit when correctly implemented. Encryption at rest can reduce exposure in certain storage-related threat scenarios.
However, encrypted storage does not prevent an authenticated application from returning the wrong customer's data. If the backend is authorized to decrypt a document but fails to verify who requested it, the information may still be disclosed.
Security controls work together. Encryption, authentication, authorization, audit logging, backups, and operational monitoring address different risks. Treating one of them as a complete solution creates gaps that may remain unnoticed until an incident occurs.
Third-Party Integrations Expand the Security Boundary
Business applications rarely operate in isolation. They connect to payment processors, accounting platforms, email services, cloud storage, analytics providers, and external APIs. Each connection introduces credentials, permissions, data flows, and operational dependencies that need to be understood.
An integration should receive only the permissions necessary for its purpose. A service that reads invoice summaries should not automatically receive permission to modify financial records. Credentials belonging to one organization should not be reused for another organization merely because both use the same integration provider.
Webhook endpoints require their own security considerations. When an external provider sends an event, the receiving application should verify its authenticity using the mechanism supported by that provider. Processing an unverified notification as a trusted business event can create opportunities for fraudulent updates or unauthorized actions.
- Review the permissions requested by external integrations.
- Store credentials securely and support rotation or revocation.
- Separate integration credentials according to the appropriate organizational boundaries.
- Verify webhook authenticity before processing sensitive events.
- Monitor unusual integration activity and repeated failures.
- Review provider dependencies and data handling requirements.
Security Belongs Throughout the Software Development Lifecycle
Security testing is important, but testing alone cannot compensate for unclear architecture. A more reliable approach incorporates security considerations into planning, design, implementation, review, deployment, and maintenance.
During planning, teams identify sensitive data and critical operations. During design, they examine trust boundaries and likely abuse scenarios. During implementation, they use secure coding practices and established libraries. Before release, they test authorization, input handling, configuration, and relevant failure conditions.
After deployment, the work continues. Dependencies require updates, credentials may need rotation, infrastructure configurations change, and new features introduce new paths through the application. Security is an ongoing engineering responsibility rather than a milestone that can be permanently completed.
- Requirements: identify sensitive data, regulatory considerations, and security objectives.
- Architecture: review trust boundaries, access models, and potential abuse scenarios.
- Development: apply secure coding practices and review security-sensitive changes.
- Testing: verify authorization, validation, session behavior, and error handling.
- Deployment: review secrets, environment configuration, transport security, and infrastructure permissions.
- Operations: monitor relevant events, maintain dependencies, and respond to discovered vulnerabilities.
Using OWASP Guidance Without Turning Security Into a Checklist
The Open Worldwide Application Security Project, commonly known as OWASP, publishes widely used guidance for identifying and addressing software security risks. Resources such as the OWASP Top 10, API Security Top 10, and Application Security Verification Standard help development teams organize their security work.
These resources are valuable because they describe recurring classes of weaknesses and provide a common language for discussing them. They are not substitutes for understanding the specific application. A customer portal, an internal reporting system, and a public marketing website have different assets, users, and exposure.
A practical security review combines recognized guidance with the application's actual architecture and business requirements. The objective is to determine which controls are necessary, where they should be enforced, and how their effectiveness can be verified.
Customer Data Protection Considerations for Canadian Businesses
Organizations operating in Canada should consider privacy obligations alongside technical security controls. Depending on the organization, its activities, and the jurisdictions involved, federal or provincial privacy requirements may apply to the collection, use, disclosure, retention, and safeguarding of personal information.
The Personal Information Protection and Electronic Documents Act, or PIPEDA, is one important federal framework for private-sector commercial activities within its scope. Provincial legislation may also apply, and organizations operating across jurisdictions should determine which requirements govern their particular activities.
From an engineering perspective, privacy requirements influence practical design decisions. Applications should avoid collecting unnecessary personal information, restrict access according to legitimate business needs, define appropriate retention periods, and support the organization's obligations concerning access, correction, and incident response.
Technical measures do not automatically establish legal compliance. Privacy and regulatory obligations should be evaluated according to the organization's actual operations, with qualified legal guidance where appropriate.
The Cost of Security Decisions Made Too Late
Security improvements are generally easier to implement when the underlying architecture already supports them. Adding a permission rule to a well-defined authorization layer is different from discovering that hundreds of database queries bypass any consistent access model.
Late security changes can require database restructuring, API redesign, changes to authentication flows, migration of stored documents, or modifications to third-party integrations. They can also disrupt normal business operations if the application has already accumulated users and data.
This does not mean every possible control should be implemented before the first release. Security investment should be proportionate to the information handled, the operations performed, the likely threats, and the consequences of failure. A risk-based approach helps teams prioritize meaningful protections without introducing unnecessary complexity.
Questions to Ask Before Launching a Customer-Facing Application
Before launching a customer portal or business application, organizations should be able to answer a few important questions about how information is protected. These questions are useful not only for developers, but also for business owners evaluating a new software platform or commissioning custom development.
- Can one customer retrieve another customer's records by changing a request parameter or identifier?
- Are permissions enforced consistently across APIs, background operations, and file access?
- Can administrators and employees access only the information required by their responsibilities?
- What happens to active sessions and credentials when an employee leaves the organization?
- Are sensitive documents stored privately and delivered through authorized access mechanisms?
- Can external integrations access information outside their intended scope?
- Are important administrative and financial operations auditable?
- How are vulnerabilities, security updates, and incidents handled after deployment?
- Does the organization know what personal information it collects and why it retains that information?
- Have authorization failures and cross-organization access scenarios been tested before release?
A system does not become secure simply because every question has a written answer. The answers need to correspond to controls that are actually implemented, tested, and maintained. That distinction separates a security policy from an operational security practice.
Secure Applications Are Built on Clear Responsibilities
The strongest application security decisions are often invisible to the end user. A customer opens a document and sees only what they are entitled to see. An employee completes a task without receiving unnecessary administrative privileges. A payment integration processes an authorized event without exposing credentials or unrelated customer records.
Behind those ordinary interactions are deliberate engineering choices: clear ownership boundaries, consistent authorization, controlled data access, secure integration interfaces, and operational processes that account for failure and change.
Security by design is ultimately about making those choices early enough that they become part of how the software works, rather than restrictions added around it later.
At DELQOM, we approach application security as part of software architecture and engineering. Whether the project involves a customer portal, a business platform, or an integration with existing systems, the objective is to build software that supports real operational requirements while protecting the information entrusted to it.