{"_id":"55dc75b27fa0290d00559123","user":"55dc702d7fa0290d00559106","project":"55db8f8f1a91690d007ad975","__v":27,"category":{"_id":"55dc751b00a8811900c230e3","pages":["55dc75b27fa0290d00559123","55dc75c055be9f21004ee24e","55dc75ef00a8811900c230e7","55dc76036f16451700843e0c","55dc760e00a8811900c230e9","55dc767d55be9f21004ee251","55df5db386ae7f0d00db4ccd","55df64cfaf76b70d0060a60e","55df7263c59b180d005fa70e","55e0b72fa44fae0d002148c5","55e0c42b5087cb1900986c0f","55e36b1bac4eef230079a735","55f363ea2d3bae21009c47aa","55f36bcc5f8674370067b73c","55f36c23ec46040d0030326a","5605d2eda4574a0d00811346","560ac5fef6994b0d0023bca6","561be02937781d0d007942b0","56782f0048c8d00d0094b7fc"],"project":"55db8f8f1a91690d007ad975","version":"55db8f901a91690d007ad978","__v":19,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-25T14:00:59.500Z","from_sync":false,"order":1,"slug":"how-to-get-started","title":"Agent Installation"},"githubsync":"","parentDoc":null,"version":{"_id":"55db8f901a91690d007ad978","project":"55db8f8f1a91690d007ad975","__v":17,"createdAt":"2015-08-24T21:41:36.034Z","releaseDate":"2015-08-24T21:41:36.034Z","categories":["55db8f901a91690d007ad979","55db9856b3d6540d00886426","55dc751b00a8811900c230e3","55dc766255be9f21004ee250","55dc769200a8811900c230ed","55e4c701177b6e0d003330fa","55f4915caf0bc71900a53130","55f491b2be9c2b2100f0635d","560b22739c7be70d00100bd8","57488c53e8c6a420000b729c","574cefd95953e20e00f40f9f","5798edfd7700d30e00ad250c","579ac88234b5fd0e00b9e140","57c81c6d690c200e0047b72e","57d9b8fbda17c30e003897f1","57d9b90e608ea00e00f358d8","57d9b91cda17c30e003897f4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-25T14:03:30.243Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/dPmpKmbS1SGdCQ1UJTjQ_rubyrails.png\",\n        \"rubyrails.png\",\n        \"640\",\n        \"320\",\n        \"#9f2733\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Supported Versions\"\n}\n[/block]\nRuby: MRI runtime version 1.9.3 and up\nRails: 3.2, 4.0, 4.1, 4.2 or 5\n\nFor SQL Injection Protection:\n* ActiveRecord 3.2, 4.0, 4.1, 4.2 or 5 and one of the following adapters\n  * MySQL using the mysql or mysql2 adapter\n  * PostgreSQL using the postgresql adapter\n  * SQLite using the sqlite or sqlite3 adapter\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Prerequisites\"\n}\n[/block]\nThe IMMUNIO agent communicates with​ a management service at https://agent.immun.io. Ensure outbound access to this address is unblocked.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Installation\"\n}\n[/block]\nThe Rails IMMUNIO agent is a Ruby gem, so the installation is like any other you are using right now.\n\n## Using Bundler\nIf you are using Bundler, you need to add the following line to your application's ```Gemfile```:​\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"gem 'immunio'\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\nNext, run bundler to install the gem:​\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bundle install\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n## Without Bundler\nTo install the agent without Bundler, you need to run the following command:​\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"gem install immunio\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configuration\"\n}\n[/block]\n## Quick start\nThe simplest way to configure the agent is to use the built-in ```immunio``` command-line tool. It will guide you through setting up the basic configuration of your app and put the details in the ```config/immunio.yml``` file. To use it, run:​\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bundle exec immunio init\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n## Manual configuration\nThere are two ways to provide agent configuration: adding settings to `config/immunio.yml` inside your app, or setting environment variables at runtime. To provide the settings​ in a file, create the `config/immunio.yml` with the following contents, replacing the key and secret values with those provided in the dashboard for your app:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"key: 87637d4f-f01a-406d-b3e6-1ff8f84a3d34\\nsecret: a0ca4263-da57-45f5-aabb-b72e5a78b510\\ncode_protection_plugins_enabled: true\",\n      \"language\": \"yaml\"\n    }\n  ]\n}\n[/block]\n## Using environment variables\nWhen using environment variables, convert setting names to uppercase and prepend `IMMUNIO_`. For example, the key would be provided in the environment variable `IMMUNIO_​KEY`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"export IMMUNIO_KEY=87637d4f-f01a-406d-b3e6-1ff8f84a3d34\\nexport IMMUNIO_SECRET=a0ca4263-da57-45f5-aabb-b72e5a78b510\\nexport IMMUNIO_CODE_PROTECTION_PLUGINS_ENABLED=true\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Account Takeover Configuration\",\n  \"body\": \"If you do not plan to use Code Protection features, you can set the Code Protection Plugins variable to false or simply remove that line from your configuration.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Verification\"\n}\n[/block]\nOnce the agent is installed and configured, start your application, then send an HTTP request to it. Without that first HTTP call, the agent will show INACTIVE in the dashboard. Within seconds, that first call, the agent should report in and appear as OK in the **Agents** tab of the dashboard. Your app is now protected with IMMUNIO!​","excerpt":"","slug":"ruby-on-rails","type":"basic","title":"Ruby on Rails"}
[block:image] { "images": [ { "image": [ "https://files.readme.io/dPmpKmbS1SGdCQ1UJTjQ_rubyrails.png", "rubyrails.png", "640", "320", "#9f2733", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Supported Versions" } [/block] Ruby: MRI runtime version 1.9.3 and up Rails: 3.2, 4.0, 4.1, 4.2 or 5 For SQL Injection Protection: * ActiveRecord 3.2, 4.0, 4.1, 4.2 or 5 and one of the following adapters * MySQL using the mysql or mysql2 adapter * PostgreSQL using the postgresql adapter * SQLite using the sqlite or sqlite3 adapter [block:api-header] { "type": "basic", "title": "Prerequisites" } [/block] The IMMUNIO agent communicates with​ a management service at https://agent.immun.io. Ensure outbound access to this address is unblocked. [block:api-header] { "type": "basic", "title": "Installation" } [/block] The Rails IMMUNIO agent is a Ruby gem, so the installation is like any other you are using right now. ## Using Bundler If you are using Bundler, you need to add the following line to your application's ```Gemfile```:​ [block:code] { "codes": [ { "code": "gem 'immunio'", "language": "ruby" } ] } [/block] Next, run bundler to install the gem:​ [block:code] { "codes": [ { "code": "bundle install", "language": "shell" } ] } [/block] ## Without Bundler To install the agent without Bundler, you need to run the following command:​ [block:code] { "codes": [ { "code": "gem install immunio", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic", "title": "Configuration" } [/block] ## Quick start The simplest way to configure the agent is to use the built-in ```immunio``` command-line tool. It will guide you through setting up the basic configuration of your app and put the details in the ```config/immunio.yml``` file. To use it, run:​ [block:code] { "codes": [ { "code": "bundle exec immunio init", "language": "shell" } ] } [/block] ## Manual configuration There are two ways to provide agent configuration: adding settings to `config/immunio.yml` inside your app, or setting environment variables at runtime. To provide the settings​ in a file, create the `config/immunio.yml` with the following contents, replacing the key and secret values with those provided in the dashboard for your app: [block:code] { "codes": [ { "code": "key: 87637d4f-f01a-406d-b3e6-1ff8f84a3d34\nsecret: a0ca4263-da57-45f5-aabb-b72e5a78b510\ncode_protection_plugins_enabled: true", "language": "yaml" } ] } [/block] ## Using environment variables When using environment variables, convert setting names to uppercase and prepend `IMMUNIO_`. For example, the key would be provided in the environment variable `IMMUNIO_​KEY`. [block:code] { "codes": [ { "code": "export IMMUNIO_KEY=87637d4f-f01a-406d-b3e6-1ff8f84a3d34\nexport IMMUNIO_SECRET=a0ca4263-da57-45f5-aabb-b72e5a78b510\nexport IMMUNIO_CODE_PROTECTION_PLUGINS_ENABLED=true", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Account Takeover Configuration", "body": "If you do not plan to use Code Protection features, you can set the Code Protection Plugins variable to false or simply remove that line from your configuration." } [/block] [block:api-header] { "type": "basic", "title": "Verification" } [/block] Once the agent is installed and configured, start your application, then send an HTTP request to it. Without that first HTTP call, the agent will show INACTIVE in the dashboard. Within seconds, that first call, the agent should report in and appear as OK in the **Agents** tab of the dashboard. Your app is now protected with IMMUNIO!​