Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

SOC 2 Compliance: A Practical Engineering Guide

By Kokil Thapa | Last reviewed: September 2026

Enterprise buyers ask for a SOC 2 report before they wire transfer six figures. That makes SOC 2 Compliance: A Practical Engineering Guide less about legal paperwork and more about how your Laravel app, Ubuntu servers, and GitLab pipelines behave under audit. I've shipped client portals with document storage and payment flows where access control and logging were non-negotiable from day one. This page maps AICPA Trust Service Criteria to concrete engineering tasks you can implement on a small team—without hiring a compliance department first. If you already run production systems, you are closer to readiness than most founders assume.

Start with the sibling overview at SOC 2 compliance for startups if you need business context. Engineers should treat readiness like compliance as code: policies live in Git, controls run in CI, and proof is exported automatically rather than scraped from Slack at quarter-end.

What is SOC 2 compliance and who actually needs it?

SOC 2 is an attestation framework published by the AICPA. An independent CPA firm examines whether your organisation's controls meet selected Trust Service Criteria. Security (CC) is mandatory. Availability, processing integrity, confidentiality, and privacy are optional categories you choose based on what you sell.

SaaS vendors, API platforms, payment-adjacent tools, and any B2B product handling customer data routinely face SOC 2 requests. Nepal-based SaaS selling globally hits the same bar as a Bay Area startup. Local IRD and VAT rules still apply for billing, but SOC 2 answers the buyer's question: "Can we trust your engineering?"

SOC 2 Trust Service CriteriaSecurityRequired CC1–CC9AvailabilityConfidentialityProcessingPrivacyIndependent CPA attestation reportType I = design at a point in time | Type II = operating effectiveness over months
SOC 2 compliance starts with Security (CC); add optional Trust Service Criteria based on your product promises.

The official framework lives on the AICPA SOC 2 resources page. Read the description criteria once. Then translate each CC family into tickets your team can close.

When SOC 2 beats other frameworks

ISO 27001 certifies a management system. SOC 2 produces a customer-shareable report US enterprises expect. GDPR governs personal data rights in the EU. Many teams pursue SOC 2 first because procurement teams attach it to vendor security questionnaires. For Nepal companies serving international clients, pairing SOC 2 readiness with data residency and compliance planning avoids surprises later.

How do you map SOC 2 controls to everyday engineering work?

Auditors sample evidence that policies exist and controls operate consistently. Your job is to make both visible in systems engineers already touch. On production Laravel applications I maintain, that means RBAC via Spatie Permission, encrypted secrets in environment files outside Git, and audit logs for admin actions.

Break the Common Criteria (CC) into engineering domains:

  1. CC6 Logical access: MFA on GitLab, AWS, and production SSH. Role-based app permissions. No shared admin accounts.
  2. CC7 System operations: Centralised logging, alerting on failed logins, patch cadence documented.
  3. CC8 Change management: Pull requests required, CI checks, tagged releases, rollback runbooks.
  4. CC9 Risk mitigation: Vendor inventory, annual access reviews, backup restore tests.
SOC 2 Controls to Engineering StackCC6 AccessCC7 OpsCC8 ChangeCC9 RiskGitLab CIPR gates + scansLaravel 13 appRBAC + audit logUbuntu 24UFW + fail2banMySQL 9.7Encrypted backupsEvidenceexport store
Map each SOC 2 Common Criteria family to concrete layers: CI pipeline, application, and infrastructure.

Minimum viable control set for a Laravel SaaS on Ubuntu

You do not need Kubernetes to pass SOC 2. A well-run LAMP-style stack on Ubuntu with GitLab CI and Deployer 7 can satisfy auditors if evidence is clean. Document these baselines:

  • PHP 8.3 or 8.5 on production, with Composer 2.10 lockfile committed.
  • Separate staging and production environments with distinct credentials.
  • Redis 8.10 or database sessions with secure cookie flags.
  • Nightly encrypted database dumps tested quarterly.
  • Admin actions logged to an append-only table or external log sink.

Client portals like Mijar Law Associates need document access trails. That maps directly to CC6 and confidentiality criteria. Build logging before the auditor asks who downloaded which file.

What technical evidence do SOC 2 auditors expect from engineering teams?

Evidence is the product of SOC 2 compliance work. Auditors request populations—lists of changes, users, incidents—and sample items from each. Missing one population delays the report by weeks.

Maintain an evidence matrix linking control ID, system source, export command, and retention period. Store exports in a dated folder structure your CPA can browse read-only.

Control areaEvidence sourceExport frequencyTypical failure
User access (CC6.1)GitLab members, AWS IAM, app rolesMonthly snapshotOrphaned accounts after offboarding
Change tickets (CC8.1)Merge requests linked to issuesContinuousDirect commits to main
Vulnerability scans (CC7.1)CI SAST, dependency auditEvery buildScan exists but nobody reads output
Backup restore (CC9.1)Restore test log with checksumQuarterlyBackups run but never restored
Incident records (CC7.4)Postmortem docs, pager historyPer incidentIncidents fixed in chat only

Align incident documentation with an incident response playbook. Auditors want timestamps, impact, root cause, and remediation—not heroic Slack threads.

Sample export commands your pipeline can run

Automate read-only exports. Never give auditors production shell access.

# GitLab: export project members (run in CI on schedule)
curl --header "PRIVATE-TOKEN: $GITLAB_RO_TOKEN" \
  "https://gitlab.example.com/api/v4/groups/42/members/all" \
  | jq '.' > evidence/$(date +%Y-%m)/gitlab-members.json

# AWS: IAM credential report (requires iam:GenerateCredentialReport)
aws iam generate-credential-report
aws iam get-credential-report --output text > evidence/$(date +%Y-%m)/iam-credentials.csv

# Laravel: artisan audit of admin role assignments
php artisan tinker --execute="echo User::role('admin')->pluck('email');" \
  > evidence/$(date +%Y-%m)/app-admins.txt

Pair exports with a strong password policy enforced via your identity provider and application-level MFA for privileged routes. Weak credentials fail CC6 even when everything else looks polished.

SOC 2 Evidence Collection PipelineLive systemsGit + AWS + appScheduled CIread-only jobsEvidence storedated foldersAuditorsamples itemsCC6 accessuser listsCC8 changesmerge logsCC7 monitoringalert historyAuditors sample CC6, CC7, CC8, and CC9 populations from the evidence store
Automated SOC 2 evidence exports turn live system state into auditor-ready populations for CC6, CC7, CC8, and CC9 sampling.

How do you automate SOC 2 compliance evidence in CI/CD?

Manual evidence collection breaks the moment someone goes on leave. Treat compliance exports as scheduled CI jobs with the same seriousness as deployment pipelines. I've used GitLab CI on shared EC2 infrastructure for multiple production sites; the same pattern applies to SOC 2 automation.

Read the dedicated walkthrough at automate SOC 2 compliance evidence in CI. The core idea: nightly or weekly jobs write JSON and CSV artefacts to an S3 bucket with versioning and object lock.

GitLab CI job skeleton for evidence export

soc2-evidence-export:
  stage: compliance
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
  script:
    - mkdir -p "evidence/${EVIDENCE_MONTH}"
    - ./scripts/export-gitlab-members.sh > "evidence/${EVIDENCE_MONTH}/gitlab-members.json"
    - ./scripts/export-composer-audit.sh > "evidence/${EVIDENCE_MONTH}/composer-audit.json"
    - aws s3 sync evidence/ s3://company-soc2-evidence/${EVIDENCE_MONTH}/ --sse AES256
  artifacts:
    paths:
      - evidence/
    expire_in: 1 year

Add security scanning stages to your existing pipeline. Composer audit catches vulnerable PHP packages. npm audit covers Vite 8.x frontend builds. Fail builds on critical CVEs in production branches.

For teams building pipelines from scratch, compare patterns in Jenkins CI/CD tutorials and Azure DevOps YAML pipelines. The scheduler differs; the evidence outputs should not.

Infrastructure checks as code

Use Terraform for infrastructure as code where possible. Auditors love drift detection. A weekly `terraform plan` that exits non-zero on unexpected changes proves CC8 change control extends to cloud resources.

Server hardening belongs in Ansible or cloud-init scripts checked into Git. Document UFW rules, SSH key-only auth, and automatic security updates on Ubuntu. Linux system administration work and SOC 2 readiness overlap heavily—patching and logging are the same tickets.

Centralise application logs per log aggregation for small teams. CC7 expects you to detect and respond to anomalies. You cannot prove monitoring with `tail -f` on one server.

Should you pursue SOC 2 Type I or Type II first?

Type I reports on control design at a specific date. Type II reports on operating effectiveness over a period—usually six to twelve months. Enterprise buyers increasingly demand Type II. Type I is a reasonable milestone if a deal deadline is tight.

SOC 2 Type I vs Type II TimelineType IDesign snapshotOne point in timeType IIOperating period6–12 months evidenceMonth 0Observation window — continuous evidence requiredType I reportType II reportStart collecting evidence before the observation window — gaps cannot be backfilled
SOC 2 Type I validates design at one date; Type II requires months of consistent control operation with exportable proof.

Realistic readiness timeline for a ten-person team

Months 1–2: gap assessment, policy drafts, MFA everywhere, logging baseline. Months 3–4: CI evidence jobs, access review process, backup restore test. Months 5–6: observation window begins; no control regressions. Month 7+: Type II fieldwork with CPA firm.

Budget Rs 800,000–2,500,000 (~USD 6,000–19,000) for a first Type II audit depending on scope and firm. Engineering time often exceeds audit fees. Factor that into enterprise application development estimates when SOC 2 is on the roadmap.

Common engineering mistakes during observation

  • Granting temporary production access that never gets revoked.
  • Skipping CI on "tiny" hotfixes during a customer emergency.
  • Rotating API keys without updating the vendor inventory spreadsheet.
  • Disabling alerts because they were noisy instead of tuning thresholds.

Each mistake becomes a Type II exception. Exceptions do not always fail the report, but they extend fieldwork and erode buyer confidence.

How does SOC 2 fit with platform engineering and vendor management?

SOC 2 is not a one-time project. It is an operating mode. Platform teams embed control checks into golden paths: new services inherit logging, scanning, and backup policies by default. That aligns with platform engineering principles without requiring a dedicated internal developer platform on day one.

Vendor management satisfies CC9. Maintain a spreadsheet or CMDB entry for every subprocessors: hosting provider, email API, payment gateway, error tracker. Review their SOC 2 reports annually. If you integrate Stripe, PayPal, eSewa, or Khalti, document data flows and retention.

For custom builds, engage teams who treat testing and optimization and support and maintenance as ongoing control operation—not a launch-week checkbox. SOC 2 rewards boring consistency.

Security testing references like the OWASP Application Security Verification Standard help you prioritise fixes auditors notice. Map ASVS Level 1 items to your Laravel middleware, CSRF protection, and session configuration.

NIST guidance on security and privacy controls (NIST SP 800-53 Rev. 5) offers deeper vocabulary if your enterprise customers ask how SOC 2 maps to their internal frameworks. You do not implement all of NIST for SOC 2, but crosswalk documents impress security reviewers.

Key Takeaways

  • SOC 2 compliance is an engineering operating model—map CC6–CC9 to access, logging, change control, and risk workflows you already run.
  • Collect evidence automatically via scheduled CI jobs; auditors sample populations, not hero narratives.
  • Type II requires months of consistent operation—start exports before the observation window opens.
  • MFA, RBAC, encrypted backups, and incident postmortems cover a large share of first-audit findings.
  • Pair SOC 2 readiness with vendor reviews and log aggregation so controls survive team turnover.
  • Treat policies as code in Git alongside Terraform, Ansible, and pipeline YAML.

