# Nuxt セキュリティ (Vue.js / Nuxt.js) > XSS 対策、CSRF トークン、Content Security Policy、レート制限、入力のサニタイズ、セキュリティヘッダー - 20 面接問題 - Senior - [面接問題: Vue.js / Nuxt.js](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions.md) ## 1. Nuxt Security モジュールとは何ですか? **回答** Nuxt Security は、HTTP Headers と Middleware を使用して Nuxt 3 アプリケーションを OWASP のセキュリティパターンに従うよう自動的に設定する公式モジュールです。CSP(Content Security Policy)、レート制限、XSS バリデーション、CSRF 保護、セキュリティヘッダーの設定などの機能が含まれます。このモジュールは安全なデフォルト設定を適用しつつ、routeRules を介したルートごとのきめ細かいカスタマイズも可能にします。 ## 2. Nuxt Security における script-src のデフォルトの CSP ディレクティブは何ですか? **回答** デフォルトの script-src ディレクティブは、'self'(同一オリジンのスクリプト)、https:(HTTPS スクリプト)、'unsafe-inline'(インラインスクリプト)、'strict-dynamic'(スクリプトの動的許可)、'nonce-{{nonce}}'(SSR でのインラインスクリプト用 nonce)を使用します。この組み合わせはセキュリティと互換性のバランスを取りますが、本番環境での厳格なセキュリティには 'strict-dynamic' が推奨されます。 ## 3. Content Security Policy の文脈における nonce とは何ですか? **回答** nonce(number used once)は、リクエストごとにサーバー側で生成される一意のランダムトークンで、CSP ヘッダーとインラインの script タグの両方に含まれます。この特定の nonce を持つインラインスクリプトのみを許可し、正しい nonce を持たない XSS で注入されたスクリプトをブロックします。Nuxt Security では、nonce は SSR で security.nonce: true と script-src 内のプレースホルダー 'nonce-{{nonce}}' によりデフォルトで有効になっています。 ## さらに17問利用可能 - クリックジャッキング攻撃から保護する HTTP header はどれですか? - Nuxt Security における Content Security Policy について、SSR と SSG の違いは何ですか? 無料で登録: https://sharpskill.dev/ja/login ## その他のVue.js / Nuxt.js面接トピック - [JavaScript の基礎](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/javascript-fundamentals.md): 20問, Junior - [モダンな JavaScript (ES6+)](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/es6-modern-javascript.md): 20問, Junior - [Vue の基礎](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-basics.md): 22問, Junior - [Vue コンポーネント](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-components.md): 20問, Junior - [Vue Router](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-router.md): 18問, Junior - [Pinia State Management](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/pinia-state-management.md): 20問, Junior - [Vuex (Legacy)](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vuex-legacy.md): 15問, Mid-Level - [Composition API](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/composition-api.md): 24問, Mid-Level - [Vue のリアクティビティ](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-reactivity.md): 20問, Mid-Level - [Nuxt の基礎](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-fundamentals.md): 22問, Mid-Level - [Nuxt のデータフェッチング](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-data-fetching.md): 20問, Mid-Level - [Nuxt の SSR と SSG](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-ssr-ssg.md): 22問, Mid-Level - [Nuxt サーバールート](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-server-routes.md): 20問, Mid-Level - [Nuxt モジュール](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-modules.md): 18問, Mid-Level - [Vue のコンポーザブル](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-composables.md): 20問, Mid-Level - [Vue フォームとバリデーション](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-forms-validation.md): 20問, Mid-Level - [Nuxt の状態管理](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-state-management.md): 18問, Mid-Level - [Vue のテスト](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-testing.md): 20問, Mid-Level - [Nuxt のデプロイと CI/CD](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-deployment-cicd.md): 22問, Mid-Level - [Vue のパフォーマンス](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-performance.md): 22問, Senior - [Vue の高度なパターン](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-advanced-patterns.md): 24問, Senior - [VueでのTypeScript](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/typescript-vue.md): 22問, Senior - [Nuxt認証](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-auth.md): 20問, Senior - [Nuxt での SEO](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-seo.md): 20問, Senior - [Nuxt の国際化](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-i18n.md): 18問, Senior - [Vue アーキテクチャ](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-architecture.md): 22問, Senior - [Vue エコシステム](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/vue-ecosystem.md): 18問, Senior - [Vue 2→3 & Nuxt 2→3 の移行](https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/migration-vue2-vue3-nuxt2-nuxt3.md): 22問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/vue-nuxt/interview-questions/nuxt-security