blockmine 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.en.md +427 -0
- package/README.md +40 -0
- package/backend/cli.js +1 -1
- package/backend/src/ai/plugin-assistant-system-prompt.md +664 -5
- package/backend/src/api/routes/bots.js +13 -0
- package/backend/src/api/routes/servers.js +14 -2
- package/backend/src/core/BotProcess.js +98 -2
- package/backend/src/core/PluginLoader.js +83 -3
- package/backend/src/core/PluginManager.js +75 -5
- package/backend/src/core/services/BotLifecycleService.js +186 -2
- package/backend/src/server.js +11 -1
- package/frontend/dist/assets/browser-ponyfill-DN7pwmHT.js +2 -0
- package/frontend/dist/assets/index-LSy71uwm.js +11261 -0
- package/frontend/dist/assets/index-SfhKxI4-.css +32 -0
- package/frontend/dist/flags/en.svg +32 -0
- package/frontend/dist/flags/ru.svg +5 -0
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/locales/en/admin.json +100 -0
- package/frontend/dist/locales/en/api-keys.json +58 -0
- package/frontend/dist/locales/en/bots.json +110 -0
- package/frontend/dist/locales/en/common.json +47 -0
- package/frontend/dist/locales/en/configuration.json +22 -0
- package/frontend/dist/locales/en/console.json +10 -0
- package/frontend/dist/locales/en/dashboard.json +85 -0
- package/frontend/dist/locales/en/dialogs.json +70 -0
- package/frontend/dist/locales/en/event-graphs.json +50 -0
- package/frontend/dist/locales/en/graph-store.json +70 -0
- package/frontend/dist/locales/en/login.json +34 -0
- package/frontend/dist/locales/en/management.json +114 -0
- package/frontend/dist/locales/en/minecraft-viewer.json +27 -0
- package/frontend/dist/locales/en/nodes.json +1077 -0
- package/frontend/dist/locales/en/permissions.json +50 -0
- package/frontend/dist/locales/en/plugin-detail.json +49 -0
- package/frontend/dist/locales/en/plugins.json +110 -0
- package/frontend/dist/locales/en/proxies.json +81 -0
- package/frontend/dist/locales/en/servers.json +39 -0
- package/frontend/dist/locales/en/setup.json +17 -0
- package/frontend/dist/locales/en/sidebar.json +27 -0
- package/frontend/dist/locales/en/tasks.json +62 -0
- package/frontend/dist/locales/en/visual-editor.json +219 -0
- package/frontend/dist/locales/en/websocket.json +86 -0
- package/frontend/dist/locales/ru/admin.json +100 -0
- package/frontend/dist/locales/ru/api-keys.json +58 -0
- package/frontend/dist/locales/ru/bots.json +110 -0
- package/frontend/dist/locales/ru/common.json +49 -0
- package/frontend/dist/locales/ru/configuration.json +22 -0
- package/frontend/dist/locales/ru/console.json +10 -0
- package/frontend/dist/locales/ru/dashboard.json +85 -0
- package/frontend/dist/locales/ru/dialogs.json +70 -0
- package/frontend/dist/locales/ru/event-graphs.json +50 -0
- package/frontend/dist/locales/ru/graph-store.json +70 -0
- package/frontend/dist/locales/ru/login.json +34 -0
- package/frontend/dist/locales/ru/management.json +114 -0
- package/frontend/dist/locales/ru/minecraft-viewer.json +27 -0
- package/frontend/dist/locales/ru/nodes.json +1077 -0
- package/frontend/dist/locales/ru/permissions.json +50 -0
- package/frontend/dist/locales/ru/plugin-detail.json +49 -0
- package/frontend/dist/locales/ru/plugins.json +110 -0
- package/frontend/dist/locales/ru/proxies.json +81 -0
- package/frontend/dist/locales/ru/servers.json +39 -0
- package/frontend/dist/locales/ru/setup.json +17 -0
- package/frontend/dist/locales/ru/sidebar.json +27 -0
- package/frontend/dist/locales/ru/tasks.json +62 -0
- package/frontend/dist/locales/ru/visual-editor.json +221 -0
- package/frontend/dist/locales/ru/websocket.json +86 -0
- package/frontend/dist/monacoeditorwork/css.worker.bundle.js +7 -7
- package/frontend/dist/monacoeditorwork/html.worker.bundle.js +7 -7
- package/frontend/dist/monacoeditorwork/json.worker.bundle.js +7 -7
- package/frontend/dist/monacoeditorwork/ts.worker.bundle.js +3 -3
- package/frontend/package.json +4 -0
- package/package.json +1 -1
- package/screen/3dviewer.png +0 -0
- package/screen/console.png +0 -0
- package/screen/dashboard.png +0 -0
- package/screen/graph_collabe.png +0 -0
- package/screen/graph_live_debug.png +0 -0
- package/screen/language_selector.png +0 -0
- package/screen/management_command.png +0 -0
- package/screen/node_debug_trace.png +0 -0
- package/screen/plugin_/320/276/320/261/320/267/320/276/321/200.png +0 -0
- package/screen/websocket.png +0 -0
- package/screen//320/275/320/260/321/201/321/202/321/200/320/276/320/271/320/272/320/270_/320/276/321/202/320/264/320/265/320/273/321/214/320/275/321/213/321/205_/320/272/320/276/320/274/320/260/320/275/320/264_/320/272/320/260/320/266/320/264/321/203_/320/272/320/276/320/274/320/260/320/275/320/273/320/264/321/203_/320/274/320/276/320/266/320/275/320/276_/320/275/320/260/321/201/321/202/321/200/320/260/320/270/320/262/320/260/321/202/321/214.png +0 -0
- package/screen//320/277/320/273/320/260/320/275/320/270/321/200/320/276/320/262/321/211/320/270/320/272_/320/274/320/276/320/266/320/275/320/276_/320/267/320/260/320/264/320/260/320/262/320/260/321/202/321/214_/320/264/320/265/320/271/321/201/321/202/320/262/320/270/321/217_/320/277/320/276_/320/262/321/200/320/265/320/274/320/265/320/275/320/270.png +0 -0
- package/.claude/agents/README.md +0 -469
- package/.claude/agents/auth-route-debugger.md +0 -118
- package/.claude/agents/auth-route-tester.md +0 -93
- package/.claude/agents/auto-error-resolver.md +0 -97
- package/.claude/agents/build-optimizer.md +0 -236
- package/.claude/agents/code-architect.md +0 -34
- package/.claude/agents/code-architecture-reviewer.md +0 -83
- package/.claude/agents/code-explorer.md +0 -51
- package/.claude/agents/code-refactor-master.md +0 -94
- package/.claude/agents/code-reviewer.md +0 -46
- package/.claude/agents/cost-optimizer.md +0 -134
- package/.claude/agents/deployment-orchestrator.md +0 -113
- package/.claude/agents/documentation-architect.md +0 -82
- package/.claude/agents/frontend-error-fixer.md +0 -77
- package/.claude/agents/iac-code-generator.md +0 -71
- package/.claude/agents/incident-responder.md +0 -346
- package/.claude/agents/infrastructure-architect.md +0 -31
- package/.claude/agents/kubernetes-specialist.md +0 -56
- package/.claude/agents/migration-planner.md +0 -181
- package/.claude/agents/network-architect.md +0 -196
- package/.claude/agents/plan-reviewer.md +0 -52
- package/.claude/agents/refactor-planner.md +0 -63
- package/.claude/agents/security-scanner.md +0 -102
- package/.claude/agents/web-research-specialist.md +0 -78
- package/.claude/commands/cost-analysis.md +0 -315
- package/.claude/commands/dev-docs-update.md +0 -55
- package/.claude/commands/dev-docs.md +0 -51
- package/.claude/commands/feature-dev.md +0 -125
- package/.claude/commands/incident-debug.md +0 -247
- package/.claude/commands/infra-plan.md +0 -81
- package/.claude/commands/migration-plan.md +0 -478
- package/.claude/commands/route-research-for-testing.md +0 -37
- package/.claude/commands/security-review.md +0 -66
- package/.claude/hooks/CONFIG.md +0 -448
- package/.claude/hooks/README.md +0 -163
- package/.claude/hooks/SKILL_ACTIVATION_COMPLETE.md +0 -226
- package/.claude/hooks/WINDOWS_HOOKS_README.md +0 -151
- package/.claude/hooks/add-skill-activation-banners.ts +0 -132
- package/.claude/hooks/comprehensive-skill-test.ts +0 -1315
- package/.claude/hooks/error-handling-reminder.sh +0 -12
- package/.claude/hooks/error-handling-reminder.ts +0 -222
- package/.claude/hooks/k8s-manifest-validator.sh +0 -56
- package/.claude/hooks/package-lock.json +0 -556
- package/.claude/hooks/package.json +0 -16
- package/.claude/hooks/post-tool-use-tracker.ps1 +0 -174
- package/.claude/hooks/post-tool-use-tracker.sh +0 -183
- package/.claude/hooks/security-policy-check.sh +0 -247
- package/.claude/hooks/skill-activation-prompt.ps1 +0 -10
- package/.claude/hooks/skill-activation-prompt.sh +0 -10
- package/.claude/hooks/skill-activation-prompt.ts +0 -141
- package/.claude/hooks/stop-build-check-enhanced.sh +0 -130
- package/.claude/hooks/terraform-validator.sh +0 -53
- package/.claude/hooks/test-input.json +0 -7
- package/.claude/hooks/test-skill-activation.ts +0 -427
- package/.claude/hooks/trigger-build-resolver.sh +0 -79
- package/.claude/hooks/tsc-check.sh +0 -173
- package/.claude/hooks/tsconfig.json +0 -19
- package/.claude/settings.json +0 -59
- package/.claude/settings.local.json +0 -67
- package/.claude/skills/README.md +0 -507
- package/.claude/skills/api-engineering/SKILL.md +0 -63
- package/.claude/skills/api-engineering/resources/api-versioning.md +0 -88
- package/.claude/skills/api-engineering/resources/graphql-patterns.md +0 -106
- package/.claude/skills/api-engineering/resources/rate-limiting.md +0 -118
- package/.claude/skills/api-engineering/resources/rest-api-design.md +0 -105
- package/.claude/skills/backend-dev-guidelines/SKILL.md +0 -306
- package/.claude/skills/backend-dev-guidelines/resources/architecture-overview.md +0 -451
- package/.claude/skills/backend-dev-guidelines/resources/async-and-errors.md +0 -307
- package/.claude/skills/backend-dev-guidelines/resources/complete-examples.md +0 -638
- package/.claude/skills/backend-dev-guidelines/resources/configuration.md +0 -275
- package/.claude/skills/backend-dev-guidelines/resources/database-patterns.md +0 -224
- package/.claude/skills/backend-dev-guidelines/resources/middleware-guide.md +0 -213
- package/.claude/skills/backend-dev-guidelines/resources/routing-and-controllers.md +0 -756
- package/.claude/skills/backend-dev-guidelines/resources/sentry-and-monitoring.md +0 -336
- package/.claude/skills/backend-dev-guidelines/resources/services-and-repositories.md +0 -789
- package/.claude/skills/backend-dev-guidelines/resources/testing-guide.md +0 -235
- package/.claude/skills/backend-dev-guidelines/resources/validation-patterns.md +0 -754
- package/.claude/skills/budget-and-cost-management/SKILL.md +0 -850
- package/.claude/skills/build-engineering/SKILL.md +0 -431
- package/.claude/skills/build-engineering/resources/artifact-repositories.md +0 -72
- package/.claude/skills/build-engineering/resources/build-caching.md +0 -96
- package/.claude/skills/build-engineering/resources/build-pipelines.md +0 -105
- package/.claude/skills/build-engineering/resources/build-security.md +0 -95
- package/.claude/skills/build-engineering/resources/build-systems.md +0 -389
- package/.claude/skills/build-engineering/resources/compilation-optimization.md +0 -201
- package/.claude/skills/build-engineering/resources/dependency-management.md +0 -73
- package/.claude/skills/build-engineering/resources/monorepo-builds.md +0 -110
- package/.claude/skills/build-engineering/resources/performance-optimization.md +0 -113
- package/.claude/skills/build-engineering/resources/reproducible-builds.md +0 -82
- package/.claude/skills/cloud-engineering/SKILL.md +0 -675
- package/.claude/skills/cloud-engineering/resources/aws-patterns.md +0 -742
- package/.claude/skills/cloud-engineering/resources/azure-patterns.md +0 -714
- package/.claude/skills/cloud-engineering/resources/cleared-cloud-environments.md +0 -987
- package/.claude/skills/cloud-engineering/resources/cloud-cost-optimization.md +0 -757
- package/.claude/skills/cloud-engineering/resources/cloud-networking.md +0 -1058
- package/.claude/skills/cloud-engineering/resources/cloud-security-tools.md +0 -1530
- package/.claude/skills/cloud-engineering/resources/cloud-security.md +0 -990
- package/.claude/skills/cloud-engineering/resources/gcp-patterns.md +0 -758
- package/.claude/skills/cloud-engineering/resources/migration-strategies.md +0 -820
- package/.claude/skills/cloud-engineering/resources/multi-cloud-strategies.md +0 -670
- package/.claude/skills/cloud-engineering/resources/oci-patterns.md +0 -1198
- package/.claude/skills/cloud-engineering/resources/serverless-patterns.md +0 -795
- package/.claude/skills/cloud-engineering/resources/well-architected-frameworks.md +0 -966
- package/.claude/skills/cybersecurity/SKILL.md +0 -409
- package/.claude/skills/cybersecurity/resources/security-architecture.md +0 -266
- package/.claude/skills/database-engineering/SKILL.md +0 -61
- package/.claude/skills/database-engineering/resources/backup-and-recovery.md +0 -72
- package/.claude/skills/database-engineering/resources/database-replication.md +0 -63
- package/.claude/skills/database-engineering/resources/postgresql-fundamentals.md +0 -70
- package/.claude/skills/database-engineering/resources/query-optimization.md +0 -68
- package/.claude/skills/devsecops/SKILL.md +0 -374
- package/.claude/skills/devsecops/resources/ci-cd-security.md +0 -204
- package/.claude/skills/devsecops/resources/compliance-automation.md +0 -530
- package/.claude/skills/devsecops/resources/compliance-frameworks.md +0 -2322
- package/.claude/skills/devsecops/resources/container-security.md +0 -915
- package/.claude/skills/devsecops/resources/cspm-integration.md +0 -1440
- package/.claude/skills/devsecops/resources/policy-enforcement.md +0 -619
- package/.claude/skills/devsecops/resources/secrets-management.md +0 -755
- package/.claude/skills/devsecops/resources/security-monitoring.md +0 -146
- package/.claude/skills/devsecops/resources/security-scanning.md +0 -887
- package/.claude/skills/devsecops/resources/security-testing.md +0 -203
- package/.claude/skills/devsecops/resources/supply-chain-security.md +0 -518
- package/.claude/skills/devsecops/resources/vulnerability-management.md +0 -481
- package/.claude/skills/devsecops/resources/zero-trust-architecture.md +0 -177
- package/.claude/skills/documentation-as-code/SKILL.md +0 -323
- package/.claude/skills/documentation-as-code/resources/api-documentation.md +0 -90
- package/.claude/skills/documentation-as-code/resources/changelog-management.md +0 -79
- package/.claude/skills/documentation-as-code/resources/diagram-generation.md +0 -44
- package/.claude/skills/documentation-as-code/resources/docs-as-code-workflow.md +0 -99
- package/.claude/skills/documentation-as-code/resources/documentation-automation.md +0 -68
- package/.claude/skills/documentation-as-code/resources/documentation-sites.md +0 -79
- package/.claude/skills/documentation-as-code/resources/markdown-best-practices.md +0 -162
- package/.claude/skills/documentation-as-code/resources/openapi-specification.md +0 -77
- package/.claude/skills/documentation-as-code/resources/readme-engineering.md +0 -60
- package/.claude/skills/documentation-as-code/resources/technical-writing-guide.md +0 -202
- package/.claude/skills/engineering-management/SKILL.md +0 -356
- package/.claude/skills/engineering-management/resources/career-ladders.md +0 -609
- package/.claude/skills/engineering-management/resources/hiring-and-assessment.md +0 -555
- package/.claude/skills/engineering-management/resources/one-on-one-guides.md +0 -609
- package/.claude/skills/engineering-management/resources/resource-planning.md +0 -557
- package/.claude/skills/engineering-management/resources/team-organization-patterns.md +0 -491
- package/.claude/skills/engineering-management/resources/technical-interviews.md +0 -474
- package/.claude/skills/engineering-operations-management/SKILL.md +0 -817
- package/.claude/skills/error-tracking/SKILL.md +0 -379
- package/.claude/skills/frontend-design/SKILL.md +0 -42
- package/.claude/skills/frontend-dev-guidelines/SKILL.md +0 -403
- package/.claude/skills/frontend-dev-guidelines/resources/common-patterns.md +0 -331
- package/.claude/skills/frontend-dev-guidelines/resources/complete-examples.md +0 -872
- package/.claude/skills/frontend-dev-guidelines/resources/component-patterns.md +0 -502
- package/.claude/skills/frontend-dev-guidelines/resources/data-fetching.md +0 -767
- package/.claude/skills/frontend-dev-guidelines/resources/file-organization.md +0 -502
- package/.claude/skills/frontend-dev-guidelines/resources/loading-and-error-states.md +0 -501
- package/.claude/skills/frontend-dev-guidelines/resources/performance.md +0 -406
- package/.claude/skills/frontend-dev-guidelines/resources/routing-guide.md +0 -364
- package/.claude/skills/frontend-dev-guidelines/resources/styling-guide.md +0 -428
- package/.claude/skills/frontend-dev-guidelines/resources/typescript-standards.md +0 -418
- package/.claude/skills/general-it-engineering/SKILL.md +0 -393
- package/.claude/skills/general-it-engineering/resources/asset-management.md +0 -712
- package/.claude/skills/general-it-engineering/resources/automation-orchestration.md +0 -817
- package/.claude/skills/general-it-engineering/resources/business-continuity.md +0 -786
- package/.claude/skills/general-it-engineering/resources/change-management.md +0 -715
- package/.claude/skills/general-it-engineering/resources/enterprise-monitoring.md +0 -729
- package/.claude/skills/general-it-engineering/resources/help-desk-operations.md +0 -738
- package/.claude/skills/general-it-engineering/resources/incident-service-management.md +0 -834
- package/.claude/skills/general-it-engineering/resources/it-governance.md +0 -753
- package/.claude/skills/general-it-engineering/resources/itil-framework.md +0 -503
- package/.claude/skills/general-it-engineering/resources/service-management.md +0 -669
- package/.claude/skills/infrastructure-architecture/SKILL.md +0 -328
- package/.claude/skills/infrastructure-architecture/resources/architecture-decision-records.md +0 -505
- package/.claude/skills/infrastructure-architecture/resources/architecture-patterns.md +0 -528
- package/.claude/skills/infrastructure-architecture/resources/capacity-planning.md +0 -453
- package/.claude/skills/infrastructure-architecture/resources/cleared-environment-architecture.md +0 -773
- package/.claude/skills/infrastructure-architecture/resources/cost-architecture.md +0 -499
- package/.claude/skills/infrastructure-architecture/resources/data-architecture.md +0 -501
- package/.claude/skills/infrastructure-architecture/resources/disaster-recovery.md +0 -535
- package/.claude/skills/infrastructure-architecture/resources/migration-architecture.md +0 -512
- package/.claude/skills/infrastructure-architecture/resources/multi-region-design.md +0 -608
- package/.claude/skills/infrastructure-architecture/resources/reference-architectures.md +0 -562
- package/.claude/skills/infrastructure-architecture/resources/security-architecture.md +0 -538
- package/.claude/skills/infrastructure-architecture/resources/system-design-principles.md +0 -489
- package/.claude/skills/infrastructure-architecture/resources/workload-classification.md +0 -1000
- package/.claude/skills/infrastructure-strategy/SKILL.md +0 -924
- package/.claude/skills/network-engineering/SKILL.md +0 -385
- package/.claude/skills/network-engineering/resources/dns-management.md +0 -738
- package/.claude/skills/network-engineering/resources/load-balancing.md +0 -820
- package/.claude/skills/network-engineering/resources/network-architecture.md +0 -546
- package/.claude/skills/network-engineering/resources/network-security.md +0 -921
- package/.claude/skills/network-engineering/resources/network-troubleshooting.md +0 -749
- package/.claude/skills/network-engineering/resources/routing-switching.md +0 -373
- package/.claude/skills/network-engineering/resources/sdn-networking.md +0 -695
- package/.claude/skills/network-engineering/resources/service-mesh-networking.md +0 -777
- package/.claude/skills/network-engineering/resources/tcp-ip-protocols.md +0 -444
- package/.claude/skills/network-engineering/resources/vpn-connectivity.md +0 -672
- package/.claude/skills/node-development/SKILL.md +0 -317
- package/.claude/skills/observability-engineering/SKILL.md +0 -101
- package/.claude/skills/observability-engineering/resources/apm-tools.md +0 -97
- package/.claude/skills/observability-engineering/resources/correlation-strategies.md +0 -87
- package/.claude/skills/observability-engineering/resources/distributed-tracing.md +0 -98
- package/.claude/skills/observability-engineering/resources/logs-aggregation.md +0 -118
- package/.claude/skills/observability-engineering/resources/observability-cost-optimization.md +0 -141
- package/.claude/skills/observability-engineering/resources/opentelemetry.md +0 -110
- package/.claude/skills/platform-engineering/SKILL.md +0 -555
- package/.claude/skills/platform-engineering/resources/architecture-overview.md +0 -600
- package/.claude/skills/platform-engineering/resources/container-orchestration.md +0 -916
- package/.claude/skills/platform-engineering/resources/cost-optimization.md +0 -634
- package/.claude/skills/platform-engineering/resources/developer-platforms.md +0 -670
- package/.claude/skills/platform-engineering/resources/gitops-automation.md +0 -650
- package/.claude/skills/platform-engineering/resources/infrastructure-as-code.md +0 -778
- package/.claude/skills/platform-engineering/resources/infrastructure-standards.md +0 -708
- package/.claude/skills/platform-engineering/resources/multi-tenancy.md +0 -602
- package/.claude/skills/platform-engineering/resources/platform-security.md +0 -711
- package/.claude/skills/platform-engineering/resources/resource-management.md +0 -592
- package/.claude/skills/platform-engineering/resources/service-mesh.md +0 -628
- package/.claude/skills/release-engineering/SKILL.md +0 -393
- package/.claude/skills/release-engineering/resources/artifact-management.md +0 -108
- package/.claude/skills/release-engineering/resources/build-optimization.md +0 -84
- package/.claude/skills/release-engineering/resources/ci-cd-pipelines.md +0 -411
- package/.claude/skills/release-engineering/resources/deployment-strategies.md +0 -197
- package/.claude/skills/release-engineering/resources/pipeline-security.md +0 -62
- package/.claude/skills/release-engineering/resources/progressive-delivery.md +0 -83
- package/.claude/skills/release-engineering/resources/release-automation.md +0 -68
- package/.claude/skills/release-engineering/resources/release-orchestration.md +0 -77
- package/.claude/skills/release-engineering/resources/rollback-strategies.md +0 -66
- package/.claude/skills/release-engineering/resources/versioning-strategies.md +0 -59
- package/.claude/skills/route-tester/SKILL.md +0 -392
- package/.claude/skills/skill-developer/ADVANCED.md +0 -197
- package/.claude/skills/skill-developer/HOOK_MECHANISMS.md +0 -306
- package/.claude/skills/skill-developer/PATTERNS_LIBRARY.md +0 -152
- package/.claude/skills/skill-developer/SKILL.md +0 -430
- package/.claude/skills/skill-developer/SKILL_RULES_REFERENCE.md +0 -315
- package/.claude/skills/skill-developer/TRIGGER_TYPES.md +0 -305
- package/.claude/skills/skill-developer/TROUBLESHOOTING.md +0 -514
- package/.claude/skills/skill-rules.json +0 -2989
- package/.claude/skills/sre/SKILL.md +0 -464
- package/.claude/skills/sre/resources/alerting-best-practices.md +0 -282
- package/.claude/skills/sre/resources/capacity-planning.md +0 -226
- package/.claude/skills/sre/resources/chaos-engineering.md +0 -193
- package/.claude/skills/sre/resources/disaster-recovery.md +0 -232
- package/.claude/skills/sre/resources/incident-management.md +0 -436
- package/.claude/skills/sre/resources/observability-stack.md +0 -240
- package/.claude/skills/sre/resources/on-call-runbooks.md +0 -167
- package/.claude/skills/sre/resources/performance-optimization.md +0 -108
- package/.claude/skills/sre/resources/reliability-patterns.md +0 -183
- package/.claude/skills/sre/resources/slo-sli-sla.md +0 -464
- package/.claude/skills/sre/resources/toil-reduction.md +0 -145
- package/.claude/skills/systems-engineering/SKILL.md +0 -648
- package/.claude/skills/systems-engineering/resources/automation-patterns.md +0 -771
- package/.claude/skills/systems-engineering/resources/configuration-management.md +0 -998
- package/.claude/skills/systems-engineering/resources/linux-administration.md +0 -672
- package/.claude/skills/systems-engineering/resources/networking-fundamentals.md +0 -982
- package/.claude/skills/systems-engineering/resources/performance-tuning.md +0 -871
- package/.claude/skills/systems-engineering/resources/powershell-scripting.md +0 -482
- package/.claude/skills/systems-engineering/resources/security-hardening.md +0 -739
- package/.claude/skills/systems-engineering/resources/shell-scripting.md +0 -915
- package/.claude/skills/systems-engineering/resources/storage-management.md +0 -628
- package/.claude/skills/systems-engineering/resources/system-monitoring.md +0 -787
- package/.claude/skills/systems-engineering/resources/troubleshooting-guide.md +0 -753
- package/.claude/skills/systems-engineering/resources/windows-administration.md +0 -738
- package/.claude/skills/technical-leadership/SKILL.md +0 -728
- package/backend/docs/SECRETS_DOCUMENTATION.md +0 -327
- package/frontend/dist/assets/index-BC-NbKXi.css +0 -32
- package/frontend/dist/assets/index-DqJXZMHY.js +0 -11266
|
@@ -1,739 +0,0 @@
|
|
|
1
|
-
# Security Hardening
|
|
2
|
-
|
|
3
|
-
Comprehensive guide to Linux security hardening covering OS hardening, CIS benchmarks, firewall configuration, SELinux/AppArmor, SSH hardening, and vulnerability scanning.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Security Hardening Overview](#security-hardening-overview)
|
|
8
|
-
- [OS Hardening Checklist](#os-hardening-checklist)
|
|
9
|
-
- [CIS Benchmarks](#cis-benchmarks)
|
|
10
|
-
- [Firewall Configuration](#firewall-configuration)
|
|
11
|
-
- [SELinux and AppArmor](#selinux-and-apparmor)
|
|
12
|
-
- [SSH Hardening](#ssh-hardening)
|
|
13
|
-
- [File Permissions and Capabilities](#file-permissions-and-capabilities)
|
|
14
|
-
- [Audit Logging](#audit-logging)
|
|
15
|
-
- [Vulnerability Scanning](#vulnerability-scanning)
|
|
16
|
-
|
|
17
|
-
## Security Hardening Overview
|
|
18
|
-
|
|
19
|
-
### Defense in Depth
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
┌─────────────────────────────────────┐
|
|
23
|
-
│ Application Security │
|
|
24
|
-
├─────────────────────────────────────┤
|
|
25
|
-
│ Host Security (This Guide) │
|
|
26
|
-
├─────────────────────────────────────┤
|
|
27
|
-
│ Network Security │
|
|
28
|
-
├─────────────────────────────────────┤
|
|
29
|
-
│ Physical Security │
|
|
30
|
-
└─────────────────────────────────────┘
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Security Principles
|
|
34
|
-
|
|
35
|
-
- **Least Privilege**: Minimal permissions needed
|
|
36
|
-
- **Defense in Depth**: Multiple layers of security
|
|
37
|
-
- **Fail Secure**: Fail closed, not open
|
|
38
|
-
- **Separation of Duties**: No single point of control
|
|
39
|
-
- **Audit Everything**: Log all security events
|
|
40
|
-
|
|
41
|
-
## OS Hardening Checklist
|
|
42
|
-
|
|
43
|
-
### Initial Setup
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# 1. Update system
|
|
47
|
-
sudo apt update && sudo apt upgrade -y
|
|
48
|
-
|
|
49
|
-
# 2. Enable automatic security updates
|
|
50
|
-
sudo apt install unattended-upgrades
|
|
51
|
-
sudo dpkg-reconfigure -plow unattended-upgrades
|
|
52
|
-
|
|
53
|
-
# 3. Remove unnecessary packages
|
|
54
|
-
sudo apt autoremove --purge
|
|
55
|
-
|
|
56
|
-
# 4. Disable unnecessary services
|
|
57
|
-
sudo systemctl list-unit-files --type=service --state=enabled
|
|
58
|
-
sudo systemctl disable <service>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### User and Access Control
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# 1. Disable root login
|
|
65
|
-
sudo passwd -l root
|
|
66
|
-
|
|
67
|
-
# 2. Create admin user with sudo
|
|
68
|
-
sudo useradd -m -s /bin/bash admin
|
|
69
|
-
sudo usermod -aG sudo admin
|
|
70
|
-
|
|
71
|
-
# 3. Set strong password policy
|
|
72
|
-
# /etc/security/pwquality.conf
|
|
73
|
-
minlen = 14
|
|
74
|
-
dcredit = -1 # At least 1 digit
|
|
75
|
-
ucredit = -1 # At least 1 uppercase
|
|
76
|
-
lcredit = -1 # At least 1 lowercase
|
|
77
|
-
ocredit = -1 # At least 1 special char
|
|
78
|
-
|
|
79
|
-
# 4. Set password aging
|
|
80
|
-
sudo chage -M 90 -m 7 -W 14 username
|
|
81
|
-
# Max age: 90 days, Min age: 7 days, Warning: 14 days
|
|
82
|
-
|
|
83
|
-
# 5. Lock inactive accounts
|
|
84
|
-
sudo useradd -e 2024-12-31 tempuser # Expiration date
|
|
85
|
-
|
|
86
|
-
# 6. Review sudoers configuration
|
|
87
|
-
sudo visudo
|
|
88
|
-
# Require password for sudo
|
|
89
|
-
Defaults timestamp_timeout=5
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Network Hardening
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
# /etc/sysctl.d/99-network-security.conf
|
|
96
|
-
|
|
97
|
-
# IP forwarding (disable unless router)
|
|
98
|
-
net.ipv4.ip_forward = 0
|
|
99
|
-
net.ipv6.conf.all.forwarding = 0
|
|
100
|
-
|
|
101
|
-
# SYN flood protection
|
|
102
|
-
net.ipv4.tcp_syncookies = 1
|
|
103
|
-
net.ipv4.tcp_max_syn_backlog = 2048
|
|
104
|
-
net.ipv4.tcp_synack_retries = 2
|
|
105
|
-
|
|
106
|
-
# Ignore ICMP redirects
|
|
107
|
-
net.ipv4.conf.all.accept_redirects = 0
|
|
108
|
-
net.ipv4.conf.default.accept_redirects = 0
|
|
109
|
-
net.ipv6.conf.all.accept_redirects = 0
|
|
110
|
-
|
|
111
|
-
# Ignore source routing
|
|
112
|
-
net.ipv4.conf.all.accept_source_route = 0
|
|
113
|
-
net.ipv4.conf.default.accept_source_route = 0
|
|
114
|
-
|
|
115
|
-
# Ignore ICMP ping requests (optional)
|
|
116
|
-
net.ipv4.icmp_echo_ignore_all = 0
|
|
117
|
-
net.ipv4.icmp_echo_ignore_broadcasts = 1
|
|
118
|
-
|
|
119
|
-
# Log suspicious packets
|
|
120
|
-
net.ipv4.conf.all.log_martians = 1
|
|
121
|
-
net.ipv4.conf.default.log_martians = 1
|
|
122
|
-
|
|
123
|
-
# Reverse path filtering
|
|
124
|
-
net.ipv4.conf.all.rp_filter = 1
|
|
125
|
-
net.ipv4.conf.default.rp_filter = 1
|
|
126
|
-
|
|
127
|
-
# Apply settings
|
|
128
|
-
sudo sysctl -p /etc/sysctl.d/99-network-security.conf
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## CIS Benchmarks
|
|
132
|
-
|
|
133
|
-
### CIS Benchmark Implementation
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
#!/bin/bash
|
|
137
|
-
# cis-hardening.sh - Implement CIS benchmark controls
|
|
138
|
-
|
|
139
|
-
set -euo pipefail
|
|
140
|
-
|
|
141
|
-
echo "=== CIS Benchmark Hardening ==="
|
|
142
|
-
|
|
143
|
-
# 1.1 Filesystem Configuration
|
|
144
|
-
echo "[1] Configuring filesystems..."
|
|
145
|
-
|
|
146
|
-
# Create separate partitions (manual - document in fstab)
|
|
147
|
-
cat >> /etc/fstab <<EOF
|
|
148
|
-
# Secure mount options
|
|
149
|
-
/tmp /tmp tmpfs defaults,nodev,nosuid,noexec 0 0
|
|
150
|
-
EOF
|
|
151
|
-
|
|
152
|
-
# 1.5 Additional Process Hardening
|
|
153
|
-
echo "[2] Enabling ASLR..."
|
|
154
|
-
echo "kernel.randomize_va_space = 2" >> /etc/sysctl.d/99-cis.conf
|
|
155
|
-
|
|
156
|
-
# 1.7 Warning Banners
|
|
157
|
-
echo "[3] Configuring warning banners..."
|
|
158
|
-
cat > /etc/issue <<EOF
|
|
159
|
-
Authorized access only. All activity may be monitored and reported.
|
|
160
|
-
EOF
|
|
161
|
-
cp /etc/issue /etc/issue.net
|
|
162
|
-
|
|
163
|
-
# 3.1 Network Parameters
|
|
164
|
-
echo "[4] Configuring network parameters..."
|
|
165
|
-
cat >> /etc/sysctl.d/99-cis.conf <<EOF
|
|
166
|
-
net.ipv4.ip_forward = 0
|
|
167
|
-
net.ipv4.conf.all.send_redirects = 0
|
|
168
|
-
net.ipv4.conf.default.send_redirects = 0
|
|
169
|
-
net.ipv4.conf.all.accept_source_route = 0
|
|
170
|
-
net.ipv4.conf.all.accept_redirects = 0
|
|
171
|
-
net.ipv4.conf.all.log_martians = 1
|
|
172
|
-
net.ipv4.tcp_syncookies = 1
|
|
173
|
-
EOF
|
|
174
|
-
|
|
175
|
-
sysctl -p /etc/sysctl.d/99-cis.conf
|
|
176
|
-
|
|
177
|
-
# 4.1 Configure System Accounting (auditd)
|
|
178
|
-
echo "[5] Installing and configuring auditd..."
|
|
179
|
-
apt-get install -y auditd audispd-plugins
|
|
180
|
-
systemctl enable auditd
|
|
181
|
-
systemctl start auditd
|
|
182
|
-
|
|
183
|
-
# 5.2 Configure SSH Server
|
|
184
|
-
echo "[6] Hardening SSH..."
|
|
185
|
-
cat >> /etc/ssh/sshd_config.d/99-cis.conf <<EOF
|
|
186
|
-
Protocol 2
|
|
187
|
-
LogLevel INFO
|
|
188
|
-
X11Forwarding no
|
|
189
|
-
MaxAuthTries 4
|
|
190
|
-
IgnoreRhosts yes
|
|
191
|
-
HostbasedAuthentication no
|
|
192
|
-
PermitRootLogin no
|
|
193
|
-
PermitEmptyPasswords no
|
|
194
|
-
PermitUserEnvironment no
|
|
195
|
-
ClientAliveInterval 300
|
|
196
|
-
ClientAliveCountMax 0
|
|
197
|
-
LoginGraceTime 60
|
|
198
|
-
MaxStartups 10:30:60
|
|
199
|
-
MaxSessions 4
|
|
200
|
-
EOF
|
|
201
|
-
|
|
202
|
-
systemctl restart sshd
|
|
203
|
-
|
|
204
|
-
# 5.3 Configure PAM
|
|
205
|
-
echo "[7] Configuring PAM..."
|
|
206
|
-
apt-get install -y libpam-pwquality
|
|
207
|
-
|
|
208
|
-
# 6.1 System File Permissions
|
|
209
|
-
echo "[8] Setting secure file permissions..."
|
|
210
|
-
chmod 644 /etc/passwd
|
|
211
|
-
chmod 644 /etc/group
|
|
212
|
-
chmod 600 /etc/shadow
|
|
213
|
-
chmod 600 /etc/gshadow
|
|
214
|
-
chmod 600 /etc/ssh/sshd_config
|
|
215
|
-
|
|
216
|
-
echo "=== CIS Hardening Complete ==="
|
|
217
|
-
echo "Review and customize /etc/sysctl.d/99-cis.conf as needed"
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## Firewall Configuration
|
|
221
|
-
|
|
222
|
-
### iptables Hardening
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
#!/bin/bash
|
|
226
|
-
# firewall-rules.sh - Secure iptables configuration
|
|
227
|
-
|
|
228
|
-
# Flush existing rules
|
|
229
|
-
iptables -F
|
|
230
|
-
iptables -X
|
|
231
|
-
iptables -t nat -F
|
|
232
|
-
iptables -t nat -X
|
|
233
|
-
iptables -t mangle -F
|
|
234
|
-
iptables -t mangle -X
|
|
235
|
-
|
|
236
|
-
# Default policies
|
|
237
|
-
iptables -P INPUT DROP
|
|
238
|
-
iptables -P FORWARD DROP
|
|
239
|
-
iptables -P OUTPUT ACCEPT
|
|
240
|
-
|
|
241
|
-
# Allow loopback
|
|
242
|
-
iptables -A INPUT -i lo -j ACCEPT
|
|
243
|
-
iptables -A OUTPUT -o lo -j ACCEPT
|
|
244
|
-
|
|
245
|
-
# Allow established connections
|
|
246
|
-
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
|
247
|
-
|
|
248
|
-
# Rate limiting for SSH (prevent brute force)
|
|
249
|
-
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --set
|
|
250
|
-
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 4 -j DROP
|
|
251
|
-
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
|
|
252
|
-
|
|
253
|
-
# Allow HTTP/HTTPS
|
|
254
|
-
iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT
|
|
255
|
-
iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW -j ACCEPT
|
|
256
|
-
|
|
257
|
-
# Drop invalid packets
|
|
258
|
-
iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
|
|
259
|
-
|
|
260
|
-
# Drop fragmented packets
|
|
261
|
-
iptables -A INPUT -f -j DROP
|
|
262
|
-
|
|
263
|
-
# Drop XMAS packets
|
|
264
|
-
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
|
|
265
|
-
|
|
266
|
-
# Drop NULL packets
|
|
267
|
-
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
|
|
268
|
-
|
|
269
|
-
# Log dropped packets
|
|
270
|
-
iptables -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables-dropped: " --log-level 7
|
|
271
|
-
|
|
272
|
-
# Save rules
|
|
273
|
-
iptables-save > /etc/iptables/rules.v4
|
|
274
|
-
|
|
275
|
-
# Load on boot
|
|
276
|
-
apt-get install -y iptables-persistent
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### firewalld Configuration
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
# Install firewalld
|
|
283
|
-
sudo dnf install firewalld
|
|
284
|
-
sudo systemctl enable firewalld
|
|
285
|
-
sudo systemctl start firewalld
|
|
286
|
-
|
|
287
|
-
# Default zone
|
|
288
|
-
sudo firewall-cmd --set-default-zone=public
|
|
289
|
-
|
|
290
|
-
# Drop all by default
|
|
291
|
-
sudo firewall-cmd --zone=public --set-target=DROP --permanent
|
|
292
|
-
|
|
293
|
-
# Allow SSH with rate limiting
|
|
294
|
-
sudo firewall-cmd --permanent --zone=public --add-rich-rule='
|
|
295
|
-
rule service name="ssh"
|
|
296
|
-
limit value="4/m"
|
|
297
|
-
accept'
|
|
298
|
-
|
|
299
|
-
# Allow HTTP/HTTPS
|
|
300
|
-
sudo firewall-cmd --permanent --zone=public --add-service=http
|
|
301
|
-
sudo firewall-cmd --permanent --zone=public --add-service=https
|
|
302
|
-
|
|
303
|
-
# Block ICMP (ping)
|
|
304
|
-
sudo firewall-cmd --permanent --zone=public --add-icmp-block=echo-request
|
|
305
|
-
|
|
306
|
-
# Log dropped packets
|
|
307
|
-
sudo firewall-cmd --permanent --zone=public --add-rich-rule='
|
|
308
|
-
rule
|
|
309
|
-
log prefix="firewalld-drop: " level=info
|
|
310
|
-
drop'
|
|
311
|
-
|
|
312
|
-
# Reload firewall
|
|
313
|
-
sudo firewall-cmd --reload
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
## SELinux and AppArmor
|
|
317
|
-
|
|
318
|
-
### SELinux (RHEL/CentOS)
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
# Check SELinux status
|
|
322
|
-
getenforce
|
|
323
|
-
sestatus
|
|
324
|
-
|
|
325
|
-
# Enable SELinux
|
|
326
|
-
sudo setenforce 1 # Temporary
|
|
327
|
-
# Permanent: Edit /etc/selinux/config
|
|
328
|
-
SELINUX=enforcing
|
|
329
|
-
|
|
330
|
-
# SELinux modes:
|
|
331
|
-
# - enforcing: Deny and log violations
|
|
332
|
-
# - permissive: Allow but log violations
|
|
333
|
-
# - disabled: No SELinux
|
|
334
|
-
|
|
335
|
-
# Check context
|
|
336
|
-
ls -Z /var/www/html
|
|
337
|
-
ps -eZ | grep httpd
|
|
338
|
-
|
|
339
|
-
# Set file context
|
|
340
|
-
sudo semanage fcontext -a -t httpd_sys_content_t "/srv/www(/.*)?"
|
|
341
|
-
sudo restorecon -Rv /srv/www
|
|
342
|
-
|
|
343
|
-
# Port labeling
|
|
344
|
-
sudo semanage port -a -t http_port_t -p tcp 8080
|
|
345
|
-
sudo semanage port -l | grep http_port_t
|
|
346
|
-
|
|
347
|
-
# Troubleshooting
|
|
348
|
-
sudo ausearch -m avc -ts recent
|
|
349
|
-
sudo audit2allow -a
|
|
350
|
-
sudo audit2why -a
|
|
351
|
-
|
|
352
|
-
# Create custom policy
|
|
353
|
-
sudo ausearch -m avc -ts recent | audit2allow -M mypolicy
|
|
354
|
-
sudo semodule -i mypolicy.pp
|
|
355
|
-
|
|
356
|
-
# Boolean settings
|
|
357
|
-
getsebool -a
|
|
358
|
-
sudo setsebool -P httpd_can_network_connect on
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### AppArmor (Ubuntu/Debian)
|
|
362
|
-
|
|
363
|
-
```bash
|
|
364
|
-
# Check status
|
|
365
|
-
sudo aa-status
|
|
366
|
-
|
|
367
|
-
# Install utilities
|
|
368
|
-
sudo apt install apparmor-utils
|
|
369
|
-
|
|
370
|
-
# Create profile
|
|
371
|
-
sudo aa-genprof /usr/bin/myapp
|
|
372
|
-
|
|
373
|
-
# While app runs, generate profile:
|
|
374
|
-
# 1. Run application and perform all functions
|
|
375
|
-
# 2. In another terminal: sudo aa-logprof
|
|
376
|
-
# 3. Review and approve events
|
|
377
|
-
|
|
378
|
-
# Profile modes
|
|
379
|
-
sudo aa-enforce /etc/apparmor.d/usr.bin.myapp # Enforce
|
|
380
|
-
sudo aa-complain /etc/apparmor.d/usr.bin.myapp # Complain (log only)
|
|
381
|
-
sudo aa-disable /etc/apparmor.d/usr.bin.myapp # Disable
|
|
382
|
-
|
|
383
|
-
# Example profile
|
|
384
|
-
cat > /etc/apparmor.d/usr.bin.myapp <<'EOF'
|
|
385
|
-
#include <tunables/global>
|
|
386
|
-
|
|
387
|
-
/usr/bin/myapp {
|
|
388
|
-
#include <abstractions/base>
|
|
389
|
-
|
|
390
|
-
capability net_bind_service,
|
|
391
|
-
|
|
392
|
-
/usr/bin/myapp mr,
|
|
393
|
-
/etc/myapp/** r,
|
|
394
|
-
/var/log/myapp/** rw,
|
|
395
|
-
/var/lib/myapp/** rw,
|
|
396
|
-
|
|
397
|
-
# Network
|
|
398
|
-
network inet stream,
|
|
399
|
-
network inet6 stream,
|
|
400
|
-
|
|
401
|
-
# Deny everything else
|
|
402
|
-
deny /** wl,
|
|
403
|
-
}
|
|
404
|
-
EOF
|
|
405
|
-
|
|
406
|
-
# Load profile
|
|
407
|
-
sudo apparmor_parser -r /etc/apparmor.d/usr.bin.myapp
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
## SSH Hardening
|
|
411
|
-
|
|
412
|
-
### SSH Server Configuration
|
|
413
|
-
|
|
414
|
-
```bash
|
|
415
|
-
# /etc/ssh/sshd_config
|
|
416
|
-
|
|
417
|
-
# Network
|
|
418
|
-
Port 22 # Consider non-standard port
|
|
419
|
-
AddressFamily inet # IPv4 only
|
|
420
|
-
ListenAddress 0.0.0.0
|
|
421
|
-
|
|
422
|
-
# Protocol
|
|
423
|
-
Protocol 2
|
|
424
|
-
|
|
425
|
-
# Authentication
|
|
426
|
-
PermitRootLogin no
|
|
427
|
-
MaxAuthTries 3
|
|
428
|
-
MaxSessions 2
|
|
429
|
-
PubkeyAuthentication yes
|
|
430
|
-
PasswordAuthentication no
|
|
431
|
-
PermitEmptyPasswords no
|
|
432
|
-
ChallengeResponseAuthentication no
|
|
433
|
-
UsePAM yes
|
|
434
|
-
|
|
435
|
-
# Kerberos
|
|
436
|
-
KerberosAuthentication no
|
|
437
|
-
|
|
438
|
-
# GSSAPI
|
|
439
|
-
GSSAPIAuthentication no
|
|
440
|
-
|
|
441
|
-
# Host-based
|
|
442
|
-
HostbasedAuthentication no
|
|
443
|
-
IgnoreRhosts yes
|
|
444
|
-
|
|
445
|
-
# Features
|
|
446
|
-
X11Forwarding no
|
|
447
|
-
PrintMotd no
|
|
448
|
-
PermitUserEnvironment no
|
|
449
|
-
AllowTcpForwarding no
|
|
450
|
-
AllowAgentForwarding no
|
|
451
|
-
PermitTunnel no
|
|
452
|
-
|
|
453
|
-
# Timeout
|
|
454
|
-
ClientAliveInterval 300
|
|
455
|
-
ClientAliveCountMax 0
|
|
456
|
-
LoginGraceTime 60
|
|
457
|
-
|
|
458
|
-
# Access Control
|
|
459
|
-
AllowUsers admin deploy
|
|
460
|
-
AllowGroups sshusers
|
|
461
|
-
DenyUsers root guest
|
|
462
|
-
# Or use DenyGroups
|
|
463
|
-
|
|
464
|
-
# Logging
|
|
465
|
-
SyslogFacility AUTH
|
|
466
|
-
LogLevel VERBOSE
|
|
467
|
-
|
|
468
|
-
# Cryptography
|
|
469
|
-
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
|
470
|
-
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
|
|
471
|
-
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
|
|
472
|
-
|
|
473
|
-
# Banner
|
|
474
|
-
Banner /etc/ssh/banner
|
|
475
|
-
|
|
476
|
-
# Test configuration
|
|
477
|
-
sudo sshd -t
|
|
478
|
-
|
|
479
|
-
# Restart SSH
|
|
480
|
-
sudo systemctl restart sshd
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
### SSH Client Hardening
|
|
484
|
-
|
|
485
|
-
```bash
|
|
486
|
-
# ~/.ssh/config
|
|
487
|
-
|
|
488
|
-
Host *
|
|
489
|
-
# Cryptography
|
|
490
|
-
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
|
|
491
|
-
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
|
|
492
|
-
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org
|
|
493
|
-
|
|
494
|
-
# Security
|
|
495
|
-
HashKnownHosts yes
|
|
496
|
-
StrictHostKeyChecking ask
|
|
497
|
-
VerifyHostKeyDNS ask
|
|
498
|
-
|
|
499
|
-
# Connection
|
|
500
|
-
ServerAliveInterval 60
|
|
501
|
-
ServerAliveCountMax 3
|
|
502
|
-
TCPKeepAlive no
|
|
503
|
-
|
|
504
|
-
# Disable
|
|
505
|
-
ForwardAgent no
|
|
506
|
-
ForwardX11 no
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
### SSH Key Management
|
|
510
|
-
|
|
511
|
-
```bash
|
|
512
|
-
# Generate strong SSH key (Ed25519 recommended)
|
|
513
|
-
ssh-keygen -t ed25519 -C "user@example.com"
|
|
514
|
-
|
|
515
|
-
# Or RSA 4096
|
|
516
|
-
ssh-keygen -t rsa -b 4096 -C "user@example.com"
|
|
517
|
-
|
|
518
|
-
# Add passphrase to existing key
|
|
519
|
-
ssh-keygen -p -f ~/.ssh/id_ed25519
|
|
520
|
-
|
|
521
|
-
# Set proper permissions
|
|
522
|
-
chmod 700 ~/.ssh
|
|
523
|
-
chmod 600 ~/.ssh/id_ed25519
|
|
524
|
-
chmod 644 ~/.ssh/id_ed25519.pub
|
|
525
|
-
chmod 600 ~/.ssh/authorized_keys
|
|
526
|
-
chmod 600 ~/.ssh/config
|
|
527
|
-
|
|
528
|
-
# Audit authorized keys
|
|
529
|
-
cat ~/.ssh/authorized_keys
|
|
530
|
-
# Remove unknown keys
|
|
531
|
-
|
|
532
|
-
# Restrict key usage
|
|
533
|
-
# In authorized_keys:
|
|
534
|
-
from="192.168.1.0/24",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-ed25519 AAAA...
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
## File Permissions and Capabilities
|
|
538
|
-
|
|
539
|
-
### Critical File Permissions
|
|
540
|
-
|
|
541
|
-
```bash
|
|
542
|
-
# System files
|
|
543
|
-
sudo chmod 644 /etc/passwd
|
|
544
|
-
sudo chmod 644 /etc/group
|
|
545
|
-
sudo chmod 600 /etc/shadow
|
|
546
|
-
sudo chmod 600 /etc/gshadow
|
|
547
|
-
sudo chmod 600 /boot/grub/grub.cfg
|
|
548
|
-
|
|
549
|
-
# SSH
|
|
550
|
-
sudo chmod 600 /etc/ssh/*_key
|
|
551
|
-
sudo chmod 644 /etc/ssh/*.pub
|
|
552
|
-
sudo chmod 600 /etc/ssh/sshd_config
|
|
553
|
-
|
|
554
|
-
# Sudo configuration
|
|
555
|
-
sudo chmod 440 /etc/sudoers
|
|
556
|
-
sudo chmod 750 /etc/sudoers.d
|
|
557
|
-
|
|
558
|
-
# Find world-writable files
|
|
559
|
-
find / -xdev -type f -perm -0002 -ls 2>/dev/null
|
|
560
|
-
|
|
561
|
-
# Find files with SUID/SGID
|
|
562
|
-
find / -xdev \( -perm -4000 -o -perm -2000 \) -type f -ls 2>/dev/null
|
|
563
|
-
|
|
564
|
-
# Remove SUID if not needed
|
|
565
|
-
sudo chmod u-s /path/to/file
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
### File Capabilities
|
|
569
|
-
|
|
570
|
-
```bash
|
|
571
|
-
# View capabilities
|
|
572
|
-
getcap /usr/bin/ping
|
|
573
|
-
sudo getcap -r / 2>/dev/null
|
|
574
|
-
|
|
575
|
-
# Set capability (instead of SUID)
|
|
576
|
-
sudo setcap cap_net_bind_service=+ep /usr/bin/myapp
|
|
577
|
-
|
|
578
|
-
# Remove capability
|
|
579
|
-
sudo setcap -r /usr/bin/myapp
|
|
580
|
-
|
|
581
|
-
# Audit capabilities
|
|
582
|
-
sudo getcap -r / 2>/dev/null
|
|
583
|
-
```
|
|
584
|
-
|
|
585
|
-
## Audit Logging
|
|
586
|
-
|
|
587
|
-
### auditd Configuration
|
|
588
|
-
|
|
589
|
-
```bash
|
|
590
|
-
# Install auditd
|
|
591
|
-
sudo apt install auditd audispd-plugins
|
|
592
|
-
|
|
593
|
-
# /etc/audit/auditd.conf
|
|
594
|
-
log_file = /var/log/audit/audit.log
|
|
595
|
-
log_format = RAW
|
|
596
|
-
log_group = root
|
|
597
|
-
priority_boost = 4
|
|
598
|
-
flush = INCREMENTAL_ASYNC
|
|
599
|
-
freq = 50
|
|
600
|
-
num_logs = 5
|
|
601
|
-
max_log_file = 50
|
|
602
|
-
max_log_file_action = ROTATE
|
|
603
|
-
space_left = 75
|
|
604
|
-
space_left_action = SYSLOG
|
|
605
|
-
admin_space_left = 50
|
|
606
|
-
admin_space_left_action = SUSPEND
|
|
607
|
-
disk_full_action = SUSPEND
|
|
608
|
-
disk_error_action = SUSPEND
|
|
609
|
-
|
|
610
|
-
# Enable auditd
|
|
611
|
-
sudo systemctl enable auditd
|
|
612
|
-
sudo systemctl start auditd
|
|
613
|
-
```
|
|
614
|
-
|
|
615
|
-
### Audit Rules
|
|
616
|
-
|
|
617
|
-
```bash
|
|
618
|
-
# /etc/audit/rules.d/audit.rules
|
|
619
|
-
|
|
620
|
-
# Delete all existing rules
|
|
621
|
-
-D
|
|
622
|
-
|
|
623
|
-
# Buffer size
|
|
624
|
-
-b 8192
|
|
625
|
-
|
|
626
|
-
# Failure mode (0=silent 1=printk 2=panic)
|
|
627
|
-
-f 1
|
|
628
|
-
|
|
629
|
-
# Monitor authentication
|
|
630
|
-
-w /var/log/faillog -p wa -k logins
|
|
631
|
-
-w /var/log/lastlog -p wa -k logins
|
|
632
|
-
-w /var/run/utmp -p wa -k session
|
|
633
|
-
-w /var/log/wtmp -p wa -k logins
|
|
634
|
-
-w /var/log/btmp -p wa -k logins
|
|
635
|
-
|
|
636
|
-
# Monitor user/group changes
|
|
637
|
-
-w /etc/group -p wa -k identity
|
|
638
|
-
-w /etc/passwd -p wa -k identity
|
|
639
|
-
-w /etc/gshadow -p wa -k identity
|
|
640
|
-
-w /etc/shadow -p wa -k identity
|
|
641
|
-
-w /etc/security/opasswd -p wa -k identity
|
|
642
|
-
|
|
643
|
-
# Monitor network configuration
|
|
644
|
-
-w /etc/hosts -p wa -k network
|
|
645
|
-
-w /etc/hostname -p wa -k network
|
|
646
|
-
-w /etc/network/ -p wa -k network
|
|
647
|
-
|
|
648
|
-
# Monitor system calls
|
|
649
|
-
-a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change
|
|
650
|
-
-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale
|
|
651
|
-
|
|
652
|
-
# Monitor file deletions
|
|
653
|
-
-a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -k delete
|
|
654
|
-
|
|
655
|
-
# Monitor sudo
|
|
656
|
-
-w /etc/sudoers -p wa -k sudoers
|
|
657
|
-
-w /etc/sudoers.d/ -p wa -k sudoers
|
|
658
|
-
|
|
659
|
-
# Load rules
|
|
660
|
-
sudo augenrules --load
|
|
661
|
-
|
|
662
|
-
# Or
|
|
663
|
-
sudo service auditd restart
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
### Analyzing Audit Logs
|
|
667
|
-
|
|
668
|
-
```bash
|
|
669
|
-
# Search logs
|
|
670
|
-
sudo ausearch -k logins
|
|
671
|
-
sudo ausearch -m USER_LOGIN
|
|
672
|
-
sudo ausearch -ts today -k identity
|
|
673
|
-
|
|
674
|
-
# Generate report
|
|
675
|
-
sudo aureport --summary
|
|
676
|
-
sudo aureport --auth
|
|
677
|
-
sudo aureport --failed
|
|
678
|
-
sudo aureport --login
|
|
679
|
-
|
|
680
|
-
# Real-time monitoring
|
|
681
|
-
sudo tail -f /var/log/audit/audit.log
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
## Vulnerability Scanning
|
|
685
|
-
|
|
686
|
-
### Lynis Security Audit
|
|
687
|
-
|
|
688
|
-
```bash
|
|
689
|
-
# Install Lynis
|
|
690
|
-
sudo apt install lynis
|
|
691
|
-
|
|
692
|
-
# Run audit
|
|
693
|
-
sudo lynis audit system
|
|
694
|
-
|
|
695
|
-
# Review results
|
|
696
|
-
cat /var/log/lynis.log
|
|
697
|
-
cat /var/log/lynis-report.dat
|
|
698
|
-
|
|
699
|
-
# Focus on high-priority items
|
|
700
|
-
sudo lynis show warnings
|
|
701
|
-
sudo lynis show suggestions
|
|
702
|
-
```
|
|
703
|
-
|
|
704
|
-
### OpenSCAP
|
|
705
|
-
|
|
706
|
-
```bash
|
|
707
|
-
# Install OpenSCAP
|
|
708
|
-
sudo apt install libopenscap8 ssg-base ssg-debian
|
|
709
|
-
|
|
710
|
-
# Run scan
|
|
711
|
-
sudo oscap xccdf eval \
|
|
712
|
-
--profile xccdf_org.ssgproject.content_profile_standard \
|
|
713
|
-
--results scan-results.xml \
|
|
714
|
-
--report scan-report.html \
|
|
715
|
-
/usr/share/xml/scap/ssg/content/ssg-debian11-ds.xml
|
|
716
|
-
|
|
717
|
-
# View report
|
|
718
|
-
firefox scan-report.html
|
|
719
|
-
```
|
|
720
|
-
|
|
721
|
-
### Rootkit Detection
|
|
722
|
-
|
|
723
|
-
```bash
|
|
724
|
-
# rkhunter
|
|
725
|
-
sudo apt install rkhunter
|
|
726
|
-
sudo rkhunter --update
|
|
727
|
-
sudo rkhunter --check
|
|
728
|
-
|
|
729
|
-
# chkrootkit
|
|
730
|
-
sudo apt install chkrootkit
|
|
731
|
-
sudo chkrootkit
|
|
732
|
-
```
|
|
733
|
-
|
|
734
|
-
---
|
|
735
|
-
|
|
736
|
-
**Related Topics:**
|
|
737
|
-
- See [networking-fundamentals.md](networking-fundamentals.md) for firewall configuration
|
|
738
|
-
- See [linux-administration.md](linux-administration.md) for user management
|
|
739
|
-
- See [system-monitoring.md](system-monitoring.md) for audit logging
|