Skip to content

Add keystore execution and state modules#52126

Merged
garethgreenaway merged 14 commits intosaltstack:developfrom
mchugh19:keystore
Mar 18, 2019
Merged

Add keystore execution and state modules#52126
garethgreenaway merged 14 commits intosaltstack:developfrom
mchugh19:keystore

Conversation

@mchugh19
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an execution and state module to manage Java keystore files.

What issues does this PR fix or reference?

#10237

New Behavior

Execution module example:

# salt-call keystore.list /path/to/keystore.jks changeit
  local:
    |_
      ----------
      alias:
          hostname1
      expired:
          True
      sha1:
          CB:5E:DE:50:57:99:51:87:8E:2E:67:13:C5:3B:E9:38:EB:23:7E:40
      type:
          TrustedCertEntry
      valid_start:
          August 22 2012
      valid_until:
          August 21 2017

#salt-call keystore.add pair6 /tmp/test3.store changeit /tmp/512.cert /tmp/512.key
#salt-call keystore.remove pair6 /tmp/test3.store changeit

State example:

define_keystore:
    keystore.managed:
      - name: /tmp/statestore.jks
      - passphrase: changeit
      - force_remove: True
      - entries:
        - alias: hostname1
          certificate: /tmp/testcert.crt
        - alias: remotehost
          certificate: /tmp/512.cert
          private_key: /tmp/512.key
        - alias: stringhost
          certificate: |
            -----BEGIN CERTIFICATE-----
            MIICEjCCAX
            Hn+GmxZA
            -----END CERTIFICATE-----

Tests written?

No

Commits signed with GPG?

No

@garethgreenaway
Copy link
Copy Markdown
Contributor

@mchugh19 This looks great. Would you be able to add some tests?

@mchugh19
Copy link
Copy Markdown
Contributor Author

Tests added for state module. Execution module is a thin wrapper around the pyjks library, so I don't know if it makes sense to basically duplicate its test framework.

@garethgreenaway
Copy link
Copy Markdown
Contributor

@mchugh19 Awesome! Thanks!

@garethgreenaway garethgreenaway merged commit bf6e7c1 into saltstack:develop Mar 18, 2019
@mchugh19 mchugh19 deleted the keystore branch March 19, 2019 06:46
mchugh19 pushed a commit to mchugh19/salt that referenced this pull request Oct 13, 2019
Add keystore execution and state modules
@mchugh19 mchugh19 mentioned this pull request Oct 13, 2019
@waynew waynew added the has master-port port to master has been created label Oct 17, 2019
dwoz added a commit that referenced this pull request Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has master-port port to master has been created

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants