<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 🦄N B🛡</title>
    <description>The latest articles on DEV Community by 🦄N B🛡 (@v6).</description>
    <link>https://dev.to/v6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F60163%2F8267c2c7-f5d5-4cfb-a737-d42fb3008246.jpeg</url>
      <title>DEV Community: 🦄N B🛡</title>
      <link>https://dev.to/v6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/v6"/>
    <language>en</language>
    <item>
      <title>How to install Boundary on Ubuntu in 3 CLI commands</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Fri, 20 Nov 2020 00:35:53 +0000</pubDate>
      <link>https://dev.to/digitalonus/how-to-install-boundary-on-ubuntu-4c52</link>
      <guid>https://dev.to/digitalonus/how-to-install-boundary-on-ubuntu-4c52</guid>
      <description>&lt;p&gt;Press ctrl+alt+t to open a Terminal Emulator window in &lt;a href="https://www.wikihow.com/Install-Ubuntu-Linux"&gt;Ubuntu&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Then you can copy or type this in to install Boundary on Ubuntu Linux in a terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install boundary
boundary -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To install, that is all. &lt;/p&gt;

&lt;p&gt;But here's an example of running it, so you can see what your output should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; * keychain 2.8.5 ~ http://www.funtoo.org
 * Waiting 5 seconds for lock...
 * Found existing ssh-agent: 4199
 * Known ssh key: /home/nb/.ssh/id_rsa

~$ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
[sudo] password for norbert: 
OK
~$ sudo apt-add-repository "deb [arch=amd64] 
https://apt.releases.hashicorp.com $(lsb_release -cs) main"
Hit:1 
http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [56.6 kB]                                                                                                                  
Get:45 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [9,364 B]                                                                                                                   
Fetched 5,693 kB in 7s (792 kB/s)                                                                                                                                                                                 
Reading package lists... Done
~$ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install boundary                                                                                                                       
Hit:4 https://apt.releases.hashicorp.com focal InRelease                                                                                                                            
Hit:5 http://us.archive.ubuntu.com/ubuntu focal InRelease                                               
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  boundary
0 upgraded, 1 newly installed, 0 to remove and 45 not upgraded.
Need to get 21.2 MB of archives.
After this operation, 48.9 MB of additional disk space will be used.
Get:1 https://apt.releases.hashicorp.com focal/main amd64 boundary amd64 0.1.2 [21.2 MB]
Fetched 21.2 MB in 4s (5,534 kB/s)   
Selecting previously unselected package boundary.
(Reading database ... 280569 files and directories currently installed.)
Preparing to unpack .../boundary_0.1.2_amd64.deb ...
Unpacking boundary (0.1.2) ...
Setting up boundary (0.1.2) ...
~$ echo $PATH | grep boundary
~1$ boundary -h
Usage: boundary &amp;lt;command&amp;gt; [args]

Commands:
    accounts           Manage Boundary accounts
    auth-methods       Manage Boundary auth methods
    auth-tokens        Manage Boundary auth tokens
    authenticate       Authenticate the Boundary command-line client
    config             Manage resources related to Boundary's local configuration
    connect            Connect to a target through a Boundary worker
    database           Manage Boundary's database
    dev                Start a Boundary dev environment
    groups             Manage Boundary groups
    host-catalogs      Manage Boundary host catalogs
    host-sets          Manage Boundary host sets
    hosts              Manage Boundary hosts
    roles              Manage Boundary roles
    scopes             Manage Boundary scopes
    server             Start a Boundary server
    sessions           Manage Boundary sessions
    targets            Manage Boundary targets
    users              Manage Boundary users
~$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>boundary</category>
      <category>identity</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Terraform Semantic Versioning as a Communication Tool</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Thu, 19 Nov 2020 23:54:49 +0000</pubDate>
      <link>https://dev.to/digitalonus/terraform-semantic-versioning-as-a-communication-tool-3o40</link>
      <guid>https://dev.to/digitalonus/terraform-semantic-versioning-as-a-communication-tool-3o40</guid>
      <description>&lt;h1&gt;
  
  
  Communication from Shared Services
&lt;/h1&gt;

&lt;p&gt;Although moving to a Cloud Operating model and self-service means a far greater degree of ownership of infrastructure by internal customers, these still need to rely on teams of specialists to maintain the platforms, libraries, modules, etc. that those consumers of internal services, well, consume. &lt;/p&gt;

&lt;p&gt;One of the best ways for these specialists to communicate ideas to the wider org, beyond the usual meetings, workshops, and presentations, is code, specifically, versioning of code.&lt;/p&gt;

&lt;p&gt;In Terraform Enterprise, this communication can take the form of versioning re-usable modules in an internal module registry.&lt;/p&gt;

&lt;p&gt;External re-usable modules, like &lt;a href="https://registry.terraform.io/modules/hashicorp/vault/aws/latest"&gt;the Vault module&lt;/a&gt;, should have strict version pinning, and internal modules, to facilitate faster feedback loops and better communication with SRE, should have looser version pinning. &lt;/p&gt;

&lt;p&gt;Here's an example policy that you can set: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi everyone at Rupture AgCorp IT,&lt;br&gt;&lt;br&gt;
We would like you all to make sure that you're pinning external Terraform Modules to their Minor version numbers, in accordance with Semantic Versioning (&lt;a href="https://semver.org"&gt;https://semver.org&lt;/a&gt;)&lt;br&gt;
But for internal modules, because changes to these are much more directly relevant to compliance and business changes, we now require you to have looser version pinning, to major versions only. &lt;br&gt;
This may cause issues, but they're issues we want to find out about, and handle, sooner rather than later. &lt;br&gt;
It's part of the way that we can make sure that our efforts to improve our internal services are meeting your needs, and an even better feedback mechanism than the conversations you are all so gracious to have with us on a regular basis. &lt;br&gt;
If you have any questions about this policy, or you think it's bunk, we're happy to discuss it as part of our portion of the Rupture AgCorp IT all-hands on Friday, or in person if you happen to drop by our desks. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;But make sure everyone in the SRE group knows how to properly do Semantic Versioning, to avoid unwanted changes!&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;You need to do this because if someone in your core services team marks a change as a bug fix or a security patch that they should have marked as a minor or major version change, this will betray the expectations you've set with the consumers of your service. And people will give up, and all but the adventurous will just avoid adopting new versions at all. &lt;/p&gt;

&lt;p&gt;For modules maintained within your organization, a version range strategy may be appropriate if a semantic versioning methodology is used consistently or if there is a well-defined release process that avoids unwanted updates.&lt;br&gt;
--&lt;a href="https://www.terraform.io/docs/configuration/modules.html#module-versions"&gt;https://www.terraform.io/docs/configuration/modules.html#module-versions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are two example use cases: &lt;/p&gt;

&lt;h3&gt;
  
  
  Use Case 1: Legacy Terraform Versions
