Skip to content

hallucinaut/securitycontrol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

securitycontrol - Security Control Validation Engine

Go License

Validate and test security controls to ensure they are working effectively.

Go beyond configuration checks to validate that security controls actually work.

πŸš€ Features

  • Control Validation: Test security controls to verify effectiveness
  • Control Management: Manage security controls and frameworks
  • Validation Testing: Execute validation tests on controls
  • Effectiveness Scoring: Score control effectiveness
  • Issue Detection: Identify control gaps and issues
  • Report Generation: Generate validation reports

πŸ“¦ Installation

Build from Source

git clone https://github.com/hallucinaut/securitycontrol.git
cd securitycontrol
go build -o securitycontrol ./cmd/securitycontrol
sudo mv securitycontrol /usr/local/bin/

Install via Go

go install github.com/hallucinaut/securitycontrol/cmd/securitycontrol@latest

🎯 Usage

Validate Controls

# Validate all security controls
securitycontrol validate

Test Specific Control

# Test a specific control
securitycontrol test ctrl-001

List Controls

# List available controls
securitycontrol controls

Generate Report

# Generate validation report
securitycontrol report

Check Status

# Check control status
securitycontrol status

Programmatic Usage

package main

import (
    "fmt"
    "github.com/hallucinaut/securitycontrol/pkg/control"
    "github.com/hallucinaut/securitycontrol/pkg/validate"
)

func main() {
    // Create control validator
    validator := control.NewControlValidator()
    
    // Add controls
    commonControls := control.CreateCommonControls()
    for _, ctrl := range commonControls {
        validator.AddControl(ctrl)
    }
    
    // Validate controls
    for _, ctrl := range commonControls {
        result := validator.ValidateControl(ctrl.ID)
        if result != nil {
            fmt.Printf("Control: %s\n", result.ControlName)
            fmt.Printf("Status: %s\n", result.Status)
            fmt.Printf("Effectiveness: %.1f%%\n", result.Effectiveness*100)
        }
    }
    
    // Create test validator
    testValidator := validate.NewControlValidator()
    
    // Add tests
    commonTests := validate.CreateCommonControlTests()
    for _, test := range commonTests {
        testValidator.AddControlTest(test)
    }
    
    // Run validation
    results := testValidator.Validate()
    fmt.Printf("Validation Results: %d\n", len(results))
}

πŸ” Control Categories

Preventive Controls

Controls that prevent security incidents.

  • Access Control Policy
  • Multi-Factor Authentication
  • Network Segmentation
  • Encryption

Detective Controls

Controls that detect security incidents.

  • Security Monitoring
  • Intrusion Detection
  • Log Analysis
  • Anomaly Detection

Corrective Controls

Controls that correct security incidents.

  • Incident Response
  • Backup and Recovery
  • System Restoration
  • Data Recovery

Deterrent Controls

Controls that discourage security violations.

  • Security Awareness
  • Warning Messages
  • Security Policies
  • Legal Agreements

Recovery Controls

Controls that restore systems after incidents.

  • Disaster Recovery
  • Business Continuity
  • System Redundancy
  • Failover Systems

πŸ§ͺ Validation Methods

Method Description Example
Documentation Review policy documents Check access control policy
Interview Interview control owners Discuss incident response procedures
Observation Observe control operation Watch monitoring systems
Testing Execute control tests Test authentication
Automation Automated validation scripts Run security scanners

πŸ“Š Control Status

Status Description Action
Implemented Control is active Verify effectiveness
Partially Implemented Control is partially active Complete implementation
Not Implemented Control is not active Plan implementation
Deprecated Control is outdated Replace with modern control

πŸ₯ Effectiveness Scoring

Score Status Action
β‰₯90% EFFECTIVE Maintain current state
70-89% PARTIALLY_EFFECTIVE Improve implementation
<70% INEFFECTIVE Significant improvement needed

πŸ§ͺ Testing

# Run all tests
go test ./...

# Run with coverage
go test -cover ./...

# Run specific test
go test -v ./pkg/control -run TestValidateControl

πŸ“‹ Example Output

$ securitycontrol validate

Security Control Validation
==========================

Controls to Validate:
  [1] Access Control Policy (preventive)
  [2] Multi-Factor Authentication (preventive)
  [3] Security Monitoring (detective)
  [4] Incident Response Plan (corrective)

Running Validation...

[EFFECTIVE] Access Control Policy
    Effectiveness: 90.0%
    Confidence: 85.0%

[PARTIALLY_EFFECTIVE] Multi-Factor Authentication
    Effectiveness: 75.0%
    Confidence: 80.0%

=== Security Control Validation Report ===

Validation Results:

[1] Access Control Policy
    ID: ctrl-001
    Status: EFFECTIVE
    Effectiveness: 90.0%
    Confidence: 85.0%

πŸ—οΈ Architecture

securitycontrol/
β”œβ”€β”€ cmd/
β”‚   └── securitycontrol/
β”‚       └── main.go          # CLI entry point
β”œβ”€β”€ pkg/
β”‚   β”œβ”€β”€ control/
β”‚   β”‚   β”œβ”€β”€ control.go      # Control definitions
β”‚   β”‚   └── control_test.go # Unit tests
β”‚   └── validate/
β”‚       β”œβ”€β”€ validate.go     # Control validation
β”‚       └── validate_test.go # Unit tests
└── README.md

πŸ”’ Security Use Cases

  • Control Testing: Validate security controls are working
  • Compliance Audits: Test controls for compliance requirements
  • Security Assessments: Evaluate control effectiveness
  • Risk Management: Assess residual risk after controls
  • Continuous Monitoring: Ongoing control validation
  • Third-Party Validation: Independent control verification

πŸ›‘οΈ Best Practices

  1. Validate controls regularly - Don't just configure them
  2. Test in isolation - Validate individual controls
  3. Document test results - Keep validation records
  4. Use multiple methods - Combine testing approaches
  5. Measure effectiveness - Quantify control performance
  6. Continuous validation - Ongoing testing and monitoring

πŸ“„ License

MIT License

πŸ™ Acknowledgments

  • Security control frameworks (NIST, CIS, ISO 27001)
  • Security practitioners
  • Control validation researchers

πŸ”— Resources


Built with GPU by hallucinaut

About

Validate and test security controls to ensure they are working effectively

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages