soc2

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 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"
	PolicyGCSBucketUniformAccess         = "soc2.cc6.7.gcs_bucket_uniform_access"
	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.

View Source
const (
	PolicyGitHubBranchProtection = "soc2.cc6.6.github_branch_protection_on_default"
	PolicyGitHubMembers2FA       = "soc2.cc6.1.github_org_members_have_2fa"
	PolicyOktaUsersMFA           = "soc2.cc6.1.okta_users_have_mfa"
	PolicyOktaAppsMFA            = "soc2.cc6.7.okta_apps_require_mfa"
)

Identity-source policy IDs. These four policies demonstrate the github and okta source plugins under their natural SOC 2 controls.

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 PolicyMFAEnforced = "soc2.cc6.1.mfa_enforced"

PolicyMFAEnforced is the automated policy demonstrating aws.iam → user_record consumption.

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

PolicyMFAUnion is the cross-source policy demonstrating slot union: the user_directory slot binds multiple sources (in M6's fixture, only aws.iam is registered, but the slot's cardinality is `one-or-more` so a second source can be added without policy change).

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).

View Source
const PolicyS3BucketEncrypted = "soc2.cc6.7.s3_bucket_encrypted"

PolicyS3BucketEncrypted is the policy that fails when any S3 bucket has no default server-side encryption (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