&lt;/h3&gt;

&lt;p&gt;If you want to support Legacy Terraform versions, you can make a major version change reflect the new version of Terraform, e.g. Terraform 0.13.x would be supported by version 3.x.x of your module, and Terraform 0.12.x would be supported by version 2.x.x.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Case 2: Modules that "Wrap" External Modules
&lt;/h3&gt;

&lt;p&gt;For instance, if you have a Module that adds some company specific context or standard resources to another module, like the AKS module, and you keep making updates each month, you do not want your internal projects and Terraform code for your SaaS or IaaS footprint to have versions pinned to the patch version. If the Terraform modules for your internal systems have their dependencies from the HashiCorp registry, like &lt;a href="https://registry.terraform.io/modules/hashicorp/vault/aws/latest"&gt;HashiCorp's Vault module&lt;/a&gt;, pinned to the security patch version, or minor version, well, OK. Maybe it's needed. &lt;/p&gt;

&lt;p&gt;But if they're pinning your internally developed modules in your internal module registry to the patch version, it means you're missing out on a great chance to have productive conversations with the people who would consume your code about what they need and what they don't want. &lt;/p&gt;

&lt;p&gt;It means that if you make an important change or necessary improvement in something they're not an expert in, they'll never know! &lt;/p&gt;

&lt;p&gt;By the way, I haven't written this out of some kind of academic consideration for potential future issues. &lt;/p&gt;

&lt;p&gt;This is a real solution to a real problem that organizations even more sophisticated than my own have run into. And I recommend that if you use Terraform and have shared services, you give it serious consideration. &lt;/p&gt;

&lt;h3&gt;
  
  
  Further Reading:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://semver.org/"&gt;https://semver.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/search?q=semantic%20versioning"&gt;https://dev.to/search?q=semantic%20versioning&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/djmoch/regarding-semantic-versioning-hhk"&gt;https://dev.to/djmoch/regarding-semantic-versioning-hhk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/aheil/semantic-versioning-50jp"&gt;https://dev.to/aheil/semantic-versioning-50jp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/luisaugusto/understanding-semantic-versioning-27kf"&gt;https://dev.to/luisaugusto/understanding-semantic-versioning-27kf&lt;/a&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>semver</category>
      <category>hashicorp</category>
    </item>
    <item>
      <title>Happy International Men's Day!</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Thu, 19 Nov 2020 23:53:08 +0000</pubDate>
      <link>https://dev.to/v6/happy-international-men-s-day-1je6</link>
      <guid>https://dev.to/v6/happy-international-men-s-day-1je6</guid>
      <description>&lt;p&gt;I invite you all to take some time today to celebrate the special men in your life and work. &lt;/p&gt;

&lt;p&gt;For me, the most special man is my father. &lt;/p&gt;

&lt;p&gt;((Note, that little guy isn't actually ripped. I can tell by the &lt;a href="https://i.chzbgr.com/original/4864448256/h43308772/cheezburger-image-4864448256"&gt;pixels&lt;/a&gt;.))&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>mensday</category>
    </item>
    <item>
      <title>How do I Skip the Default Policy in Vault?</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Tue, 17 Nov 2020 19:34:48 +0000</pubDate>
      <link>https://dev.to/v6/how-do-i-skip-the-default-policy-in-vault-4id4</link>
      <guid>https://dev.to/v6/how-do-i-skip-the-default-policy-in-vault-4id4</guid>
      <description>&lt;p&gt;So here's something youze guyze ain't gonna know off the top of your balding pates...&lt;/p&gt;

&lt;p&gt;When Vault set up with external identity provider like LDAP/OIDC/JWT/XYZ, if a user logging into Vault does not have a group definition that mapped to a policy, then it will be logging in as “default” policy&lt;/p&gt;

&lt;p&gt;Is way to limit even the default policy, so that the domain user cannot even login and see the cubbyhole at all? Unless they are part of a group that have a policy mapped&lt;/p&gt;

&lt;p&gt;Well, you can modify the default policy, of course. &lt;/p&gt;

&lt;p&gt;But I suspect that's not gonna help most of you. &lt;/p&gt;

&lt;p&gt;This flag in the API, &lt;code&gt;token_no_default_policy&lt;/code&gt;, might help, at least for the JWT/OIDC auth method with its various providers: &lt;a href="https://www.vaultproject.io/api-docs/auth/jwt#token_no_default_policy"&gt;https://www.vaultproject.io/api-docs/auth/jwt#token_no_default_policy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And a quick quack of the ol' DDG shows that it seems they slapped this sucker on most of the other auth methods: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://duckduckgo.com/?q=token_no_default_policy+site%3Avaultproject.io&amp;amp;t=h_&amp;amp;ia=web"&gt;https://duckduckgo.com/?q=token_no_default_policy+site%3Avaultproject.io&amp;amp;t=h_&amp;amp;ia=web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, there you go! If it works, you may express your gratitude for my generosity in the comments. &lt;/p&gt;

&lt;p&gt;If it doesn't work, you may express your boundless rage for my imbecility in the comments. &lt;/p&gt;

</description>
      <category>hashicorp</category>
      <category>vault</category>
      <category>identity</category>
    </item>
    <item>
      <title>If I know a Vault CLI command, how do I get its cURL Command?</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Wed, 14 Oct 2020 01:05:24 +0000</pubDate>
      <link>https://dev.to/v6/if-i-know-a-vault-cli-command-how-do-i-get-its-curl-command-4o85</link>
      <guid>https://dev.to/v6/if-i-know-a-vault-cli-command-how-do-i-get-its-curl-command-4o85</guid>
      <description>&lt;p&gt;If you have a command like &lt;code&gt;vault auth enable oidc&lt;/code&gt;, how do you know its corresponding API call? Like this: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;vault auth disable -output-curl-string oidc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vault auth enable oidc
Success! Enabled oidc auth method at: oidc/

$ vault auth disable oidc
Success! Disabled the auth method (if it existed) at: oidc/

$ vault auth enable -output-curl-string oidc
curl -X POST -H "X-Vault-Request: true" -H "X-Vault-Token: $(vault print token)"
 -d '{"type":"oidc","description":"","config":{"options":null,"default_lease_ttl
":"0s","max_lease_ttl":"0s","force_no_cache":false},"local":false,"seal_wrap":fa
lse,"external_entropy_access":false,"options":null}' http://127.0.0.1:8200/v1/sy
s/auth/oidc

$ vault auth disable -output-curl-string oidc
curl -X DELETE -H "X-Vault-Request: true" -H "X-Vault-Token: $(vault print token
)" http://127.0.0.1:8200/v1/sys/auth/oidc

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more on the easy way to use the Vault API got get or generate "Secrets," I recommend this link: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.slideshare.net/mitchp/vault-secrets-via-api-for-the-rest-of-us"&gt;https://www.slideshare.net/mitchp/vault-secrets-via-api-for-the-rest-of-us&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vault</category>
      <category>api</category>
      <category>hashicorp</category>
    </item>
    <item>
      <title>Bash Functions for Vault</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Wed, 14 Oct 2020 01:03:05 +0000</pubDate>
      <link>https://dev.to/v6/bash-functions-for-vault-25cn</link>
      <guid>https://dev.to/v6/bash-functions-for-vault-25cn</guid>
      <description>&lt;p&gt;For those of us who've used Vault a lot, we all know and love &lt;a href="https://learn.hashicorp.com/tutorials/vault/getting-started-install"&gt;the Vault CLI&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;But, well, it has its &lt;em&gt;quirks&lt;/em&gt;. If not outright shortcomings. &lt;/p&gt;