People Also Ask

How long does SOC 2 Type II take?

Most startups need six to twelve months of observation after initial remediation. Add six to ten weeks for CPA fieldwork and report drafting. Starting evidence collection early shortens the calendar even if remediation runs in parallel.

Can a small development team pass SOC 2 without dedicated compliance staff?

Yes. Teams under fifteen engineers pass Type II regularly when founders assign a control owner and automate exports. The burden is consistency, not headcount. A part-time security champion plus scheduled CI jobs beats a compliance hire with no Git access.

What is the difference between SOC 2 and ISO 27001?

SOC 2 produces an attestation report focused on Trust Service Criteria for service organisations, common in US SaaS procurement. ISO 27001 certifies an information security management system under accredited bodies, more common in EU and global enterprise contracts. Many companies pursue both over time; engineering controls overlap significantly.

Do Nepal-based SaaS companies need SOC 2?

Not legally, unless a specific contract requires it. International B2B buyers frequently request SOC 2 before signing. Local tax and registration rules remain separate; see eCommerce legal compliance in Nepal for domestic obligations that run parallel to vendor security reviews.

Build SOC 2 readiness into your next release

SOC 2 Compliance: A Practical Engineering Guide boils down to provable controls: who accessed production, what changed, how you detected failure, and how fast you fixed it. Implement MFA and logging this sprint. Schedule evidence exports next sprint. Pick Type I or Type II based on deal pressure, then stay consistent through the observation window.

If you want help hardening a Laravel application, Ubuntu infrastructure, or CI pipeline before an audit, review our custom software development services or contact us with your stack and target report date. Read more on the blog, browse the portfolio, or explore developer tools for day-to-day engineering work.

Frequently Asked Questions

SOC 2 is an AICPA attestation framework where an independent CPA firm examines whether your organisation's controls meet selected Trust Service Criteria. Security is mandatory; availability, processing integrity, confidentiality, and privacy are optional. For engineers, it means designing, operating, and proving controls around access, change management, monitoring, and incident response—with continuous evidence an auditor can sample during a Type I or Type II examination.

SaaS vendors, API platforms, payment-adjacent tools, and any B2B product handling customer data routinely face SOC 2 requests from enterprise buyers. Nepal-based SaaS companies selling globally hit the same bar as a Bay Area startup. Local IRD and VAT rules still apply for billing, but SOC 2 answers the buyer's question: can we trust your engineering? It is not a legal requirement unless a specific contract demands it.

Break CC families into domains your team already touches. CC6 logical access maps to MFA on GitLab, AWS, and production SSH, plus role-based app permissions via Spatie Permission and no shared admin accounts. CC7 covers centralised logging and alerting. CC8 means pull requests, CI checks, tagged releases, and rollback runbooks. CC9 covers vendor inventory, annual access reviews, and quarterly backup restore tests. Each family should link to a CI pipeline, application, or infrastructure layer.

You do not need Kubernetes. A well-run stack on Ubuntu with GitLab CI and Deployer 7 can satisfy auditors if evidence is clean. Document PHP 8.3 or 8.5 on production with a Composer 2.10 lockfile committed, separate staging and production credentials, Redis 8.10 or secure database sessions, nightly encrypted database dumps tested quarterly, and admin actions logged to an append-only table or external log sink. Build document access trails before the auditor asks who downloaded which file.

Auditors request populations—lists of changes, users, incidents—and sample items from each. Missing one population delays the report by weeks. Maintain an evidence matrix linking control ID, system source, export command, and retention period. Typical sources include monthly GitLab member snapshots for CC6.1, continuous merge request records for CC8.1, Composer audit output every build for CC7.1, quarterly backup restore logs for CC9.1, and per-incident postmortem docs for CC7.4. Store dated exports in read-only folders your CPA can browse.

Treat compliance exports as scheduled CI jobs with the same seriousness as deployment pipelines. Nightly or weekly GitLab CI jobs write JSON and CSV artefacts to an S3 bucket with versioning and object lock. Export GitLab group members, AWS IAM credential reports, and Laravel admin role assignments via read-only API tokens—never grant auditors production shell access. Pair exports with Composer audit for PHP packages and npm audit for Vite 8.x frontend builds, failing production branches on critical CVEs.

Type I reports on control design at a specific date. Type II reports on operating effectiveness over a period—usually six to twelve months. Enterprise buyers increasingly demand Type II. Type I is a reasonable milestone if a deal deadline is tight, but Type II requires months of consistent control operation with exportable proof. Start automated evidence collection before the observation window opens, even while remediation runs in parallel.

Most startups need six to twelve months of observation after initial remediation, plus six to ten weeks for CPA fieldwork and report drafting. A realistic timeline for a ten-person team runs months one to two for gap assessment and MFA, months three to four for CI evidence jobs and backup restore tests, months five to six for the observation window with no control regressions, then month seven onward for Type II fieldwork.

Budget Rs 800,000 to 2,500,000, roughly USD 6,000 to 19,000, for a first Type II audit depending on scope and CPA firm. Engineering time often exceeds audit fees, so factor readiness work into enterprise application development estimates when SOC 2 is on the roadmap.

Yes. Teams under fifteen engineers pass Type II regularly when founders assign a control owner and automate exports. The burden is consistency, not headcount. A part-time security champion plus scheduled CI jobs beats a compliance hire with no Git access. Treat readiness like compliance as code: policies live in Git, controls run in CI, and proof is exported automatically rather than scraped from Slack at quarter-end.

ISO 27001 certifies an information security management system under accredited bodies, more common in EU and global enterprise contracts. SOC 2 produces a customer-shareable attestation report focused on Trust Service Criteria for service organisations, which US SaaS procurement teams routinely attach to vendor security questionnaires. Many companies pursue both over time because engineering controls overlap significantly, but teams often start with SOC 2 when enterprise buyers demand it first.

Not legally, unless a specific contract requires it. International B2B buyers frequently request a SOC 2 report before signing deals worth six figures. Local tax and registration rules remain separate from vendor security reviews. For Nepal companies serving international clients, pairing SOC 2 readiness with data residency and compliance planning avoids surprises later when procurement teams attach security questionnaires to contracts.

Granting temporary production access that never gets revoked, skipping CI on tiny hotfixes during a customer emergency, rotating API keys without updating the vendor inventory spreadsheet, and disabling noisy alerts instead of tuning thresholds. Each mistake becomes a Type II exception. Exceptions do not always fail the report, but they extend fieldwork and erode buyer confidence. Stay consistent through the entire observation period with no control regressions.

SOC 2 is an operating mode, not a one-time project. CC9 requires a vendor inventory for every subprocessor—hosting provider, email API, payment gateway, error tracker—and annual review of their SOC 2 reports. If you integrate Stripe, PayPal, eSewa, or Khalti, document data flows and retention. Platform teams embed logging, scanning, and backup policies into golden paths so new services inherit controls by default without requiring a dedicated internal developer platform on day one.

Linux system administration and SOC 2 readiness overlap heavily. Use Terraform for infrastructure as code so weekly terraform plan runs prove CC8 change control extends to cloud resources. Server hardening belongs in Ansible or cloud-init scripts checked into Git, documenting UFW rules, SSH key-only auth, and automatic security updates on Ubuntu. Centralise application logs—you cannot prove CC7 monitoring with tail on one server. Map OWASP ASVS Level 1 items to Laravel middleware, CSRF protection, and session configuration to prioritise fixes auditors notice.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: