<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
---
name: performing-secure-code-review
description: >-
  Conduct systematic security-focused code reviews to identify vulnerabilities before deployment.
domain: cybersecurity
subdomain: secure-coding
tags:
  - code-review
  - security-review
  - sdlc
  - secure-coding
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1190"]
---

# Performing Secure Code Review

## Overview

Conduct systematic security-focused code reviews to identify vulnerabilities before deployment.

## Prerequisites

| Requirement | Install |
|---|---|
| Semgrep | `pip install semgrep` |
| OWASP code review guide | Reference |
| Python 3.10+ | For agent tooling |

## Key Concepts

Secure code review examines source for security flaws. Combines
SAST with manual review of auth, crypto, and data handling.

## Quick Reference

```bash
semgrep --config=p/owasp-top-ten src/
node agent.js review --file auth.py --checklist owasp
node agent.js scan --directory src/ --rules security
node agent.js diff-review --branch feature-auth --base main
```

## Workflow

1. Run SAST
2. Review auth logic
3. Check input validation
4. Review crypto
5. Check error handling
6. Review deps
7. Track remediation

## Detection

```yaml
title: Secure Code Review Detection
id: d30483f4-906a-4503-8931-a2e9de4861bf
status: experimental
description: Detects suspicious activity related to performing secure code review techniques in secure coding context
logsource:
  category: application
  product: webserver
detection:
  selection:
    EventType: error
  condition: selection
level: medium
tags:
  - attack.t1190
  - attack.initial_access
falsepositives:
  - Static analysis tools scanning source code repositories
```

## Verification

- SAST no false negatives
- Auth edge cases
- Input validation complete
- Approved algorithms
- Track to resolution

## References

- OWASP Testing Guide — https://owasp.org/www-project-web-security-testing-guide/
- MITRE ATT&CK — https://attack.mitre.org/
- NIST SP 800-53 — https://csf.tools/reference/nist-sp-800-53/
