vaultkit 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/lib/vkit/cli/base_cli.rb +2 -1
- data/lib/vkit/cli/commands/agent_tokens_list_command.rb +2 -11
- data/lib/vkit/cli/commands/approval_watch_command.rb +2 -2
- data/lib/vkit/cli/commands/init_command.rb +2 -2
- data/lib/vkit/cli/commands/policy_pack_upgrade_command.rb +8 -4
- data/lib/vkit/cli/commands/scan_command.rb +1 -1
- data/lib/vkit/cli.rb +1 -1
- data/lib/vkit/core/auth_client.rb +9 -5
- data/lib/vkit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 693839ee170f79bd7012760053b2e0240f2730693741603029182066462b6c20
|
|
4
|
+
data.tar.gz: 5e200af5f55787dc471f8299f63e33f5aeb2613646aa3f28dd0012142559ca38
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89687754411a6d542d819443638129bfbb1650a0745e18e71e2cb6d677ab71d9d43bb57768af450d3a51a5d821c0297fe485bcaedee687b595220b3b47e69c38
|
|
7
|
+
data.tar.gz: 2771cbb8bbcb6a1c6570ddeaa9854a232c07f2583195cf9eb0dc2ed8615b52438b6da150cb415b7f95b53f2955e31b5b4101b2157b0c3da1823431dce811e8eb
|
data/README.md
CHANGED
|
@@ -232,6 +232,17 @@ VKIT_TOKEN="$APPROVER_TOKEN" vkit approval:approve 42
|
|
|
232
232
|
`vkit login --endpoint` still reads `VKIT_ENDPOINT` as its default endpoint when
|
|
233
233
|
`VKIT_TOKEN` isn't set.
|
|
234
234
|
|
|
235
|
+
### TLS certificates
|
|
236
|
+
|
|
237
|
+
`vkit` checks the control plane's TLS certificate against your system's trusted
|
|
238
|
+
certificates on every HTTPS call, including `vkit login`. If your control plane
|
|
239
|
+
uses a self-signed or private-CA certificate, trust it by pointing
|
|
240
|
+
`SSL_CERT_FILE` at a PEM bundle that includes it:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
export SSL_CERT_FILE=/path/to/ca-bundle.pem
|
|
244
|
+
```
|
|
245
|
+
|
|
235
246
|
---
|
|
236
247
|
|
|
237
248
|
## 🔄 Core Workflows
|
|
@@ -1174,7 +1185,7 @@ bundle exec rubocop -a
|
|
|
1174
1185
|
|
|
1175
1186
|
## 📚 Additional Resources
|
|
1176
1187
|
|
|
1177
|
-
- **Main Repository**: [github.com/
|
|
1188
|
+
- **Main Repository**: [github.com/vaultkit-inc/vaultkitcli](https://github.com/vaultkit-inc/vaultkitcli)
|
|
1178
1189
|
- **Documentation**: [docs.vaultkit.io](https://docs.vaultkit.io)
|
|
1179
1190
|
- **AQL Specification**: [docs.vaultkit.io/aql](https://docs.vaultkit.io/aql)
|
|
1180
1191
|
- **Policy Reference**: [docs.vaultkit.io/policies](https://docs.vaultkit.io/policies)
|
data/lib/vkit/cli/base_cli.rb
CHANGED
|
@@ -317,7 +317,8 @@ module Vkit
|
|
|
317
317
|
subcommand "tokens", Class.new(Thor) {
|
|
318
318
|
|
|
319
319
|
# agents tokens list
|
|
320
|
-
desc "list", "List tokens
|
|
320
|
+
desc "list", "List agent tokens"
|
|
321
|
+
option :agent, type: :string, desc: "Only show tokens with this agent name"
|
|
321
322
|
option :format, type: :string, default: "table", enum: %w[table json]
|
|
322
323
|
def list
|
|
323
324
|
Commands::AgentTokensListCommand.new.call(
|
|
@@ -14,13 +14,10 @@ module Vkit
|
|
|
14
14
|
user = credential_store.user
|
|
15
15
|
org = user["organization_slug"]
|
|
16
16
|
|
|
17
|
-
response =
|
|
18
|
-
authenticated_client.get(
|
|
19
|
-
"/api/v1/orgs/#{org}/agent_tokens",
|
|
20
|
-
params: build_query(options)
|
|
21
|
-
)
|
|
17
|
+
response = authenticated_client.get("/api/v1/orgs/#{org}/agent_tokens")
|
|
22
18
|
|
|
23
19
|
tokens = response["tokens"] || []
|
|
20
|
+
tokens = tokens.select { |t| t["name"] == options[:agent] } if options[:agent]
|
|
24
21
|
|
|
25
22
|
print_result(tokens, format)
|
|
26
23
|
end
|
|
@@ -28,12 +25,6 @@ module Vkit
|
|
|
28
25
|
|
|
29
26
|
private
|
|
30
27
|
|
|
31
|
-
def build_query(options)
|
|
32
|
-
{}.tap do |q|
|
|
33
|
-
q[:name] = options[:agent] if options[:agent]
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
28
|
def print_result(tokens, format)
|
|
38
29
|
if tokens.empty?
|
|
39
30
|
puts "No tokens found."
|
|
@@ -119,8 +119,8 @@ module Vkit
|
|
|
119
119
|
end
|
|
120
120
|
puts "Created: #{format_time(a["created_at"])}"
|
|
121
121
|
puts
|
|
122
|
-
puts "▶ Approve: vkit approval
|
|
123
|
-
puts "▶ Deny: vkit approval
|
|
122
|
+
puts "▶ Approve: vkit approval:approve #{a["id"]}"
|
|
123
|
+
puts "▶ Deny: vkit approval:deny #{a["id"]} --reason \"…\""
|
|
124
124
|
puts
|
|
125
125
|
end
|
|
126
126
|
|
|
@@ -43,7 +43,7 @@ module Vkit
|
|
|
43
43
|
|
|
44
44
|
puts "\nNext steps:"
|
|
45
45
|
puts " 1. Review policies in config/policies/"
|
|
46
|
-
puts " 2. Run: vkit scan <datasource> --apply"
|
|
46
|
+
puts " 2. Run: vkit scan <datasource> --mode apply"
|
|
47
47
|
puts " 3. Run: vkit policy bundle"
|
|
48
48
|
puts " 4. Run: vkit policy deploy"
|
|
49
49
|
|
|
@@ -71,7 +71,7 @@ module Vkit
|
|
|
71
71
|
# VaultKit Dataset Registry
|
|
72
72
|
#
|
|
73
73
|
# Populate with:
|
|
74
|
-
# vkit scan <datasource> --apply
|
|
74
|
+
# vkit scan <datasource> --mode apply
|
|
75
75
|
# vkit registry export
|
|
76
76
|
#
|
|
77
77
|
YAML
|
|
@@ -17,7 +17,9 @@ module Vkit
|
|
|
17
17
|
if pack_name
|
|
18
18
|
[upgrade_single(manager, pack_name, force)]
|
|
19
19
|
else
|
|
20
|
-
manager.upgrade_all!(force: force)
|
|
20
|
+
manager.upgrade_all!(force: force).map do |name, result|
|
|
21
|
+
summarize(name, result)
|
|
22
|
+
end
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
print_summary(results)
|
|
@@ -31,8 +33,12 @@ module Vkit
|
|
|
31
33
|
private
|
|
32
34
|
|
|
33
35
|
def upgrade_single(manager, pack, force)
|
|
34
|
-
|
|
36
|
+
summarize(pack, manager.upgrade!(pack, force: force))
|
|
37
|
+
rescue => e
|
|
38
|
+
{ name: pack, status: :failed, error: e.message }
|
|
39
|
+
end
|
|
35
40
|
|
|
41
|
+
def summarize(pack, result)
|
|
36
42
|
if result == :up_to_date
|
|
37
43
|
{ name: pack, status: :up_to_date }
|
|
38
44
|
else
|
|
@@ -44,8 +50,6 @@ module Vkit
|
|
|
44
50
|
policies: result[:policies]
|
|
45
51
|
}
|
|
46
52
|
end
|
|
47
|
-
rescue => e
|
|
48
|
-
{ name: pack, status: :failed, error: e.message }
|
|
49
53
|
end
|
|
50
54
|
|
|
51
55
|
def print_summary(results)
|
|
@@ -67,7 +67,7 @@ module Vkit
|
|
|
67
67
|
clean.each { |d| print_clean(d) }
|
|
68
68
|
|
|
69
69
|
puts
|
|
70
|
-
puts " #{changed.size} changed · run with --apply to update baseline"
|
|
70
|
+
puts " #{changed.size} changed · run with --mode apply to update baseline"
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
# Suggestions are reviewed labels the classifier now disagrees with.
|
data/lib/vkit/cli.rb
CHANGED
|
@@ -90,11 +90,7 @@ module Vkit
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def http_request(uri, req, allow_non_200: false)
|
|
93
|
-
|
|
94
|
-
http.use_ssl = uri.scheme == "https"
|
|
95
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
96
|
-
|
|
97
|
-
res = http.request(req)
|
|
93
|
+
res = build_http(uri).request(req)
|
|
98
94
|
|
|
99
95
|
return res if allow_non_200
|
|
100
96
|
|
|
@@ -105,6 +101,14 @@ module Vkit
|
|
|
105
101
|
res
|
|
106
102
|
end
|
|
107
103
|
|
|
104
|
+
# Certificates are verified against the system trust store. Point
|
|
105
|
+
# SSL_CERT_FILE at a bundle to trust a self-signed control plane.
|
|
106
|
+
def build_http(uri)
|
|
107
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
108
|
+
http.use_ssl = uri.scheme == "https"
|
|
109
|
+
http
|
|
110
|
+
end
|
|
111
|
+
|
|
108
112
|
def parse_json(res)
|
|
109
113
|
JSON.parse(res.body)
|
|
110
114
|
rescue JSON::ParserError
|
data/lib/vkit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vaultkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nnamdi Ogundu
|
|
@@ -124,7 +124,7 @@ licenses:
|
|
|
124
124
|
- Nonstandard
|
|
125
125
|
metadata:
|
|
126
126
|
rubygems_mfa_required: 'true'
|
|
127
|
-
source_code_uri: https://github.com/
|
|
127
|
+
source_code_uri: https://github.com/vaultkit-inc/vaultkitcli
|
|
128
128
|
post_install_message:
|
|
129
129
|
rdoc_options: []
|
|
130
130
|
require_paths:
|