<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kanesharaja Amillthan on Medium]]></title>
        <description><![CDATA[Stories by Kanesharaja Amillthan on Medium]]></description>
        <link>https://medium.com/@amillthanwork?source=rss-ec371b7ea875------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mKPYpL0t0KnZSnYt</url>
            <title>Stories by Kanesharaja Amillthan on Medium</title>
            <link>https://medium.com/@amillthanwork?source=rss-ec371b7ea875------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:19:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amillthanwork/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Secured a React + Spring Boot Application Against the OWASP Top 10]]></title>
            <link>https://medium.com/@amillthanwork/how-i-secured-a-react-spring-boot-application-against-the-owasp-top-10-afe7db01575a?source=rss-ec371b7ea875------2</link>
            <guid isPermaLink="false">https://medium.com/p/afe7db01575a</guid>
            <dc:creator><![CDATA[Kanesharaja Amillthan]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 15:01:03 GMT</pubDate>
            <atom:updated>2026-08-30T15:03:33.134Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical deep dive into OIDC, PKCE, JWT validation, authorization, BOLA prevention, rate limiting, secure headers, and security monitoring.</em></p><p>Building a web application that works is one challenge.</p><p>Building one that can withstand malicious users, manipulated requests, unauthorized access attempts, and common web attacks is a completely different challenge.</p><p>For my <strong>Secure Exhibition Stall Reservation Web Application</strong>, I wanted security to be part of the architecture from the beginning rather than something added at the end.</p><p>The application was designed for an exhibition environment such as the <strong>Colombo International Book Fair 2026</strong>, where multiple vendors and organizers may interact with the system simultaneously.</p><p>The technology stack is:</p><ul><li><strong>React + Vite</strong> — Frontend</li><li><strong>Spring Boot</strong> — Backend REST API</li><li><strong>Spring Security</strong> — Authentication and authorization</li><li><strong>Asgardeo</strong> — OpenID Connect identity provider</li><li><strong>JWT</strong> — API authentication</li><li><strong>MySQL</strong> — Database</li><li><strong>JPA / Hibernate</strong> — Data access</li></ul><p>In this article, I’ll explain the main security decisions I made and how they address important risks from the <strong>OWASP Top 10 (2021)</strong>.</p><h3>1. The Security Architecture</h3><p>The first principle I followed was:</p><blockquote><strong><em>Never trust the frontend.</em></strong></blockquote><p>The React application is responsible for displaying the UI and interacting with the user. However, it is not a security boundary.</p><p>A malicious user can modify JavaScript, change API requests, modify request bodies, or directly call backend endpoints using tools such as Postman or curl.</p><p>Therefore, all important security decisions are enforced by the Spring Boot backend.</p><p>The architecture looks like this:</p><pre>┌─────────────────────────────────┐<br>│         React + Vite SPA        │<br>│                                 │<br>│         Browser Client          │<br>└───────────────┬─────────────────┘<br>                │<br>                │ OIDC Authorization<br>                │ Code Flow + PKCE<br>                ▼<br>┌─────────────────────────────────┐<br>│          Asgardeo IdP           │<br>│                                 │<br>│       User Authentication       │<br>│       Access Token / JWT        │<br>└───────────────┬─────────────────┘<br>                │<br>                │ Authorization:<br>                │ Bearer &lt;JWT&gt;<br>                ▼<br>┌─────────────────────────────────┐<br>│        Spring Boot API          │<br>│                                 │<br>│  ┌───────────────────────────┐  │<br>│  │ JWT Authentication        │  │<br>│  │ Authorization             │  │<br>│  │ Rate Limiting             │  │<br>│  │ DTO Validation             │  │<br>│  │ Security Headers           │  │<br>│  │ Exception Handling         │  │<br>│  │ Audit Logging              │  │<br>│  └───────────────────────────┘  │<br>└───────────────┬─────────────────┘<br>                │<br>                │ JPA / Hibernate<br>                ▼<br>┌─────────────────────────────────┐<br>│          MySQL Database         │<br>└─────────────────────────────────┘</pre><p>This creates multiple security layers instead of relying on a single mechanism.</p><h3>2. Moving from Local Login to OIDC</h3><p>One of the biggest security improvements was moving away from custom username/password authentication.</p><p>A traditional authentication system requires the application to manage:</p><ul><li>Password hashing</li><li>Password storage</li><li>Password reset</li><li>Account recovery</li><li>Brute-force protection</li><li>Credential stuffing</li><li>Session management</li><li>Multi-factor authentication</li><li>Authentication auditing</li></ul><p>Instead of implementing all of this ourselves, I used <strong>OpenID Connect (OIDC)</strong> with Asgardeo.</p><p>The application uses the:</p><p><strong>Authorization Code Flow with PKCE</strong></p><p>PKCE stands for <strong>Proof Key for Code Exchange</strong>.</p><p>It is especially useful for public clients such as browser-based applications.</p><p>The simplified authentication process is:</p><pre>User<br> │<br> ▼<br>React Application<br> │<br> │ Authorization Request<br> │<br> ▼<br>Asgardeo<br> │<br> │ User Authentication<br> │<br> ▼<br>Authorization Code<br> │<br> ▼<br>React Application<br> │<br> │ Code + PKCE Verifier<br> ▼<br>Token Endpoint<br> │<br> ▼<br>Access Token<br> │<br> ▼<br>Spring Boot API</pre><p>The important part is that an intercepted authorization code cannot simply be exchanged for tokens without the corresponding PKCE verifier.</p><h3>3. Validating JWTs on the Backend</h3><p>After authentication, the frontend receives an access token and sends it to the Spring Boot API.</p><p>The request contains:</p><pre>Authorization: Bearer &lt;access-token&gt;</pre><p>The backend then validates the token.</p><p>The security process is conceptually:</p><pre>Incoming Request<br>       │<br>       ▼<br>Bearer JWT<br>       │<br>       ▼<br>Spring Security<br>       │<br>       ├── Signature validation<br>       ├── Issuer validation<br>       ├── Expiration validation<br>       └── Claim validation<br>       │<br>       ▼<br>Authenticated User</pre><p>The backend uses the identity provider’s issuer configuration:</p><pre>spring.security.oauth2.resourceserver.jwt.issuer-uri=https://api.asgardeo.io/t/{org}/oauth2/token</pre><p>The key principle here is:</p><blockquote><strong><em>The backend must validate the token. The frontend cannot declare itself authenticated.</em></strong></blockquote><p>Even if someone modifies the React application, they still cannot bypass JWT validation on the API.</p><h3>4. Keeping Access Tokens Out of localStorage</h3><p>Another security decision was how to store the access token in the browser.</p><p>A common implementation is:</p><pre>localStorage.setItem(&quot;token&quot;, token);</pre><p>This is convenient, but browser-accessible storage can become a target if an attacker manages to execute malicious JavaScript through an XSS vulnerability.</p><p>For this application, authentication uses:</p><ul><li>react-oidc-context</li><li>oidc-client-ts</li><li>In-memory token state</li></ul><p>The Axios instance maintains the current authentication token in memory:</p><pre>let currentAuthToken = null;</pre><pre>export const setAuthToken = (token) =&gt; {<br>    currentAuthToken = token;<br>};</pre><pre>AxiosInstance.interceptors.request.use((config) =&gt; {</pre><pre>    if (currentAuthToken) {<br>        config.headers.Authorization =<br>            `Bearer ${currentAuthToken}`;<br>    }</pre><pre>    return config;<br>});</pre><p>The token is then automatically attached to API requests.</p><p>This also allowed the application to remove the older custom authentication endpoint:</p><pre>/api/auth/login</pre><p>and eliminate unnecessary local credential-handling logic.</p><p>Of course, keeping tokens out of persistent browser storage does not magically eliminate XSS risk. A successful XSS attack can still interact with an application’s in-memory state while the page is running.</p><p>That is why token handling must be combined with strong XSS defenses and a restrictive Content Security Policy.</p><h3>5. Just-In-Time User Provisioning</h3><p>Authentication through an identity provider does not automatically create the application’s local user record.</p><p>The application therefore uses <strong>Just-In-Time (JIT) provisioning</strong>.</p><p>When a valid JWT reaches the backend, the application extracts the trusted identity from the token.</p><p>The sub claim is particularly important because it identifies the authenticated identity.</p><p>The process looks like this:</p><pre>JWT<br> │<br> ▼<br>Extract &quot;sub&quot;<br> │<br> ▼<br>Search UserProfile<br> │<br> ├── User exists<br> │      │<br> │      ▼<br> │   Synchronize trusted claims<br> │<br> └── User doesn&#39;t exist<br>        │<br>        ▼<br>     Create profile</pre><p>For example:</p><pre>@Override<br>@Transactional<br>public UserProfile getOrCreateProfile(Jwt jwt) {</pre><pre>    String sub = jwt.getSubject();</pre><pre>    if (sub == null || sub.isBlank()) {<br>        throw new IllegalArgumentException(<br>            &quot;JWT subject (sub) claim is missing&quot;<br>        );<br>    }</pre><pre>    String email =<br>        trimClaim(jwt.getClaimAsString(&quot;email&quot;));</pre><pre>    String name =<br>        trimClaim(jwt.getClaimAsString(&quot;name&quot;));</pre><pre>    String resolvedRole = &quot;Vendor&quot;;</pre><pre>    List&lt;String&gt; groups =<br>        jwt.getClaimAsStringList(&quot;groups&quot;);</pre><pre>    if (groups != null) {</pre><pre>        for (String g : groups) {</pre><pre>            String normalized =<br>                g.trim().toLowerCase();</pre><pre>            if (normalized.equals(&quot;organizer&quot;)<br>                    || normalized.equals(&quot;admin&quot;)) {</pre><pre>                resolvedRole = &quot;Organizer&quot;;<br>                break;<br>            }<br>        }<br>    }</pre><pre>    // Provision or update UserProfile<br>    ...<br>}</pre><p>The important security principle is that the client does not get to decide its own role.</p><p>For example, the frontend should not be able to send:</p><pre>{<br>  &quot;name&quot;: &quot;John&quot;,<br>  &quot;role&quot;: &quot;Organizer&quot;<br>}</pre><p>and become an organizer.</p><p>The role is derived from trusted identity information and backend authorization rules.</p><h3>6. OWASP A01 — Broken Access Control</h3><p>Broken Access Control is particularly dangerous in a reservation system.</p><p>Imagine a vendor owns:</p><pre>GET /api/reservations/15</pre><p>They are authenticated.</p><p>But authentication does not mean they should be able to access:</p><pre>GET /api/reservations/16</pre><p>if reservation 16 belongs to another vendor.</p><p>This is a classic <strong>BOLA (Broken Object Level Authorization)</strong> scenario.</p><p>The application therefore performs authorization at the resource level.</p><pre>private void verifyOwnershipOrAdmin(<br>        Reservation reservation,<br>        UserProfile userProfile) {</pre><pre>    boolean isOrganizer =<br>        userProfile.getRole()<br>            .equalsIgnoreCase(&quot;Organizer&quot;);</pre><pre>    boolean isOwner =<br>        reservation.getVendorUserProfile()<br>            .getId()<br>            .equals(userProfile.getId());</pre><pre>    if (!isOrganizer &amp;&amp; !isOwner) {</pre><pre>        auditLogService.logAccessDenied(<br>            userProfile.getIdentityProviderUserId(),<br>            &quot;RESERVATION&quot;,<br>            reservation.getId().toString()<br>        );</pre><pre>        throw new AccessDeniedException(<br>            &quot;Access denied: You do not have permission &quot; +<br>            &quot;to access this resource.&quot;<br>        );<br>    }<br>}</pre><p>The authorization model is:</p><pre>Organizer<br>   │<br>   └── Can access authorized reservations</pre><pre>Vendor<br>   │<br>   └── Can access own reservations</pre><pre>Vendor<br>   │<br>   └── Cannot access another vendor&#39;s reservations</pre><p>This check must happen on the backend.</p><p>A frontend route such as:</p><pre>/admin/reservations</pre><p>is not a security mechanism.</p><p>A user can simply bypass the frontend and call the API directly.</p><h3>7. Method-Level Authorization</h3><p>Object-level authorization can be combined with Spring Security’s method-level security.</p><p>For example:</p><pre>@PreAuthorize(&quot;hasRole(&#39;ORGANIZER&#39;)&quot;)</pre><p>This prevents unauthorized roles from entering protected controller methods.</p><p>The complete authorization model becomes:</p><pre>JWT Authentication<br>        ↓<br>Role Authorization<br>        ↓<br>Object Ownership Check<br>        ↓<br>Business Rules<br>        ↓<br>Database</pre><p>This layered approach provides stronger protection than relying on a single authorization check.</p><h3>8. OWASP A03 — Injection</h3><p>Injection occurs when untrusted input is interpreted as code or a query.</p><p>One of the major concerns for a database-backed application is SQL injection.</p><p>Instead of constructing SQL statements through string concatenation:</p><pre>String sql =<br>    &quot;SELECT * FROM reservations WHERE id = &quot; + id;</pre><p>the application uses Spring Data JPA and Hibernate.</p><p>These frameworks support parameterized database access and help prevent user input from being interpreted as SQL syntax.</p><p>The application also validates incoming request data.</p><p>For example:</p><pre>@NotBlank(message = &quot;Stall type is required.&quot;)<br>@Pattern(<br>    regexp = &quot;Standard|Premium|Corner Stall&quot;,<br>    message =<br>        &quot;Stall type must be &#39;Standard&#39;, &#39;Premium&#39;, or &#39;Corner Stall&#39;.&quot;<br>)<br>private String stallType;</pre><p>Instead of accepting arbitrary stall types, the API explicitly defines the allowed values.</p><h3>9. Protecting Against XSS</h3><p>SQL injection is not the only injection problem.</p><p>Cross-Site Scripting, or <strong>XSS</strong>, occurs when attacker-controlled content is interpreted as executable browser code.</p><p>The application uses several layers of defense:</p><ul><li>React’s default output escaping</li><li>Input validation</li><li>Avoiding unsafe HTML injection</li><li>Careful handling of dangerouslySetInnerHTML</li><li>Content Security Policy</li><li>Secure HTTP headers</li></ul><p>For example, the application uses a CSP similar to:</p><pre>default-src &#39;self&#39;;<br>script-src &#39;self&#39;;<br>frame-ancestors &#39;none&#39;;</pre><p>The goal is to limit where executable resources can come from and reduce the impact of injected scripts.</p><p>CSP should not be treated as a replacement for secure coding. It is an additional layer of defense.</p><h3>10. OWASP A04 — Insecure Design</h3><p>A common API design mistake is accepting an entire database entity as a request body.</p><p>For example:</p><pre>{<br>  &quot;name&quot;: &quot;John&quot;,<br>  &quot;organizationName&quot;: &quot;ABC&quot;,<br>  &quot;role&quot;: &quot;Organizer&quot;<br>}</pre><p>If the server automatically maps every field into the database entity, users may be able to modify properties they should never control.</p><p>This is where <strong>DTOs (Data Transfer Objects)</strong> become important.</p><p>For example:</p><pre>public class UserProfileUpdateRequest {</pre><pre>    @NotBlank(message = &quot;Name is required.&quot;)<br>    @Size(max = 100)<br>    private String name;</pre><pre>    @Size(max = 50)<br>    @Pattern(regexp = &quot;^[+\\d\\s\\-()]*$&quot;)<br>    private String contactNumber;</pre><pre>    @Size(max = 100)<br>    private String organizationName;<br>}</pre><p>Notice that sensitive fields such as:</p><pre>role<br>userId<br>identityProviderUserId<br>permissions</pre><p>are not included.</p><p>The client cannot update something that the API does not expose as a writable field.</p><p>This leads to a simple API security principle:</p><blockquote><strong><em>Only expose fields that the client is actually allowed to modify.</em></strong></blockquote><h3>11. Rate Limiting</h3><p>Public APIs must also defend against excessive requests.</p><p>Without rate limiting, attackers could repeatedly send requests to expensive endpoints and potentially degrade application performance.</p><p>For example:</p><pre>Client<br>   │<br>   ├── Request 1<br>   ├── Request 2<br>   ├── Request 3<br>   ├── ...<br>   └── Request 101<br>            │<br>            ▼<br>      429 Too Many Requests</pre><p>The application implements a rate-limiting filter.</p><p>One challenge is determining the real client IP address.</p><p>A common approach is to read:</p><pre>X-Forwarded-For</pre><p>But blindly trusting this header creates another vulnerability.</p><p>An attacker could send:</p><pre>X-Forwarded-For: 1.2.3.4</pre><p>and change the value repeatedly.</p><p>The application therefore trusts the forwarded IP only when the request originates from a configured trusted proxy.</p><pre>private String getClientIp(<br>        HttpServletRequest request) {</pre><pre>    String remoteAddr =<br>        request.getRemoteAddr();</pre><pre>    if (trustedProxyIp != null<br>            &amp;&amp; !trustedProxyIp.isBlank()<br>            &amp;&amp; trustedProxyIp.equals(remoteAddr)) {</pre><pre>        String forwardedFor =<br>            request.getHeader(&quot;X-Forwarded-For&quot;);</pre><pre>        if (forwardedFor != null<br>                &amp;&amp; !forwardedFor.isBlank()) {</pre><pre>            return forwardedFor<br>                .split(&quot;,&quot;)[0]<br>                .trim();<br>        }<br>    }</pre><pre>    return remoteAddr;<br>}</pre><p>If the request is not coming from a trusted proxy, the application falls back to the socket address.12. OWASP A05 — Security Misconfiguration</p><p>Even well-written business logic can be undermined by insecure configuration.</p><p>The application therefore configures several HTTP security headers.</p><pre>.headers(headers -&gt; headers</pre><pre>    .contentTypeOptions(contentType -&gt; {})</pre><pre>    .frameOptions(frame -&gt;<br>        frame.deny()<br>    )</pre><pre>    .contentSecurityPolicy(csp -&gt;<br>        csp.policyDirectives(<br>            &quot;default-src &#39;self&#39;; &quot; +<br>            &quot;script-src &#39;self&#39;; &quot; +<br>            &quot;frame-ancestors &#39;none&#39;;&quot;<br>        )<br>    )</pre><pre>    .httpStrictTransportSecurity(hsts -&gt;<br>        hsts.includeSubDomains(true)<br>            .maxAgeInSeconds(31536000)<br>    )</pre><pre>    .addHeaderWriter(<br>        new StaticHeadersWriter(<br>            &quot;Permissions-Policy&quot;,<br>            &quot;geolocation=(), microphone=(), camera=()&quot;<br>        )<br>    )<br>)</pre><p>These headers provide several browser-level protections.</p><h3>X-Content-Type-Options</h3><p>Helps prevent MIME-type sniffing.</p><h3>X-Frame-Options</h3><p>Prevents the application from being embedded in frames, helping reduce clickjacking attacks.</p><h3>Content Security Policy</h3><p>Restricts the sources from which browser resources can be loaded.</p><h3>HTTP Strict Transport Security</h3><p>Instructs browsers to prefer HTTPS connections.</p><h3>Permissions Policy</h3><p>Restricts access to browser features such as:</p><ul><li>Camera</li><li>Microphone</li><li>Geolocation</li></ul><h3>13. Secure Error Handling</h3><p>Error messages can unintentionally reveal sensitive implementation details.</p><p>For example, returning this to a client is a bad idea:</p><pre>{<br>  &quot;exception&quot;: &quot;NullPointerException&quot;,<br>  &quot;stackTrace&quot;: &quot;com.example...&quot;<br>}</pre><p>It may reveal:</p><ul><li>Package names</li><li>Class names</li><li>File paths</li><li>Database information</li><li>Internal implementation details</li></ul><p>Instead, the application uses a centralized exception handler.</p><p>A client might receive:</p><pre>{<br>  &quot;message&quot;: &quot;An unexpected error occurred.&quot;,<br>  &quot;correlationId&quot;: &quot;7f8b...&quot;<br>}</pre><p>The detailed exception remains on the server.</p><p>The correlation ID allows developers to find the corresponding server-side event without exposing internal information to the user.</p><h3>14. OWASP A09 — Logging and Monitoring</h3><p>Security is difficult to investigate if nothing is logged.</p><p>The application maintains an audit trail for important security events, including:</p><ul><li>Access-denied attempts</li><li>Authentication failures</li><li>Authorization violations</li><li>Administrative actions</li><li>Suspicious requests</li></ul><p>For example:</p><pre>public void logAccessDenied(<br>        String userSub,<br>        String resource,<br>        String resourceId) {</pre><pre>    auditLog.warn(<br>        &quot;[ACCESS] DENIED | sub={} | resource={} | &quot; +<br>        &quot;resourceId={} | outcome=BLOCKED&quot;,<br>        sanitize(userSub),<br>        resource,<br>        resourceId<br>    );<br>}</pre><p>The values are sanitized before entering the log.</p><pre>private String sanitize(String value) {</pre><pre>    if (value == null) {<br>        return &quot;null&quot;;<br>    }</pre><pre>    return value.replaceAll(<br>        &quot;[\\n\\r\\t]&quot;,<br>        &quot;_&quot;<br>    );<br>}</pre><p>This protects against <strong>log injection</strong>.</p><p>For example, an attacker should not be able to insert newline characters into an input and make one malicious event appear as multiple legitimate log entries.</p><h3>15. Putting Everything Together</h3><p>The final security flow looks like this:</p><pre>USER<br>                         │<br>                         ▼<br>                 React + Vite SPA<br>                         │<br>                         │<br>                    OIDC + PKCE<br>                         │<br>                         ▼<br>                    Asgardeo<br>                         │<br>                         │ JWT<br>                         ▼<br>              ┌─────────────────────┐<br>              │   Spring Security   │<br>              │                     │<br>              │ JWT Verification    │<br>              │ Issuer Validation   │<br>              │ Expiration Check    │<br>              └──────────┬──────────┘<br>                         │<br>                         ▼<br>              ┌─────────────────────┐<br>              │   Authorization     │<br>              │                     │<br>              │ Role Check          │<br>              │ Ownership Check     │<br>              └──────────┬──────────┘<br>                         │<br>                         ▼<br>              ┌─────────────────────┐<br>              │   Business Layer    │<br>              │                     │<br>              │ DTO Validation      │<br>              │ Rate Limiting       │<br>              │ Audit Logging       │<br>              └──────────┬──────────┘<br>                         │<br>                         ▼<br>                    JPA / Hibernate<br>                         │<br>                         ▼<br>                       MySQL</pre><p>Every layer has a different responsibility.</p><p>This is what defense in depth looks like in practice.</p><h3>16. Security Testing</h3><p>Security controls should not simply be implemented — they should be tested.</p><p>I created several verification scenarios.</p><h3>Test 1 — Authentication Bypass</h3><p>Request:</p><pre>GET /api/admin/reservations</pre><p>without an access token.</p><p>Expected result:</p><pre>401 Unauthorized</pre><h3>Test 2 — BOLA / IDOR</h3><p>Vendor A attempts to access Vendor B’s reservation.</p><p>Expected result:</p><pre>403 Forbidden</pre><p>The server should also generate an audit event such as:</p><pre>[ACCESS] DENIED</pre><h3>Test 3 — Mass Assignment</h3><p>Send:</p><pre>{<br>  &quot;name&quot;: &quot;Test User&quot;,<br>  &quot;role&quot;: &quot;Organizer&quot;<br>}</pre><p>Expected result:</p><pre>Role remains Vendor</pre><p>The role should not be modified because it is not an accepted field in the update DTO.</p><h3>Test 4 — Rate Limiting</h3><p>Send requests above the configured threshold.</p><p>Expected result:</p><pre>429 Too Many Requests</pre><p>This confirms that the rate-limiting layer is actively enforcing its policy.</p><h3>17. OWASP Top 10 Security Mapping</h3><p>The major controls can be summarized as follows:</p><p>OWASP 2021Security Control<strong>A01 — Broken Access Control</strong>RBAC + object ownership validation<strong>A02 — Cryptographic Failures</strong>HTTPS/TLS + secure authentication mechanisms<strong>A03 — Injection</strong>JPA/Hibernate + parameterized queries + validation<strong>A04 — Insecure Design</strong>DTOs + rate limiting + trusted proxy handling<strong>A05 — Security Misconfiguration</strong>CSP + HSTS + secure headers + sanitized errors<strong>A06 — Vulnerable Components</strong>Dependency management and security updates<strong>A07 — Identification &amp; Authentication Failures</strong>OIDC + PKCE + JWT validation<strong>A08 — Software &amp; Data Integrity Failures</strong>Trusted identity claims + controlled API boundaries<strong>A09 — Security Logging &amp; Monitoring Failures</strong>Audit logging + log sanitization<strong>A10 — Server-Side Request Forgery</strong>Strict outbound request controls where applicable</p><p>Not every OWASP category can be solved with a single code snippet.</p><p>Security requires a combination of:</p><pre>Architecture<br>    +<br>Secure Coding<br>    +<br>Authentication<br>    +<br>Authorization<br>    +<br>Infrastructure<br>    +<br>Monitoring<br>    +<br>Testing</pre><h3>18. What I Learned</h3><p>One of the biggest lessons from implementing these controls was that authentication and authorization are not the same thing.</p><p>A user can be:</p><pre>Authenticated ≠ Authorized</pre><p>For example:</p><pre>Vendor A<br>   │<br>   ├── Valid JWT ✓<br>   ├── Authenticated ✓<br>   └── Access Vendor B&#39;s Reservation ✗</pre><p>Having a valid token only proves who the user is.</p><p>The backend still needs to determine what that user is allowed to do.</p><p>Another important lesson is that frontend security should never be confused with backend security.</p><p>A React route such as:</p><pre>/admin</pre><p>does not protect an administrative API.</p><p>The real protection must exist here:</p><pre>Spring Security<br>       ↓<br>Authorization<br>       ↓<br>Business Logic</pre><h3>19. Final Thoughts</h3><p>Security is not a single feature.</p><p>Adding JWT authentication does not automatically make an application secure.</p><p>Adding a firewall does not automatically make an application secure.</p><p>Adding a Content Security Policy does not automatically make an application secure.</p><p>A secure application is built by combining multiple controls and placing each control at the correct architectural boundary.</p><p>In this project, that meant:</p><ul><li>Using <strong>OIDC + PKCE</strong> instead of maintaining custom authentication</li><li>Validating <strong>JWTs on the backend</strong></li><li>Keeping access tokens out of persistent browser storage</li><li>Using <strong>role-based authorization</strong></li><li>Implementing <strong>object-level ownership checks</strong></li><li>Preventing <strong>mass assignment through DTOs</strong></li><li>Using <strong>JPA/Hibernate and parameterized queries</strong></li><li>Applying <strong>request validation</strong></li><li>Implementing <strong>rate limiting</strong></li><li>Restricting trust in <strong>forwarded IP headers</strong></li><li>Configuring <strong>CSP, HSTS, and security headers</strong></li><li>Sanitizing server errors</li><li>Maintaining <strong>security audit logs</strong></li><li>Testing security controls with realistic attack scenarios</li></ul><p>The most important principle I took away is:</p><blockquote><strong><em>The frontend is an interface. The backend is the security boundary.</em></strong></blockquote><p>Users can modify frontend code.</p><p>Users can manipulate HTTP requests.</p><p>Users can change request parameters.</p><p>Users can bypass UI restrictions.</p><p>Therefore, anything security-sensitive must ultimately be verified by the backend.</p><p>A production-ready application is not one that claims to be impossible to attack.</p><p>It is one that assumes attackers will try — and has multiple independent controls designed to detect, prevent, and limit those attacks.</p><p><strong>Security is not something added after development.</strong></p><p><strong>Security is part of the architecture.</strong></p><p>Git : <a href="https://github.com/amillthan/Web-Bookfair">https://github.com/amillthan/Web-Bookfair</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afe7db01575a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Circuitry: Engineering Innovation at the ICAPS 2025 Exhibition]]></title>
            <link>https://medium.com/@amillthanwork/beyond-the-circuitry-engineering-innovation-at-the-icaps-2025-exhibition-2cf182b7b7be?source=rss-ec371b7ea875------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cf182b7b7be</guid>
            <dc:creator><![CDATA[Kanesharaja Amillthan]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 16:11:48 GMT</pubDate>
            <atom:updated>2025-12-26T16:11:48.216Z</atom:updated>
            <content:encoded><![CDATA[<p>By K.Amillthan</p><p>5 min read · Oct 10, 2025</p><p>Walking through the Faculty of Science at the University of Kelaniya during the Undergraduate Symposium &amp; Innovation Exhibition (ICAPS / URSIE 2025), one is immediately struck by a sense of purpose. The event, themed &quot;Science in Nature Through the Lens,&quot; provided a stage for the next generation of engineers to turn theoretical physics into tangible, mechanical reality.</p><p>While the &quot;Shuttle Rover&quot; captured hearts with its sports-saving automation, several other robotic platforms on display demonstrated the raw technical &quot;grit&quot; required to build functional autonomous systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0DK1Yc-dfNNzawlCcqKXGA.jpeg" /></figure><p>1. The Heavy-Duty Tracked Rover: Power Meets Precision</p><p>The most imposing hardware at the exhibition was a large-scale, metal-chassis Tracked Rover. Built for high-torque applications, this machine was a masterclass in industrial-grade prototyping.</p><p>Unlike standard wheeled robots, this platform utilizes a chain-driven track system. This allows the robot to maintain stability and traction on uneven or hazardous terrain where traditional wheels would slip. The internal compartments reveal a sophisticated network of high-current motor drivers and power management modules, all designed to move a heavy payload without sacrificing control. It represents a &quot;tank&quot; of the research world—rugged, reliable, and ready for all-terrain exploration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Fn_ppY7tJRd7FwZys73ecg.jpeg" /></figure><p>2. Aerial Mastery: The Custom Arduino Quadcopter</p><p>While the rovers dominated the ground, the skies were represented by a custom-built DIY Quadcopter. This was not a store-bought drone; it was a carefully engineered &quot;X-frame&quot; platform built from the ground up.</p><p>The drone features four high-KV brushless DC motors and an Arduino-based flight controller. The complexity of such a build lies in the PID (Proportional-Integral-Derivative) tuning required to keep the aircraft level in real-time. Paired with the multi-channel RC transmitter seen in the lab, this project demonstrated a deep understanding of aerodynamics and wireless communication protocols. It’s a perfect example of how lightweight materials and complex code can achieve flight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Q1nRTGkHMCBag-dzEkyKdw.jpeg" /></figure><p>3. The Prototyping Phase: From Breadboards to Bases</p><p>Innovation is an iterative process. Scattered among the larger machines were smaller prototypes, such as Two-Wheeled Smart Cars and ESP32-CAM modules. These smaller bots serve as the &quot;brain-testing&quot; phase for the larger projects.</p><p>By using an L298N motor driver and an ESP-based controller, students can test computer vision algorithms—like those used to detect shuttlecocks—on a small, low-cost scale before implementing them on the heavy-duty hardware. These prototypes are the unsung heroes of the symposium, representing the hours of trial and error that lead to a finished product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*aQ0fBsCjhNo3DtkUuxjk6Q.jpeg" /></figure><p>4. Integration and Software Control</p><p>Hardware is only half the battle. The exhibition featured various Software Interfaces that allow users to monitor and control these machines. From &quot;Control Panels&quot; that track experiment details like specimen types and motor speeds, to mobile apps that provide a live video feed from an ESP camera, the integration of UI/UX with robotics was a core highlight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Fwu273csjgnEIfuDHJTIbA.jpeg" /></figure><p>Final Thoughts</p><p>Whether it was the precision of Optical Isolators using statistical quality tools or the raw mechanical power of a Tracked Rover, ICAPS 2025 proved that the future of technology is multidisciplinary. These projects aren&#39;t just academic exercises; they are the blueprints for the tools that will automate our industries, explore our environments, and enhance our lives.</p><p>The students at the University of Kelaniya have shown that with a few motors, a handful of sensors, and a lot of passion, the gap between &quot;science&quot; and &quot;nature&quot; can be bridged through the lens of innovation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cf182b7b7be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Simple Operating System That Displays a Custom Message]]></title>
            <link>https://medium.com/@amillthanwork/how-to-build-a-simple-operating-system-that-displays-a-custom-message-68a61744d8b8?source=rss-ec371b7ea875------2</link>
            <guid isPermaLink="false">https://medium.com/p/68a61744d8b8</guid>
            <category><![CDATA[simple-operating-system]]></category>
            <dc:creator><![CDATA[Kanesharaja Amillthan]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 11:51:01 GMT</pubDate>
            <atom:updated>2025-07-24T11:54:10.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*upVOLzdQcJg7auvOBTEFCQ.jpeg" /></figure><p>Creating an operating system might sound intimidating, but with just a few lines of assembly code, you can build a tiny OS that boots up and prints a personalized message on the screen. In this guide, I’ll walk you through creating a minimal bootloader OS called <strong>Amilthan OS</strong>, which displays:</p><blockquote>hello, welcome Amilthan OS</blockquote><p>No prior OS development experience needed — just some patience and basic command-line skills.</p><h3>What You’ll Need</h3><ul><li>A Linux machine or Windows with WSL (Windows Subsystem for Linux)</li><li>Basic familiarity with terminal commands</li><li>Two essential tools:</li><li><strong>NASM</strong> (Netwide Assembler) to assemble the code</li><li><strong>QEMU</strong> to emulate a virtual PC and run your OS</li></ul><p>If you don’t have NASM and QEMU installed, run these commands:</p><pre>sudo apt update<br>sudo apt install nasm qemu</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1EqEWLTmRqVsno5TWfF-Q.png" /></figure><h3>Step 1: Set Up Your Project Folder</h3><p>Create a dedicated folder to keep things organized:</p><pre>mkdir amilthan-os<br>cd amilthan-os</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vS2hXGbvN8egvGuqKbrPEQ.png" /></figure><h3>Step 2: Write Your Bootloader Code</h3><p>Create a new file named bootloader.asm:</p><pre>nano bootloader.asm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jJiahJtWRXm0Oup9A6X_Q.png" /></figure><p>Copy and paste the following assembly code:</p><pre>; bootloader.asm<br>[org 0x7c00]         ; BIOS loads boot sector here</pre><pre>start:<br>    mov si, message  ; Point to the message string<br>print_loop:<br>    lodsb            ; Load byte from DS:SI into AL, increment SI<br>    cmp al, 0        ; Check for end of string<br>    je hang          ; If zero (end), jump to hang<br>    mov ah, 0x0E     ; BIOS teletype print function<br>    int 0x10         ; Call BIOS interrupt to print character<br>    jmp print_loop   ; Loop for next character<br>hang:<br>    jmp $            ; Infinite loop to stop execution<br>message db &#39;hello, welcome Amilthan OS&#39;, 0<br>; Fill the rest of the 512-byte boot sector with zeros<br>times 510 - ($ - $$) db 0<br>; Boot sector signature<br>dw 0xAA55</pre><p>Save and exit (Ctrl + O, Enter, then Ctrl + X).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bt1LlvC4CR4v6FDi7h4PHA.png" /></figure><h3>Step 3: Assemble Your Bootloader</h3><p>Run NASM to compile your assembly code into a raw binary:</p><pre>nasm -f bin bootloader.asm -o bootloader.bin</pre><p>This will produce a 512-byte bootloader.bin — your bootable OS image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHgeT0suNpMo_WoAGCWpBg.png" /><figcaption>v</figcaption></figure><h3>Step 4: Test Your OS with QEMU</h3><p>Launch QEMU to run your OS in a virtual environment:</p><pre>qemu-system-x86_64 -drive format=raw,file=bootloader.bin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbllla16kerU1Sjj2ojPHQ.png" /></figure><p>A new window should pop up, displaying:</p><pre>hello, welcome Amilthan OS</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XkBeCoahJMrRirfB03Asqw.png" /></figure><p>Congratulations! You’ve just created your very own tiny operating system.</p><h3>What’s Happening Here?</h3><ul><li>The BIOS loads your bootloader at memory address 0x7C00.</li><li>The code loops through each character in your message and prints it using BIOS interrupt int 0x10 (teletype service).</li><li>Once the message is printed, the program enters an infinite loop to halt the CPU, preventing random execution.</li></ul><h3>What Next?</h3><p>This tiny OS is just the beginning. Here are some ideas to extend it:</p><ul><li>Change the <strong>text color</strong> using BIOS color attributes.</li><li>Add <strong>keyboard input</strong> to interact with users.</li><li>Create a <strong>second-stage kernel</strong> to load more complex programs.</li><li>Learn how to access disk sectors to read/write files.</li></ul><h3>Final Thoughts</h3><p>Building even a simple OS is a rewarding experience that teaches you how computers start, how low-level code interacts with hardware, and how software is loaded from storage. Keep experimenting with assembly, interrupts, and hardware interfaces — the possibilities are endless!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68a61744d8b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Types of Software Licenses You Should Know]]></title>
            <link>https://medium.com/@amillthanwork/types-of-software-licenses-you-should-know-a1ae8d317027?source=rss-ec371b7ea875------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1ae8d317027</guid>
            <dc:creator><![CDATA[Kanesharaja Amillthan]]></dc:creator>
            <pubDate>Tue, 27 May 2025 04:03:21 GMT</pubDate>
            <atom:updated>2025-05-27T04:39:26.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Is a Software License?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/0*mY43A62Uq8iVjjex.png" /><figcaption><strong>A picture of a person clicking “I Agree” on a software installation window</strong></figcaption></figure><p>When we install or use a software program, we often agree to a <strong>software license</strong>. But what does that mean?</p><p>A <strong>software license</strong> is a rule that tells us <strong>how we can use the software</strong>. Some software is <strong>free</strong>, some must be <strong>paid for</strong>, and some we can even <strong>change and share</strong>.</p><p>Let’s learn about the <strong>different types of software licenses</strong> available today.</p><h3>1. Free and Open Source Licenses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*-B8n4R598UWxPfTl.png" /><figcaption><strong>Open source</strong></figcaption></figure><p>These let people:</p><ul><li><strong>Use</strong> the software</li><li><strong>Change</strong> the software</li><li><strong>Share</strong> it with others</li></ul><p>Also, the <strong>source code</strong> (the original code that makes the software work) is available to everyone.</p><h4>Examples:</h4><ul><li><strong>GPL (General Public License)</strong> — You can change and share it, but you must also share your version with the same license.</li><li><strong>MIT License</strong> — You can do almost anything, just give credit to the maker.</li><li><strong>Apache License</strong> — Similar to MIT, but gives more protection to the creator.</li></ul><h3>2. Proprietary (Commercial) Licenses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*5mbVEt55oDfHcyJD.png" /></figure><p>These are <strong>paid software</strong>. You:</p><ul><li>Must <strong>buy</strong> or <strong>subscribe</strong></li><li>Cannot <strong>see or change</strong> the code</li><li>Cannot <strong>share</strong> it with others</li></ul><h4>Examples:</h4><ul><li><strong>Microsoft Windows</strong></li><li><strong>Adobe Photoshop</strong></li></ul><h3>3. Freeware Licenses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q8KsIeInIcvwweEg.jpg" /></figure><p>These are <strong>free to use</strong>, but you:</p><ul><li>Cannot <strong>change</strong> the software</li><li>Cannot <strong>sell</strong> it</li><li>Cannot <strong>see the code</strong></li></ul><h4>Examples:</h4><ul><li><strong>Skype</strong></li><li><strong>Zoom (free version)</strong></li></ul><h3>4. Shareware Licenses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/0*M8oxfpD3TzXDVtjI.jpg" /><figcaption><strong>A trial period</strong></figcaption></figure><p>These are <strong>free to try</strong> for a short time. After the trial, you must <strong>pay</strong> to use full features.</p><h4>Examples:</h4><ul><li><strong>WinRAR</strong></li><li><strong>Adobe Acrobat (trial version)</strong></li></ul><h3>5. Educational or Student Licenses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*N7Mf0S-_X2Bt3Sjl.png" /></figure><p>These are for <strong>students, teachers, or schools</strong>. They are usually <strong>free or cheaper</strong>, but can only be used for <strong>learning</strong>, not for business.</p><h4>Examples:</h4><ul><li><strong>AutoCAD Student Version</strong></li><li><strong>Microsoft Office 365 for Education</strong></li></ul><h3>Why Are Software Licenses Important?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/0*7hK21X6tuDibXv9p.png" /></figure><p>They:</p><ul><li><strong>Protect</strong> the creator’s work</li><li>Tell users what they <strong>can or cannot do</strong></li><li><strong>Stop</strong> illegal copying or selling</li></ul><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/0*5ahDgq-T21U5rMGO.jpg" /></figure><p>There are many kinds of software licenses. Some are <strong>free</strong>, some are <strong>paid</strong>, and each has <strong>different rules</strong>. It’s important to <strong>know the license</strong> before using software. This helps us use software <strong>correctly and legally</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1ae8d317027" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Unlocking the Secrets of Stored Procedures for Database Efficiency”]]></title>
            <link>https://medium.com/@amillthanwork/unlocking-the-secrets-of-stored-procedures-for-database-efficiency-a69863cc6b09?source=rss-ec371b7ea875------2</link>
            <guid isPermaLink="false">https://medium.com/p/a69863cc6b09</guid>
            <dc:creator><![CDATA[Kanesharaja Amillthan]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 17:25:47 GMT</pubDate>
            <atom:updated>2025-01-27T17:30:48.706Z</atom:updated>
            <content:encoded><![CDATA[<h4>What Are Stored Procedures ?</h4><p>Consider yourself a chef. You jot down the recipe you’ve perfected for the ideal pizza. Instead than making the same pizza every time, you now simply follow your saved recipe whenever someone requests it.</p><p>That recipe is similar to a stored procedure, but for SQL. You may use it whenever you want without having to write the same code over and over again because it’s a collection of instructions (queries) that you store in the database.</p><h4>Why Should You Use Stored Procedures ?</h4><p>The hidden superpower of your database is stored procedures. They’re great because of this:</p><p><strong>Advantages</strong></p><ul><li><strong>Time Saver</strong>: Why write the same query over and over? Save it once and call it anytime.</li><li><strong>Faster Execution</strong>: Stored procedures are precompiled, so they run faster than regular queries.</li><li><strong>Fewer Errors</strong>: Once your procedure is tested, it will always work the same way.</li><li><strong>More Secure</strong>: They hide your SQL code, so users can’t see or mess with it.</li></ul><p><strong>Disadvantages</strong></p><ul><li><strong>Tricky to Debug</strong>: If something goes wrong, finding the error can be a challenge.</li><li><strong>Locked to the Database</strong>: If you switch to another database system, you might have to rewrite your procedures.</li><li><strong>Can Get Messy</strong>: Too many procedures can make your database hard to manage.</li></ul><h4>How Do You Create a Stored Procedure ?</h4><p>Writing a recipe is similar to creating a stored procedure. All you have to do is follow these easy steps:</p><p><strong>Basic Format</strong></p><pre>DELIMITER //<br><br>CREATE PROCEDURE procedure_name (parameters)<br>BEGIN<br>    -- Your SQL code goes here<br>END //<br><br>DELIMITER ;</pre><ul><li><strong>DELIMITER //</strong>: Tells MySQL where the procedure starts and ends.</li><li><strong>CREATE PROCEDURE</strong>: Starts the process of creating a procedure.</li><li><strong>parameters</strong>: Inputs and outputs for your procedure.</li><li><strong>CALL</strong>: This is how you run (or “call”) the procedure.</li></ul><h4>Example: Calculating Total Sales</h4><p>Let’s say you have a table named sales:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*5QICBjHgXZWrqxcgrx0Jgg.png" /></figure><p>A product’s entire sales must always be determined. Save the query as a stored procedure rather than writing it out each time.</p><p><strong>Step 1: Create the Procedure</strong></p><pre>DELIMITER //<br><br>CREATE PROCEDURE CalculateTotalSales (IN product_name VARCHAR(50), OUT total_sales DECIMAL(10,2))<br>BEGIN<br>    SELECT SUM(quantity * price)<br>    INTO total_sales<br>    FROM sales<br>    WHERE product = product_name;<br>END //<br><br>DELIMITER ;</pre><ul><li><strong>IN</strong>: You provide the product name (input).</li><li><strong>OUT</strong>: The procedure calculates and returns the total sales (output).</li></ul><p><strong>Step 2: Run the Procedure</strong></p><p>To find the total sales for “Laptop”:</p><pre>CALL CalculateTotalSales(&#39;Laptop&#39;, @total_sales);<br>SELECT @total_sales AS TotalSales;</pre><p>This will determine the overall sales and display the outcome.</p><h4>Real-Life Example: Student Attendance Tracker</h4><p>Let’s say your school uses a table like this to record attendance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*W89kaUhE7y2300tLJYZ2Ww.png" /></figure><p>If the school asks for the number of days a student was present, you can create a stored procedure to find out.</p><p><strong>Procedure to Track Attendance</strong></p><pre>DELIMITER //<br><br>CREATE PROCEDURE GetAttendance (IN student_id INT, OUT present_days INT)<br>BEGIN<br>    SELECT COUNT(*)<br>    INTO present_days<br>    FROM attendance<br>    WHERE student_id = student_id AND status = &#39;Present&#39;;<br>END //<br><br>DELIMITER ;</pre><p><strong>Run the Procedure</strong></p><p>To check attendance for student 1:</p><pre>CALL GetAttendance(1, @present_days);<br>SELECT @present_days AS AttendanceCount;</pre><p>The process will produce the outcome after counting the number of days the student was present.</p><h4>Why Should Students Learn Stored Procedures ?</h4><p>Stored procedures are really helpful, even though they have a technical tone. They</p><ul><li>Save you time by reusing code.</li><li>Make your database faster and more efficient.</li><li>Help you write clean, error-free queries.</li><li>Teach you a skill that’s highly valuable in the real world.</li></ul><p>You’ll question how you ever managed to live without shortcuts once you’ve mastered them, just like when you discover how to use them in your favorite software!</p><p><strong>Final Tip</strong></p><p>Begin modestly. Soon, you’ll feel comfortable developing more intricate stored procedures after practicing the creation of basic ones. At first, stored methods could seem a little complicated, but with repetition, they will become instinctive. Have fun with your coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a69863cc6b09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The CIA Triad]]></title>
            <link>https://medium.com/@amillthanwork/the-cia-triad-d3eaf076efc9?source=rss-ec371b7ea875------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3eaf076efc9</guid>
            <dc:creator><![CDATA[Kanesharaja Amillthan]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 11:05:58 GMT</pubDate>
            <atom:updated>2024-07-16T11:29:36.461Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kgp199vz2Gw7k0jvAwLSJw.png" /><figcaption>Image from coretelligent</figcaption></figure><p><strong>Introduction.</strong></p><p>Confidentiality, Integrity, and Availability. These are the three core components of the CIA triad, an information security model meant to guide an organization’s <a href="https://securityscorecard.com/blog/how-to-write-third-party-risk-management-policies-tprm-and-procedures">security procedures and policies</a>.</p><p>While people outside the information security community might hear the phrase CIA Triad and think “conspiracy theory,” those in the cybersecurity field know that the CIA Triad has absolutely nothing to do with the Central Intelligence Agency. Instead, the CIA triad has everything to do with keeping your organization’s data, networks, and devices safe and secure, while strengthening the <a href="https://securityscorecard.com/product/security-ratings">security posture</a> of your organization.</p><p><strong>What is CIA Triad?</strong></p><p>The CIA triad is widely accepted as a model in <a href="https://securityscorecard.com/blog/what-is-an-information-security-policy-and-what-should-it-include">information security</a>. It’s not a singular doctrine and there was no one author. Rather the model appears to have developed over time, with roots as old as modern computing, pulling concepts from various sources. Ben Miller, vice president for Dragos, seems to be one of the few people who has done any digging on the origins of the triad. <a href="http://blog.electricfork.com/2010/03/cia-triad.html">He wrote a blog post 11 years ago</a> about its roots and was unable to find a single source. Instead, the concepts seem to be pulled from a few different documents: a 1976 paper for the U.S. Air Force, for example, and a paper written in the 1980s about the difference between commercial and military computer systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*rrypFlMTT9_pFfoLjbUTkg.png" /><figcaption>Image from geeksforgeeks</figcaption></figure><p><strong>Confidentiality.</strong></p><p>Confidentiality measures, which work to stop unwanted access to sensitive information, are roughly comparable to privacy measures. Data is frequently categorized based on the kind and extent of harm that could be caused if it ended up in the wrong hands. Based on those classifications, more or less strict data security measures can then be put in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*ljcjZIlusB9zPjPCYFf_GQ.png" /><figcaption>Image from geeksforgeeks</figcaption></figure><p><strong>Integrity.</strong></p><p>Throughout its whole existence, data must be kept reliable, accurate, and consistent. Data must not be modified while in transit, and precautions must be taken to prevent unauthorized parties from changing it, as in the case of data breaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*OyJ2ZDv6Mt4pdDEgtJNDFg.png" /><figcaption>Image from geeksforgeeks</figcaption></figure><p><strong>Availability.</strong></p><p>Information must always be easily and consistently available to those who are allowed. This entails keeping up with the systems, hardware, and technical infrastructure that store and show the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*ryqIaGGvVVu1bwqvIyNm_g.png" /><figcaption>Image from geeksforgeeks</figcaption></figure><p><strong>Why should you use CIA Triad?</strong></p><ul><li><strong>Protection of Sensitive Information</strong>: Ensures that sensitive information is accessible only to those authorized to access it, preventing unauthorized access and data breaches.</li><li><strong>Compliance and Legal Requirements</strong>: Many regulations and standards (e.g., GDPR, HIPAA) mandate the protection of personal and sensitive data, making confidentiality a legal necessity.</li><li><strong>Accuracy and Reliability of Data</strong>: Ensures that information remains accurate and unaltered during transit and storage, safeguarding against unauthorized modifications.</li><li><strong>Trust and Credibility</strong>: Maintaining data integrity builds trust among users and stakeholders, as they can rely on the information being correct and unchanged.</li><li><strong>Uninterrupted Access to Information</strong>: Ensures that authorized users have reliable access to information and resources when needed, which is crucial for business operations.</li><li><strong>Resilience Against Attacks</strong>: Protects against threats such as Denial of Service (DoS) attacks that aim to disrupt access to services, ensuring business continuity.</li></ul><p><strong>When Should You Use the CIA Triad?</strong></p><p>You should use the CIA triad in the majority of security situations, particularly because each component is critical. However, it is particularly helpful when developing systems around <a href="https://www.fortinet.com/it/resources/cyberglossary/data-classification">data classification</a> and managing permissions and access privileges. You should also stringently employ the CIA triad when addressing the cyber vulnerabilities of your organization. It can be a powerful tool in disrupting the Cyber Kill Chain, which refers to the process of targeting and executing a cyberattack. The CIA security triad can help you hone in on what attackers may be after and then implement policies and tools to adequately protect those assets.</p><p>In addition, the CIA triad can be used when training employees regarding cybersecurity. You can use hypothetical scenarios or real-life case studies to help employees think in terms of the maintenance of confidentiality, integrity, and availability of information and systems.</p><p><strong>Example scenarios.</strong></p><ol><li>Banks make sure that information about customer accounts is only accessible by authorized staff.</li><li>A hospital makes sure that only employees who have authorization can access patient records.</li><li>A software system does routine system checks. Files harmed by the system are repaired.</li><li>Certain documents are only accessible to those who have been vetted by a government agency.</li><li>Social networking sites keep track of information. They make sure user privacy is not jeopardized.</li></ol><p><strong>References.</strong></p><p>by Private: Phoebe Fasulo. (2024, June 28). <em>What is the CIA Triad? Definition, Importance, &amp; Examples — SecurityScorecard</em>. SecurityScorecard. <a href="https://securityscorecard.com/blog/what-is-the-cia-triad/">https://securityscorecard.com/blog/what-is-the-cia-triad/</a></p><p>GeeksforGeeks. (2023b, March 13). <em>CIA triad</em>. GeeksforGeeks. <a href="https://www.geeksforgeeks.org/the-cia-triad-in-cryptography/">https://www.geeksforgeeks.org/the-cia-triad-in-cryptography/</a></p><p>Hashemi-Pour, C., &amp; Chai, W. (2023, December 21). <em>CIA triad (confidentiality, integrity and availability)</em>. WhatIs. <a href="https://www.techtarget.com/whatis/definition/Confidentiality-integrity-and-availability-CIA">https://www.techtarget.com/whatis/definition/Confidentiality-integrity-and-availability-CIA</a></p><p>Unitrends. (2024, March 12). <em>The CIA triad and its importance in data security</em>. Unitrends. <a href="https://www.unitrends.com/blog/cia-triad-confidentiality-integrity-availability">https://www.unitrends.com/blog/cia-triad-confidentiality-integrity-availability</a></p><p>Team, C. (2022, June 2). <em>What is the CIA Triad? Definition &amp; Examples in Cybersecurity</em>. Coretelligent. <a href="https://www.coretelligent.com/blog/what-is-the-cia-triad-and-why-does-your-cybersecurity-position-depend-on-it/">https://www.coretelligent.com/blog/what-is-the-cia-triad-and-why-does-your-cybersecurity-position-depend-on-it/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3eaf076efc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>