soc2

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package soc2 is the SOC 2 framework skeleton: a Framework implementation, the control catalog, and the seed policies that demonstrate every L0–L9 seam works end-to-end. The full ~300-policy catalog is post-M6 work; M6 ships 3 representative policies — one automated, one manual, one cross-source.

See docs/architecture/09-implementation-roadmap.md §What's in v1-alpha.

Index

Constants

View Source
const (
	PolicyGCPIAMNoOwnerRoleForUsers        = "soc2.cc6.1.gcp_iam_no_owner_role_for_users"
	PolicyObjectStoragePublicAccessBlocked = "soc2.cc6.7.object_storage_public_access_blocked"
	PolicyComputeNoDefaultServiceAccount   = "soc2.cc6.6.compute_no_default_service_account"
	PolicyCloudSQLRequireSSL               = "soc2.cc6.7.cloudsql_require_ssl"
)

GCP policy IDs — exported so tests and other packages can reference them by symbol rather than string-literal. PolicyObjectStorageBlocked is cross-vendor (it accepts object_storage_bucket from any cloud source — S3, GCS, Azure Blob) even though it lives in this file for historical reasons; the gcs_bucket_uniform_access policy it replaces was GCS-only.

View Source
const (
	PolicyGitDefaultBranchProtected = "soc2.cc6.6.git_default_branch_protected"
	PolicyOktaAppsMFA               = "soc2.cc6.7.okta_apps_require_mfa"
)

Identity-source policy IDs. The per-source MFA policies that used to live here (okta_users_have_mfa, github_org_members_have_2fa, aws_iam mfa_enforced) collapsed into the canonical source-agnostic PolicyMFAUnion now that all three plugins emit the cross-vendor directory_user shape. The repository branch-protection policy is now cross-vendor (accepts git_repository from GitHub, GitLab, Bitbucket, …). okta_app stays Okta-specific — SAML/OIDC app catalogs have no cross-vendor analog yet.

View Source
const (
	PolicyCloudTrailMultiRegionEnabled = "soc2.cc7.2.cloudtrail_multiregion_enabled"
	PolicyCloudWatchLogsRetentionSet   = "soc2.cc7.2.cloudwatch_logs_retention_set"
	PolicyGuardDutyEnabled             = "soc2.cc7.1.guardduty_enabled"
	PolicyConfigRecorderEnabled        = "soc2.cc7.1.config_recorder_enabled"
)

Infrastructure-source policy IDs. These four policies demonstrate the cloudtrail, cloudwatch, guardduty, and config (configservice) source plugins under their natural SOC 2 controls (CC7.1 monitoring + CC7.2 system operations / log capture).

View Source
const FrameworkID = "soc2"

FrameworkID is the registered identifier.

View Source
const FrameworkVersion = "soc2-2017@0.1.0"

FrameworkVersion stamps every PolicyRef returned by this framework.

View Source
const PolicyAccessReview = "soc2.cc6.3.access_review_quarterly"

PolicyAccessReview is the manual policy demonstrating manual.pdf → signed_document consumption.

View Source
const PolicyEC2NoPublicIP = "soc2.cc6.6.ec2_no_public_ip"

PolicyEC2NoPublicIP is the policy that fails when any EC2 instance has a public IP address (SOC 2 CC6.6 — restrict external network access).

View Source
const PolicyEKSSecretsEncryption = "soc2.cc6.7.eks_secrets_encryption" // #nosec G101 -- policy identifier, not a credential. gitleaks:allow

PolicyEKSSecretsEncryption is the policy that fails when any EKS cluster lacks envelope encryption for Kubernetes secrets (SOC 2 CC6.7).

View Source
const PolicyKMSKeyRotation = "soc2.cc6.7.kms_key_rotation_enabled" // #nosec G101 -- policy identifier, not a credential. gitleaks:allow

PolicyKMSKeyRotation is the policy that fails when any customer- managed CMK has automatic rotation disabled (SOC 2 CC6.7).

View Source
const PolicyMFAUnion = "soc2.cc6.1.mfa_enforced_all_sources"

PolicyMFAUnion is the canonical MFA-enforcement policy. Its user_directory slot accepts directory_user — the cross-vendor identity shape that aws.iam, okta, github (org members), and future Azure AD/LDAP plugins all emit — with one-or-more cardinality, so the rule runs once against the union of every bound directory source. There is no per-source MFA policy: the rule logic is source-agnostic and a separate Okta-only or GitHub-only audit lens is a project-config concern (binding restrictions), not a duplicate framework policy.

View Source
const PolicyObjectStorageEncryptedAtRest = "soc2.cc6.7.object_storage_encrypted_at_rest"

PolicyObjectStorageEncryptedAtRest is the cross-vendor policy that fails when any object_storage_bucket (S3, GCS, Azure Blob, …) lacks server-side encryption at rest (SOC 2 CC6.7). The rule logic is source-agnostic; a project that has both AWS S3 and GCS sources registered sees one consolidated result spanning both clouds.

View Source
const PolicyRDSEncryptionAtRest = "soc2.cc6.7.rds_encryption_at_rest"

PolicyRDSEncryptionAtRest is the policy that fails when any RDS instance has StorageEncrypted=false (SOC 2 CC6.7).

Variables

This section is empty.

Functions

func Controls

func Controls() []core.Control

Controls returns the SOC 2 control catalog used by every shipped policy: the M6 walking-skeleton CC6.1 / CC6.3, plus the access / data-protection / monitoring / logging controls referenced by the post-M6 plugin-set + identity policies. The full TSC 2017 catalog is still post-M6 work.

func ManualCatalog

func ManualCatalog() map[string]manual.CatalogEntry

ManualCatalog returns the catalog entries the manual.pdf plugin needs to resolve manual-evidence paths. M6 ships one entry; full catalog YAML loading is post-M6.

func Policies

func Policies() []core.Policy

Policies returns the seed policies. Authoring them as Go values (rather than embedded YAML) keeps the walking skeleton legible; the L0 YAML loader is exercised in internal/spec's own tests.

func Register

func Register(set *registry.Set) error

Register populates the rule and policy registries with the SOC 2 skeleton's rules and seed policies. Sources and evidence types are registered by the orchestrator alongside this call.

Errors here surface as exit-3 configuration errors at startup.

func Rules

func Rules() []core.Rule

Rules returns every rule the SOC 2 framework registers: seed (MFA + manual presence), AWS infrastructure (S3/KMS/RDS/EC2/EKS), AWS observability (CloudTrail/CloudWatch/GuardDuty/Config), GCP, and identity (github/okta).

Types

type Framework

type Framework struct{}

Framework is the in-process SOC 2 framework.

func New

func New() *Framework

New returns a fresh Framework value.

func (*Framework) Controls

func (*Framework) Controls() []core.Control

Controls implements core.Framework.

func (*Framework) ID

func (*Framework) ID() string

ID implements core.Framework.

func (*Framework) Policies

func (*Framework) Policies() []core.PolicyRef

Policies implements core.Framework.

func (*Framework) Version

func (*Framework) Version() string

Version implements core.Framework.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL