Skip to content

feat: add AWS account, network, and logging security checks - #26

Merged
ccleberg merged 2 commits into
mainfrom
feat/aws-security-checks
Jul 29, 2026
Merged

feat: add AWS account, network, and logging security checks#26
ccleberg merged 2 commits into
mainfrom
feat/aws-security-checks

Conversation

@ccleberg

Copy link
Copy Markdown
Member

Summary

Deepens the AWS audit (4 → 8 checks) with account-, network-, and logging-level security posture. Same pattern as the GitHub deepening; no new dependencies.

Check Collects Default
account_security IAM account summary — root MFA, root access keys, resource counts on
security_groups SG ingress rules open to 0.0.0.0/0 / ::/0, across all regions (one row per open rule) on
cloudtrail Trail logging status, multi-region, log-file validation on
config_recorders AWS Config recording status per region (flags gaps) on
  • New api.enabled_regions() helper for the region-scoped checks; each region is skipped independently on error so one bad region doesn't abort the check.
  • security_groups and config_recorders are findings-oriented — they only surface open rules / recording gaps.

Wired

  • aws_runner.CHECKS (now 8; 7 on by default, SSO still off) and applications/aws/audit.py, so both the TUI and the standalone CLI pick them up.
  • README output table + permission notes updated (the SecurityAudit managed policy covers the read permissions).

Testing

  • pytest — 50 passing (added 6 mocked-boto3 unit tests for the new collectors: root-MFA parsing, CloudTrail status, Config recording + gap reporting, and the open-vs-scoped security-group logic).
  • ruff clean; audit.py runs standalone.

Note

  • The region-scanning checks (security_groups, config_recorders) hit every enabled region, so they're slower on multi-region accounts — documented, and deselectable in the TUI. Couldn't run against a live account from here, so a real run is worth it to confirm field mappings (esp. the CloudTrail/Config shapes).

ccleberg added 2 commits July 29, 2026 12:10
Deepen the AWS audit with four new collectors:

- account_security: IAM account summary (root MFA, root access keys, resource
  counts).
- security_groups: security-group ingress rules open to 0.0.0.0/0 or ::/0,
  scanned across all enabled regions (one row per open rule).
- cloudtrail: trail logging status, multi-region, log-file validation.
- config_recorders: AWS Config recording status per region, flagging gaps.

Add an enabled_regions() helper for the region-scoped checks (each region is
skipped independently on error). Wire the checks into aws_runner and audit.py,
add mocked-boto3 unit tests, and update the README scope/permission notes.
The AWS collectors import botocore directly, and credentials from `aws login` /
IAM Identity Center use the AWS Common Runtime (CRT) credential provider, which
needs the `crt` extra (awscrt). Without it, any AWS call fails with
MissingDependencyException. Declare botocore[crt] and document the requirement.
@ccleberg
ccleberg force-pushed the feat/aws-security-checks branch from 2eea4dd to 1092629 Compare July 29, 2026 17:25
@sonarqubecloud

Copy link
Copy Markdown

@ccleberg
ccleberg merged commit ba6271a into main Jul 29, 2026
3 checks passed
@ccleberg
ccleberg deleted the feat/aws-security-checks branch July 29, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant