unknown 2 Q&As

Unknown FAQ & Answers

2 expert Unknown answers researched from official documentation. Every answer cites authoritative sources you can verify.

General

2 questions
A

Best practices for implementing code formatting standards with 2 spaces, 100 character limit, and semicolons involve three complementary tools: Prettier (automated formatting), ESLint (linting), and EditorConfig (cross-editor consistency). Configure Prettier with tabWidth: 2, printWidth: 100, and semi: true in .prettierrc. Use ESLint with eslint-config-prettier to disable conflicting formatting rules, keeping only semi: ["error", "always"] for enforcement. Add EditorConfig with indent_style = space, indent_size = 2, and max_line_length = 100 in .editorconfig for cross-editor baseline settings. Key principles: define all formatting rules in Prettier (not ESLint) to avoid conflicts, use eslint-plugin-prettier to run Prettier as an ESLint rule, and maintain EditorConfig as the lowest-level baseline that works across all editors. Most modern style guides (Google Java Style Guide uses 2 spaces and 100 character limit, Airbnb JavaScript guide emphasizes consistent semicolons) recommend these settings for readability and preventing horizontal scrolling. Never mix tabs and spaces, always enforce semicolons to avoid JavaScript pitfalls, and prioritize consistency across the entire codebase over personal preference.

95% confidence
A

Dangerous operations in permission systems include privilege escalation, unrestricted administrative functions, financial transactions, system configuration changes, and security administration. These should be blocked or restricted through multiple layers of control:

Dangerous Operations to Block:

  1. Wildcard IAM PassRole permissions (AWS-specific) - allows passing any role to resources, enabling privilege escalation
  2. Unrestricted privileged account access - super users, database administrators, and OS administrators with overlapping permissions
  3. Unauthorized modification of security policies, permission levels, or audit logs
  4. Execution of unapproved applications and scripts that can enumerate or exploit privileges
  5. Default or embedded credentials usage

Implementation of Operation Risk Levels:

Define risk levels based on operation sensitivity:

  • Critical/High Risk: Re-authentication required before execution, multi-factor authentication mandatory for financial transactions and high-value accounts, real-time monitoring and alerts
  • Moderate Risk: Role-Based Access Control (RBAC) enforcement, periodic access review, approval workflows
  • Low Risk: Standard RBAC with least privilege principle, regular audit log review

Implement centralized, server-side enforcement using a single site-wide component for all permission checks. Use RBAC to associate permissions with roles rather than users directly, or ABAC (Attribute-Based Access Control) for policy-based decisions using subject, object, environment attributes.

Audit Trail Implementation:

Log the following for sensitive operations:

  • User identification (who), timestamp (when), action details (what - view, modify, delete)
  • Location (IP address, device), before/after values for modifications, success/failure status
  • Application-level activities: files accessed, specific record changes, report generation

Security measures:

  • Encrypt audit logs at rest and in transit
  • Implement RBAC to restrict log access - system administrators who can manipulate logs should not review them (separation of duties)
  • Configure fail-safe with redundant storage and frequent backups
  • Use digital signatures to ensure log integrity
  • Implement SIEM (Security Information and Event Management) tools for real-time threat monitoring
  • Set retention policies based on regulatory requirements (GDPR, PCI-DSS may require several years)
  • Automate log analysis to detect suspicious patterns and unauthorized privilege changes

Protect audit trail data from modification through strict access controls and regular integrity checks. Review logs timely - unreviewed audit trails provide limited security value.

95% confidence