&lt;p&gt;And if something isn't working in the CLI, my first instinct is to check the API, using a &lt;code&gt;curl&lt;/code&gt; command from the &lt;a href="https://www.vaultproject.io/api-docs"&gt;Vault API Docs&lt;/a&gt;. But that takes a lot of typing. &lt;/p&gt;

&lt;p&gt;Here's how to solve that: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bash Aliases&lt;/li&gt;
&lt;li&gt;Bash Functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's like you can build your own custom CLI commands. If the first thing that comes to your mind when you read that is, "Why. Why would anyone want that." You haven't experienced enough pain. Close this blog and come back to it later when you've lain awake at night haunted by WALs.&lt;/p&gt;

&lt;p&gt;Anyway, back to the Bash Aliases and Bash Functions for Vault. I'll give a couple examples of each.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bash Aliases for Vault
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;tknchk&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## This alias gets you your token's permissions, and assumes you have the jq CLI utility installed
alias tknchk='curl -s --header "X-Vault-Namespace: $VAULT_NAMESPACE" --header "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/sys/internal/ui/resultant-acl | jq'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;getVaultMounts&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## This alias gets the mounts on the current Vault
alias getvaultmounts='curl -s --header "X-Vault-Namespace: $VAULT_NAMESPACE" --header "X-Vault-Token: $VAULT_TOKEN" "$VAULT_ADDR/v1/sys/mounts'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Bash Functions for Vault
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;getVaultToken&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Get the damn Vault Token without needing to show it on the screen or do the whole set +o history thing
export VAULT_TOKEN
function getVaultToken(){
    read -rsp "Enter the damn Vault Token:" entered_value
    export VAULT_TOKEN="$entered_value"
    echo ""
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;muhVault&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function muhVault(){
echo "____   ____            .__   __    ___________.__              ._.
\   \ /   /____   __ __|  |_/  |_  \__    ___/|__| _____   ____| |
 \   Y   /\__  \ |  |  \  |\   __\   |    |   |  |/     \_/ __ \ |
  \     /  / __ \|  |  /  |_|  |     |    |   |  |  Y Y  \  ___/\|
   \___/  (____  /____/|____/__|     |____|   |__|__|_|  /\___  &amp;gt;_
               \/                                      \/     \/\/"

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Well, there you go! &lt;/p&gt;

&lt;p&gt;Which of these did you find useful? Got any of your own that you use? &lt;/p&gt;

</description>
    </item>
    <item>
      <title>HashiCorp Vault Enterprise and Azure Active Directory</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Thu, 08 Oct 2020 15:42:58 +0000</pubDate>
      <link>https://dev.to/v6/hashicorp-vault-enterprise-and-azure-active-directory-4641</link>
      <guid>https://dev.to/v6/hashicorp-vault-enterprise-and-azure-active-directory-4641</guid>
      <description>&lt;p&gt;If you're using AAD for authentication in other parts of your organization, there's a good chance you should be using it for Vault, too. &lt;/p&gt;

&lt;p&gt;LDAP, compared to OIDC, is insecure. And don't even get me started about the potential problems at scale with good ol' &lt;code&gt;userpass&lt;/code&gt;...&lt;/p&gt;

&lt;p&gt;To do this, you'll need to make an App Registration for Vault Enterprise.&lt;/p&gt;

&lt;p&gt;Then, you'll need to follow these instructions, but figure out how they work with Azure Active Directory instead of Auth0: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.hashicorp.com/tutorials/vault/oidc-auth?in=vault/auth-methods"&gt;https://learn.hashicorp.com/tutorials/vault/oidc-auth?in=vault/auth-methods&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;(Guess which one is easier...)&lt;/p&gt;

&lt;p&gt;But you have a few choices about what to do with that App Registration you make in Azure Active Directory. &lt;/p&gt;

&lt;h2&gt;
  
  
  Approach number 1:  Use AAD's idea of App Roles.
&lt;/h2&gt;

&lt;p&gt;AAD has an idea of "App Roles" in its App Registration manifests. These App Roles can be assigned to various groups, and provided as a "claim" in part of the JWT (JSON Web Token) in OIDC. Every time you want to add a new Azure AD "App Role," though, you have to edit the "Manifest" of the App Registration to add items to the JSON array labeled 'appRoles'. If you need to have an AAD Security Group with a different Vault Policy or set of Policies, you'll need add yet another Azure AD App Role, and a new Vault Auth Role in the Vault OIDC Auth Method for your Azure AD App Registration. Then, you add the AAD Security Group to your App Registration, and assign it the new AAD App Role you just made in your AAD App Registration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach number 2: Use Vault Identity Groups
&lt;/h2&gt;

&lt;p&gt;Skip the AAD App Roles, which have a limit of 1200 roles, and AAD App Roles require painful mutation of the "Manifest" by hand. Just use Vault Identity Groups instead. To each Vault Identity Group, you add an Identity Group Alias, and name that Identity Group Alias after the "Object Id" of the AAD Security Group that you want in Vault Enterprise. This means you still get to have AAD as an identification store and "source of truth" for authorization, where removal from or addition to AAD Security Groups controls authentication &amp;amp; authorization in Vault. But you also don't have to edit any JSON manifests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach number 3: Use Vault Entities
&lt;/h2&gt;

&lt;p&gt;A third approach, for admins of Vault Enterprise, would be to map various AAD user aliases to corresponding "entities" in Vault Enterprise's "Identity" Secrets Engine, then add those "entities" to the Vault Identity Groups that have various policies associated to them. I guess it is more of an onboarding scenario in which Vault manages much of the identification, and, because this is all done on a user-by-user basis, this entails no mapping of any given AAD Security Groups to Vault Identity Groups. It's a bit tricky, since Vault, at this point, is its own "source of truth" for permissions, and the only thing AAD is getting used for is to determine whether they have a valid AAD User. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>JQ Recipes for HashiCorp Vault</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Wed, 07 Oct 2020 22:48:50 +0000</pubDate>
      <link>https://dev.to/v6/jq-recipes-for-hashicorp-vault-4gjf</link>
      <guid>https://dev.to/v6/jq-recipes-for-hashicorp-vault-4gjf</guid>
      <description>&lt;p&gt;This post will show some recipes for working with the &lt;code&gt;jq&lt;/code&gt; utility in Bash to get data from HashiCorp Vault Enterprise via its ReST API. &lt;/p&gt;

&lt;p&gt;You can install &lt;code&gt;jq&lt;/code&gt; from here: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://stedolan.github.io/jq"&gt;https://stedolan.github.io/jq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if you don't have a "Bash" environment, you can get one from here: &lt;a href="https://git-scm.com"&gt;https://git-scm.com&lt;/a&gt; (&lt;a href="https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/"&gt;make sure to select the "Git Bash" option when given the choice in the installation process&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;If you're on Windows you might have some troubles or need to use some different name for &lt;code&gt;jq-64.exe&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You also need to download and unzip Vault from &lt;a href="https://vaultproject.io"&gt;https://vaultproject.io&lt;/a&gt;, and run it in a Git Bash like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd ~/Downloads
$ echo 'alias vault="~/Downloads/vault.exe"' &amp;gt;&amp;gt; ~/.bash_profile ##(Only do this if you're on Windows)
$ source ~/.bash_profile ## Again, needed only if you're on Windows
$ ./vault server -dev -dev-root-token-id=s.JzcMzvFCAVHvxE4xusglvoHF

==&amp;gt; Vault server configuration:

             Api Address: http://127.0.0.1:8200
                     Cgo: disabled
         Cluster Address: https://127.0.0.1:8201
              Go Version: go1.14.7
              Listener 1: tcp (addr: "127.0.0.1:8200", cluster address: "127.0.0.1:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls
: "disabled")
               Log Level: info
                   Mlock: supported: false, enabled: false
           Recovery Mode: false
                 Storage: inmem
                 Version: Vault v1.5.3
             Version Sha: 9fcd81405feb320390b9d71e15a691c3bc1daeef

WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory
and starts unsealed with a single unseal key. The root token is already
authenticated to the CLI, so you can immediately begin using Vault.

You may need to set the following environment variable:

PowerShell:
    $env:VAULT_ADDR="http://127.0.0.1:8200"
cmd.exe:
    set VAULT_ADDR=http://127.0.0.1:8200

The unseal key and root token are displayed below in case you want to
seal/unseal the Vault or re-authenticate.

Unseal Key: t/5BTQzZ5LbD0JIYkpQ9dY3fLEqZEMyena3aCh4+sWw=
Root Token: s.JzcMzvFCAVHvxE4xusglvoHF

Development mode should NOT be used in production installations!

==&amp;gt; Vault server started! Log data will stream in below:

2020-10-07T15:14:47.286-0700 [INFO]  proxy environment: http_proxy= https_proxy= no_proxy=
2020-10-07T15:14:47.289-0700 [WARN]  no `api_addr` value specified in config or in VAULT_API_ADDR; falling back to detection if possible, but this value s
hould be manually set
2020-10-07T15:14:47.327-0700 [INFO]  core: security barrier not initialized
2020-10-07T15:14:47.327-0700 [INFO]  core: security barrier initialized: stored=1 shares=1 threshold=1
2020-10-07T15:14:47.332-0700 [INFO]  core: post-unseal setup starting
2020-10-07T15:14:47.349-0700 [INFO]  core: loaded wrapping token key
2020-10-07T15:14:47.349-0700 [INFO]  core: successfully setup plugin catalog: plugin-directory=
2020-10-07T15:14:47.356-0700 [INFO]  core: no mounts; adding default mount table
2020-10-07T15:14:47.360-0700 [INFO]  core: successfully mounted backend: type=cubbyhole path=cubbyhole/
2020-10-07T15:14:47.363-0700 [INFO]  core: successfully mounted backend: type=system path=sys/
2020-10-07T15:14:47.365-0700 [INFO]  core: successfully mounted backend: type=identity path=identity/
2020-10-07T15:14:47.370-0700 [INFO]  core: successfully enabled credential backend: type=token path=token/
2020-10-07T15:14:47.370-0700 [INFO]  rollback: starting rollback manager
2020-10-07T15:14:47.370-0700 [INFO]  core: restoring leases
2020-10-07T15:14:47.376-0700 [INFO]  expiration: lease restore complete
2020-10-07T15:14:47.376-0700 [INFO]  identity: entities restored
2020-10-07T15:14:47.376-0700 [INFO]  identity: groups restored
2020-10-07T15:14:47.377-0700 [INFO]  core: post-unseal setup complete
2020-10-07T15:14:47.380-0700 [INFO]  core: root token generated
2020-10-07T15:14:47.380-0700 [INFO]  core: pre-seal teardown starting
2020-10-07T15:14:47.380-0700 [INFO]  rollback: stopping rollback manager
2020-10-07T15:14:47.380-0700 [INFO]  core: pre-seal teardown complete
2020-10-07T15:14:47.381-0700 [INFO]  core.cluster-listener.tcp: starting listener: listener_address=127.0.0.1:8201
2020-10-07T15:14:47.381-0700 [INFO]  core.cluster-listener: serving cluster requests: cluster_listen_address=127.0.0.1:8201
2020-10-07T15:14:47.381-0700 [INFO]  core: post-unseal setup starting
2020-10-07T15:14:47.381-0700 [INFO]  core: loaded wrapping token key
2020-10-07T15:14:47.381-0700 [INFO]  core: successfully setup plugin catalog: plugin-directory=
2020-10-07T15:14:47.382-0700 [INFO]  core: successfully mounted backend: type=system path=sys/
2020-10-07T15:14:47.383-0700 [INFO]  core: successfully mounted backend: type=identity path=identity/
2020-10-07T15:14:47.383-0700 [INFO]  core: successfully mounted backend: type=cubbyhole path=cubbyhole/
2020-10-07T15:14:47.384-0700 [INFO]  core: successfully enabled credential backend: type=token path=token/
2020-10-07T15:14:47.384-0700 [INFO]  rollback: starting rollback manager
2020-10-07T15:14:47.384-0700 [INFO]  core: restoring leases
2020-10-07T15:14:47.384-0700 [INFO]  identity: entities restored
2020-10-07T15:14:47.384-0700 [INFO]  expiration: lease restore complete
2020-10-07T15:14:47.384-0700 [INFO]  identity: groups restored
2020-10-07T15:14:47.384-0700 [INFO]  core: post-unseal setup complete
2020-10-07T15:14:47.384-0700 [INFO]  core: vault is unsealed
2020-10-07T15:14:47.401-0700 [INFO]  core: successful mount: namespace= path=secret/ type=kv
2020-10-07T15:14:47.411-0700 [INFO]  secrets.kv.kv_8bdaeac5: collecting keys to upgrade
2020-10-07T15:14:47.411-0700 [INFO]  secrets.kv.kv_8bdaeac5: done collecting keys: num_keys=1
2020-10-07T15:14:47.411-0700 [INFO]  secrets.kv.kv_8bdaeac5: upgrading keys finished
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leave Vault running in that terminal window, and open another one to run the following stuff in: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;export VAULT_ADDR=http://127.0.0.1:8200&lt;/code&gt;&lt;br&gt;
&lt;code&gt;export VAULT_TOKEN=s.JzcMzvFCAVHvxE4xusglvoHF&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, to prepare further, create some auth methods: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;./vault auth enable kubernetes&lt;/code&gt;&lt;br&gt;
&lt;code&gt;./vault auth enable userpass&lt;/code&gt;&lt;br&gt;
&lt;code&gt;./vault auth enable okta&lt;/code&gt;&lt;br&gt;
&lt;code&gt;./vault auth enable aws&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Example 1: Get a list of all of the Auth Methods that are of type &lt;code&gt;okta&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Shameless theft from this SO dude: &lt;a href="https://stackoverflow.com/questions/18592173/select-objects-based-on-value-of-variable-in-object-using-jq/31911811#comment112920282_18608100"&gt;https://stackoverflow.com/questions/18592173/select-objects-based-on-value-of-variable-in-object-using-jq/31911811#comment112920282_18608100&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, look at the response without &lt;code&gt;jq&lt;/code&gt;: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here's the output from that command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth
{"kubernetes/":{"accessor":"auth_kubernetes_9bc9df5a","config":{"default_lease_t
tl":0,"force_no_cache":false,"max_lease_ttl":0,"token_type":"default-service"},"
description":"","external_entropy_access":false,"local":false,"options":null,"se
al_wrap":false,"type":"kubernetes","uuid":"72df2827-2ac1-1fb1-7d5a-c6262a4f5300"
},"token/":{"accessor":"auth_token_332e9370","config":{"default_lease_ttl":0,"fo
rce_no_cache":false,"max_lease_ttl":0,"token_type":"default-service"},"descripti
on":"token based credentials","external_entropy_access":false,"local":false,"opt
ions":null,"seal_wrap":false,"type":"token","uuid":"ba81c552-e8aa-9ba9-5243-0580
59545ccc"},"userpass/":{"accessor":"auth_userpass_1dd44d0b","config":{"default_l
ease_ttl":0,"force_no_cache":false,"max_lease_ttl":0,"token_type":"default-servi
ce"},"description":"","external_entropy_access":false,"local":false,"options":nu
ll,"seal_wrap":false,"type":"userpass","uuid":"e02a55d0-bd07-efeb-f5de-37fb5dcd5
84a"},"okta/":{"accessor":"auth_okta_fb869c57","config":{"default_lease_ttl":0,"
force_no_cache":false,"max_lease_ttl":0,"token_type":"default-service"},"descrip
tion":"","external_entropy_access":false,"local":false,"options":null,"seal_wrap
":false,"type":"okta","uuid":"1a445f3a-d302-ac6b-4508-def7a289894a"},"request_id
":"dc3dbab5-e001-498b-514c-05665baf09d2","lease_id":"","renewable":false,"lease_
duration":0,"data":{"kubernetes/":{"accessor":"auth_kubernetes_9bc9df5a","config
":{"default_lease_ttl":0,"force_no_cache":false,"max_lease_ttl":0,"token_type":"
default-service"},"description":"","external_entropy_access":false,"local":false
,"options":null,"seal_wrap":false,"type":"kubernetes","uuid":"72df2827-2ac1-1fb1
-7d5a-c6262a4f5300"},"okta/":{"accessor":"auth_okta_fb869c57","config":{"default
_lease_ttl":0,"force_no_cache":false,"max_lease_ttl":0,"token_type":"default-ser
vice"},"description":"","external_entropy_access":false,"local":false,"options":
null,"seal_wrap":false,"type":"okta","uuid":"1a445f3a-d302-ac6b-4508-def7a289894
a"},"token/":{"accessor":"auth_token_332e9370","config":{"default_lease_ttl":0,"
force_no_cache":false,"max_lease_ttl":0,"token_type":"default-service"},"descrip
tion":"token based credentials","external_entropy_access":false,"local":false,"o
ptions":null,"seal_wrap":false,"type":"token","uuid":"ba81c552-e8aa-9ba9-5243-05
8059545ccc"},"userpass/":{"accessor":"auth_userpass_1dd44d0b","config":{"default
_lease_ttl":0,"force_no_cache":false,"max_lease_ttl":0,"token_type":"default-ser
vice"},"description":"","external_entropy_access":false,"local":false,"options":
null,"seal_wrap":false,"type":"userpass","uuid":"e02a55d0-bd07-efeb-f5de-37fb5dc
d584a"}},"wrap_info":null,"warnings":null,"auth":null}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty messy, right? Let's clean it up a bit: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl --request GET --header "X-Vault-Token $VAULT_TOKEN" --header "X-Vault-Namespace $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth | jq&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above command will show the output in more of a structured format with indentation to indicate deeper levels of the object.&lt;/p&gt;

&lt;p&gt;Here's the output from the above command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2695    0  2695    0     0   105k      0 --:--:-- --:--:-- --:--:--  105k
{
  "token/": {
    "accessor": "auth_token_332e9370",
    "config": {
      "default_lease_ttl": 0,
      "force_no_cache": false,
      "max_lease_ttl": 0,
      "token_type": "default-service"
    },
    "description": "token based credentials",
    "external_entropy_access": false,
    "local": false,
    "options": null,
    "seal_wrap": false,
    "type": "token",
    "uuid": "ba81c552-e8aa-9ba9-5243-058059545ccc"
  },
  "userpass/": {
    "accessor": "auth_userpass_1dd44d0b",
    "config": {
      "default_lease_ttl": 0,
      "force_no_cache": false,
      "max_lease_ttl": 0,
      "token_type": "default-service"
    },
    "description": "",
    "external_entropy_access": false,
    "local": false,
    "options": null,
    "seal_wrap": false,
    "type": "userpass",
    "uuid": "e02a55d0-bd07-efeb-f5de-37fb5dcd584a"
  },
  "okta/": {
    "accessor": "auth_okta_fb869c57",
    "config": {
      "default_lease_ttl": 0,
      "force_no_cache": false,
      "max_lease_ttl": 0,
      "token_type": "default-service"
    },
    "description": "",
    "external_entropy_access": false,
    "local": false,
    "options": null,
    "seal_wrap": false,
    "type": "okta",
    "uuid": "1a445f3a-d302-ac6b-4508-def7a289894a"
  },
  "kubernetes/": {
    "accessor": "auth_kubernetes_9bc9df5a",
    "config": {
      "default_lease_ttl": 0,
      "force_no_cache": false,
      "max_lease_ttl": 0,
      "token_type": "default-service"
    },
    "description": "",
    "external_entropy_access": false,
    "local": false,
    "options": null,
    "seal_wrap": false,
    "type": "kubernetes",
    "uuid": "72df2827-2ac1-1fb1-7d5a-c6262a4f5300"
  },
  "request_id": "633adc4e-bd04-e579-58d4-34bde3dc91ee",
  "lease_id": "",
  "renewable": false,
  "lease_duration": 0,
  "data": {
    "kubernetes/": {
      "accessor": "auth_kubernetes_9bc9df5a",
      "config": {
        "default_lease_ttl": 0,
        "force_no_cache": false,
        "max_lease_ttl": 0,
        "token_type": "default-service"
      },
      "description": "",
      "external_entropy_access": false,
      "local": false,
      "options": null,
      "seal_wrap": false,
      "type": "kubernetes",
      "uuid": "72df2827-2ac1-1fb1-7d5a-c6262a4f5300"
    },
    "okta/": {
      "accessor": "auth_okta_fb869c57",
      "config": {
        "default_lease_ttl": 0,
        "force_no_cache": false,
        "max_lease_ttl": 0,
        "token_type": "default-service"
      },
      "description": "",
      "external_entropy_access": false,
      "local": false,
      "options": null,
      "seal_wrap": false,
      "type": "okta",
      "uuid": "1a445f3a-d302-ac6b-4508-def7a289894a"
    },
    "token/": {
      "accessor": "auth_token_332e9370",
      "config": {
        "default_lease_ttl": 0,
        "force_no_cache": false,
        "max_lease_ttl": 0,
        "token_type": "default-service"
      },
      "description": "token based credentials",
      "external_entropy_access": false,
      "local": false,
      "options": null,
      "seal_wrap": false,
      "type": "token",
      "uuid": "ba81c552-e8aa-9ba9-5243-058059545ccc"
    },
    "userpass/": {
      "accessor": "auth_userpass_1dd44d0b",
      "config": {
        "default_lease_ttl": 0,
        "force_no_cache": false,
        "max_lease_ttl": 0,
        "token_type": "default-service"
      },
      "description": "",
      "external_entropy_access": false,
      "local": false,
      "options": null,
      "seal_wrap": false,
      "type": "userpass",
      "uuid": "e02a55d0-bd07-efeb-f5de-37fb5dcd584a"
    }
  },
  "wrap_info": null,
  "warnings": null,
  "auth": null
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's get all of the Auth Methods that are of type &lt;code&gt;okta&lt;/code&gt;: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth | jq .data | jq 'to_entries[] | select(.value.type=="okta") | .key'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The first part gets you the contents of the "data" part of the response. The second part, with the &lt;code&gt;'to_entries[]&lt;/code&gt;, gets you the data in a format where you can read out the key names separately. The &lt;code&gt;| select(.value.type=="okta")&lt;/code&gt; part gets you the auth methods that have the value &lt;code&gt;"okta"&lt;/code&gt; under the key &lt;code&gt;type&lt;/code&gt;. The &lt;code&gt;| .key'&lt;/code&gt; part gets you the key of the auth method, usually ending in a &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here's the output for my example (should just be &lt;code&gt;"okta/"&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth | jq .data | jq 'to_entries[] | select(.value.type=="okta") | .key'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2695    0  2695    0     0   125k      0 --:--:-- --:--:-- --:--:--  125k
"okta/"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Example 2: How to get an accessor based on a Bash variable:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;export OKTAAUTH='okta/'&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;lt;&amp;lt; EOF &amp;gt; jqparams.txt
."data"."${OKTAAUTH}/"."accessor"
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth | jq -f jqparams.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ export OKTAAUTH='okta/'

$ cat &amp;lt;&amp;lt; EOF &amp;gt; jqparams.txt
&amp;gt; ."data"."${OKTAAUTH}"."accessor"
&amp;gt; EOF

$ curl --request GET --header "X-Vault-Token: $VAULT_TOKEN" --header "X-Vault-Namespace: $VAULT_NAMESPACE" $VAULT_ADDR/v1/sys/auth | jq -f jqparams.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2695    0  2695    0     0   125k      0 --:--:-- --:--:-- --:--:--  125k
"auth_okta_fb869c57"

$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Example 3: How to get an Accessor Without a Bash Variable
&lt;/h2&gt;

&lt;p&gt;In this case, it's the same as Example 2, except that you needn't bother with a &lt;code&gt;jqparams.txt&lt;/code&gt; file. &lt;/p&gt;

&lt;p&gt;."data"."okta/"."accessor"&lt;/p&gt;

&lt;p&gt;Further reading for the nerds: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://remysharp.com/drafts/jq-recipes"&gt;https://remysharp.com/drafts/jq-recipes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stedolan.github.io/jq/tutorial/"&gt;https://stedolan.github.io/jq/tutorial/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stedolan.github.io/jq/manual/"&gt;https://stedolan.github.io/jq/manual/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vault</category>
      <category>jq</category>
      <category>api</category>
      <category>bash</category>
    </item>
    <item>
      <title>Vault Enterprise Service Glossary</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Thu, 24 Sep 2020 02:28:38 +0000</pubDate>
      <link>https://dev.to/v6/vault-enterprise-service-glossary-21ki</link>
      <guid>https://dev.to/v6/vault-enterprise-service-glossary-21ki</guid>
      <description>&lt;p&gt;Post installation of Vault Enterprise servers, clusters, storage backends, supporting Cloud Resources, and Load Balancers, there's still much to be done in the Vault API! &lt;/p&gt;

&lt;p&gt;And much to be said. When documenting any of the many integrations of Vault with other services and systems, you could use the following glossary of terms: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Enterprise Service&lt;/strong&gt; - The overall Secrets Management service offered to your developers and other users, as implemented by Vault Enterprise (Or the open source version too). Example: "The Rupture Vault Enterprise Service" offered at secrets.internal.ruptureranch.co, supported by the skilled Vault SREs of Rupture Ranch Inc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Plugins&lt;/strong&gt; - These augment Vault's core functionality beyond what the Vault Enterprise Binary can do. Each Vault Plugin enables a new "Vault Secrets Engine" or a new "Vault Auth Method." You install a Vault Plugin by putting the plugin's binary into a folder in the same system that the Vault Binary runs in, and configuring Vault to look for plugins inside that folder. This functionality can be restricted, but by default is available to all Vault Namespaces once installed. Example: The &lt;a href="https://github.com/immutability-io/vault-btc"&gt;&lt;code&gt;vault-btc&lt;/code&gt;&lt;/a&gt; plugin uses Vault to implement a Bitcoin wallet, and can be installed by copying one of its release binaries to the &lt;code&gt;/etc/vault.d/plugins/&lt;/code&gt; directory, and adding that &lt;code&gt;/etc/vault.d/plugins/&lt;/code&gt; directory to your vault.hcl configuration file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Namespace&lt;/strong&gt; - A "Vault within a Vault" that can be used for delegation of authority, separation of duties, reducing the blast radius of a change, confidentiality levels, GPDR compliance, or self service. Example: The &lt;code&gt;pci&lt;/code&gt; Vault Namespace is separate from the &lt;code&gt;dbtest&lt;/code&gt; Vault Namespace, within the Vault Enterprise Service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Mount&lt;/strong&gt; - At the top level of Vault, or at the top level of a Vault Namespace within Vault, this is an endpoint like a Secrets Engine or another namespace that can be enabled by the user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Secrets Engine&lt;/strong&gt; - A type of "mount" at the top level of a Vault Namespace, which stores Secrets or generates them on behalf of the API Consumers of the Vault Enterprise Service. These either store "Static Secrets" from static secret paths or generate "Dynamic Secrets" from Secret Engine Roles, to be described later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault API Consumers&lt;/strong&gt; - Clients that make HTTP requests to the Vault Enterprise API. Example: A Python script running in an AWS lambda sending an HTTP request to a Vault Enterprise Service to generate a Dynamic Secret.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Auth Method&lt;/strong&gt; - An authentication method for Vault, at the root of the Vault, or within a Vault Namespace, preceded by &lt;code&gt;/auth/&lt;/code&gt;. Example: A TLS Auth Method was enabled within the &lt;code&gt;pci&lt;/code&gt; namespace at &lt;code&gt;v1/pci/auth/cert&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Auth Method Role&lt;/strong&gt; - A Role, within an Authentication Method for Vault, against which a given Vault API Consumer or consumers may authenticate. These grant Vault Tokens tied to a set of one or more Vault ACL Policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Secrets Engine Role&lt;/strong&gt; - These are created within Secrets Engines, and will generate Dynamic Secrets on demand. Example: The &lt;code&gt;vgdbx001&lt;/code&gt; Vault Secrets Engine Role was created within the &lt;code&gt;postgres02&lt;/code&gt; Vault Secrets Engine within the &lt;code&gt;pci&lt;/code&gt; Vault Namespace at &lt;code&gt;v1/pci/postgres02/roles/vgdbx001&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Tokens&lt;/strong&gt; - Vault API Tokens used to authenticate HTTP Requests to Vault.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault ACL Policies&lt;/strong&gt; - Lists of API paths or, within a Vault Namespace, relative API paths, each with another list of the operations allowed against the API endpoints that correspond to those API paths or relative API paths.  Example: The &lt;code&gt;pci-namespace-admin&lt;/code&gt; Vault ACL policy grants permission to do any operation against any of paths within the &lt;code&gt;pci&lt;/code&gt; Vault Namespace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault API Request&lt;/strong&gt; - An HTTP request to the Vault Enterprise Service's ReST API. Typically includes the header &lt;code&gt;X-Vault-Token&lt;/code&gt;, and the header &lt;code&gt;X-Vault-Namespace&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Vault Identity Terms
&lt;/h2&gt;

&lt;p&gt;This section has some more details on concepts related to the Vault Identity store. More details are in the documentation at vaultproject.io: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.vaultproject.io/docs/secrets/identity#concepts"&gt;vaultproject.io: Vault Identity Concepts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Identity Store&lt;/strong&gt; - A system that keeps track of all of the Vault Clients.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Entity&lt;/strong&gt; - A &lt;em&gt;Vault Entity&lt;/em&gt; is a given recognized client in Vault's client identity model, and may have multiple &lt;strong&gt;Vault Aliases&lt;/strong&gt; associated with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Aliases&lt;/strong&gt; - Any of the various authentication leases from roles to which a given &lt;em&gt;Vault Entity&lt;/em&gt; is associated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vault Entity Group&lt;/strong&gt; - A &lt;em&gt;Group&lt;/em&gt; of &lt;em&gt;Vault Entities&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples of Using the Terms
&lt;/h2&gt;

&lt;p&gt;Here are some more examples stringing these together: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I enabled &amp;amp; configured an &lt;strong&gt;Auth Method&lt;/strong&gt;, but I didn't add any &lt;strong&gt;Auth Method Roles&lt;/strong&gt; in it yet!&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;dbtest&lt;/code&gt; &lt;strong&gt;Namespace&lt;/strong&gt;, I made a &lt;strong&gt;API Request&lt;/strong&gt; to make a new &lt;strong&gt;Auth Method Role&lt;/strong&gt; in the &lt;code&gt;aws&lt;/code&gt; &lt;strong&gt;Auth Method&lt;/strong&gt;, and added the &lt;code&gt;pci-readonly&lt;/code&gt; &lt;strong&gt;ACL Policy&lt;/strong&gt; to that role.&lt;/p&gt;

&lt;p&gt;We may have had higher load on the Vault Servers because we got so many &lt;strong&gt;Vault API Requests&lt;/strong&gt; against our new &lt;strong&gt;Vault Secrets Engine Role&lt;/strong&gt; in the &lt;code&gt;PostGreSQL&lt;/code&gt; &lt;strong&gt;Vault Secrets Engine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you want to see all of the &lt;strong&gt;Secrets Engines&lt;/strong&gt; in your &lt;code&gt;dbtest/&lt;/code&gt; &lt;strong&gt;Vault Namespace&lt;/strong&gt;, you should list all of the &lt;strong&gt;Vault Mounts&lt;/strong&gt; in &lt;code&gt;dbtest/&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When writing documentation that's focused on people who do not have deep experience with Vault Enterprise, it may be wise to put the word "Vault" in front of the specific term, in case it may be confused with another system. For instance, saying &lt;strong&gt;Vault Namespace&lt;/strong&gt; rather than just &lt;strong&gt;Namespace&lt;/strong&gt; may help avoid confusion with a Kubernetes Namespace.&lt;/p&gt;

&lt;p&gt;For any questions, or to add a term, send me a message!&lt;/p&gt;

&lt;p&gt;I also want comments on this page using the above terms in ways that make sense.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Cohesion and Coupling for Secrets Management in CI/CD Work Flows</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Mon, 11 May 2020 21:59:09 +0000</pubDate>
      <link>https://dev.to/digitalonus/cohesion-and-coupling-for-secrets-management-in-ci-cd-work-flows-1m83</link>
      <guid>https://dev.to/digitalonus/cohesion-and-coupling-for-secrets-management-in-ci-cd-work-flows-1m83</guid>
      <description>&lt;p&gt;TL;DR: If you couple your some other deployment process to your Secrets Management, then you would have to redeploy for new creds. And that's &lt;strong&gt;bad&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There are a few "tight couplings" to avoid for Secrets Management:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coupling to Infrastructure as Code (IaC)&lt;/li&gt;
&lt;li&gt;Coupling to Configuration as Code (CaC)&lt;/li&gt;
&lt;li&gt;Coupling to Application Deployment (CI/CD)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The test is, if I need to do an emergency revocation, do I have to wait for any of the above to complete?&lt;/p&gt;

&lt;p&gt;For example, if you happen to be using git2consul for secrets management*, used in one of the above 3 systems, is the only way to update secrets, then you have to wait for a deployment for one of the above to complete. If the lack of those credentials is what's causing the problem in the first place, or the build happens to be broken at the same time as the emergency revocation occurs, you'd be in trouble. &lt;/p&gt;

&lt;p&gt;A kinder, gentler way to decouple these work flows from Secrets Management? You could ensure that Consul could be edited directly for emergency.  While still having a git2consul pipeline for the configs.&lt;/p&gt;

&lt;p&gt;If you are generating database creds, and giving them to the application, that isn’t dynamic any longer as the application can not generate them but now receives them.&lt;/p&gt;

&lt;p&gt;As long as git2consul isn't the only way to revoke / re-issue creds, I think that makes a lot of sense.&lt;/p&gt;

&lt;p&gt;*If you have HashiCorp Vault available, it may be &lt;a href="https://github.com/breser/git2consul/issues/134"&gt;better to consider Vault for this&lt;/a&gt;, especially since Vault works with &lt;code&gt;consul-template&lt;/code&gt;, or better yet &lt;code&gt;envconsul&lt;/code&gt; or &lt;a href="https://www.vaultproject.io/docs/agent/"&gt;Vault Agent&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>secretsmanagement</category>
      <category>architecture</category>
      <category>coupling</category>
      <category>informationsecurity</category>
    </item>
    <item>
      <title>Is Telegram the Best in Class for Privacy? (TL;DR: Nope)</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Sat, 11 Apr 2020 00:45:58 +0000</pubDate>
      <link>https://dev.to/v6/is-telegram-the-best-in-class-for-privacy-55cc</link>
      <guid>https://dev.to/v6/is-telegram-the-best-in-class-for-privacy-55cc</guid>
      <description>&lt;p&gt;I do not typically recommend the Telegram application for private messaging, neither to technical neophytes nor to those of us more advanced in the ways of InfoSec.  &lt;/p&gt;

&lt;p&gt;Especially because any people who would be willing to get a more secure messaging application might as well get an app backed by more solid encryption &amp;amp; a UX with more secure defaults. Which Telegram is, well, not. &lt;/p&gt;

&lt;p&gt;I have come across some reviews of Telegram's implementation. The Telegram creators "rolled their own" custom built encryption algorithm, and made some questionable choices in the process. &lt;/p&gt;

&lt;p&gt;Chats are not encrypted by default. &lt;/p&gt;

&lt;p&gt;Telegram developers can in overwhelming majority of cases read peoples' messages. And I have heard rumors, though I cannot confirm them, that some Telegram server operators have begun to exercise some minimal editorial prerogatives by monitoring and removal of content they deem objectionable. Perhaps there's a rationale for that, but "we find your message content objectionable" doesn't reassure me that my message content is private.&lt;/p&gt;

&lt;p&gt;TLDR: Telegram's private chats are more secure than SMS, &lt;a href="https://www.schneier.com/blog/archives/2018/04/russia_is_banni.html"&gt;and have, by dint of hard work, earn the coveted "banned in Russia/&lt;/a&gt;&lt;a href="https://www.schneier.com/blog/archives/2018/06/the_effects_of_4.html"&gt;Iran&lt;/a&gt;&lt;a href="https://www.schneier.com/blog/archives/2018/04/russia_is_banni.html"&gt;" stamp of approval&lt;/a&gt;. But Telegram's relatively good UI hides a relatively questionable underlying implementation.&lt;/p&gt;

&lt;p&gt;It's not just me. Others are skeptical of Telegram's underlying security as well, especially in comparison to applications designed for the purpose of keeping message content private by default, like Signal Private Messenger or Keybase.&lt;/p&gt;

&lt;p&gt;Source: &lt;br&gt;
&lt;a href="https://eprint.iacr.org/2015/1177.pdf"&gt;On the CCA (in)security of MTProto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Links that at least good for showing "I'm not the only grumpy troll out there who's skeptical of this BS.": &lt;br&gt;
&lt;a href="https://news.ycombinator.com/item?id=16795219"&gt;https://news.ycombinator.com/item?id=16795219&lt;/a&gt;&lt;br&gt;
&lt;a href="https://news.ycombinator.com/item?id=6913632"&gt;https://news.ycombinator.com/item?id=6913632&lt;/a&gt; &lt;br&gt;
&lt;a href="https://www.schneier.com/blog/archives/2016/06/comparing_messa.html"&gt;https://www.schneier.com/blog/archives/2016/06/comparing_messa.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>signal</category>
      <category>openwhisper</category>
      <category>privacy</category>
    </item>
    <item>
      <title>vault Error ... unsupported protocol scheme ""</title>
      <dc:creator>🦄N B🛡</dc:creator>
      <pubDate>Wed, 11 Mar 2020 01:19:04 +0000</pubDate>
      <link>https://dev.to/v6/vault-error-unsupported-protocol-scheme-21nb</link>
      <guid>https://dev.to/v6/vault-error-unsupported-protocol-scheme-21nb</guid>
      <description>&lt;p&gt;I was brainless enough to get into this situation while using the Vault client binary: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;unsupported protocol scheme ""&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;A better translation would be, "WTF my man, is this even a URI??"&lt;/p&gt;

&lt;p&gt;It's probably because of a malformed URI or absent URI getting used in a web request by &lt;a href="https://github.com/golang/go/blob/master/src/net/http/transport.go#L519-L522"&gt;GoLang's HTTP thingy&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if !isHTTP {
        req.closeBody()
        return nil, &amp;amp;badStringError{"unsupported protocol scheme", scheme}
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here's an example of what I did with it: &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;namespaccckler[micro-service-metadata-provider !?+]$ vault status
Error checking seal status: Get notsosecure/v1/sys/seal-status: unsupported protocol scheme ""
namespaccckler1[micro-service-metadata-provider !?+]$ export VAULT_ADDR=http://127.0.0.1:8200
namespaccckler[micro-service-metadata-provider !?+]$ vault status
Key             Value
---             -----
Seal Type       shamir
Initialized     true
Sealed          false
Total Shares    10
Threshold       4
Version         1.6.3+prem
Cluster Name    vault-cluster-c9387625
Cluster ID      0280f278-443a-210c-dcdd-c3dee0bd5f1d
HA Enabled      false
namespaccckler[micro-service-metadata-provider !?+]$ 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Anyone else run into this sort of bungling?&lt;/p&gt;

</description>
      <category>hashicorpvault</category>
      <category>vaulterrors</category>
      <category>unsupportedprotocol</category>
      <category>stupid</category>
    </item>
  </channel>
</rss>
