puppet-sec-lint 0.1.2 → 0.5.0

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +4 -2
  3. data/.idea/puppet-sec-lint.iml +7 -4
  4. data/Gemfile +3 -1
  5. data/Gemfile.lock +7 -1
  6. data/README.md +35 -18
  7. data/_config.yml +1 -0
  8. data/docs/404.html +24 -0
  9. data/docs/Gemfile +30 -0
  10. data/docs/Gemfile.lock +275 -0
  11. data/docs/_config.yml +41 -0
  12. data/docs/_posts/2021-05-03-welcome-to-jekyll.markdown +25 -0
  13. data/docs/_site/404.html +71 -0
  14. data/docs/_site/feed.xml +13 -0
  15. data/docs/_site/index.html +1 -0
  16. data/docs/_site/jekyll/update/2021/05/03/welcome-to-jekyll.html +77 -0
  17. data/docs/hard-coded-credentials.md +17 -0
  18. data/docs/index.md +6 -0
  19. data/exe/puppet-sec-lint +69 -15
  20. data/lib/configurations/configuration.rb +2 -1
  21. data/lib/configurations/regex_configuration.rb +9 -0
  22. data/lib/facades/configuration_file_facade.rb +3 -1
  23. data/lib/facades/configuration_page_facade.rb +6 -0
  24. data/lib/lol.pp +6 -6
  25. data/lib/puppet-sec-lint/version.rb +3 -1
  26. data/lib/rule_engine.rb +15 -3
  27. data/lib/rules/admin_by_default_rule.rb +33 -0
  28. data/lib/rules/cyrillic_homograph_attack.rb +27 -0
  29. data/lib/rules/empty_password_rule.rb +35 -0
  30. data/lib/rules/hard_coded_credentials_rule.rb +22 -31
  31. data/lib/rules/invalid_ip_addr_binding_rule.rb +37 -0
  32. data/lib/rules/no_http_rule.rb +26 -9
  33. data/lib/rules/rule.rb +72 -0
  34. data/lib/rules/suspicious_comment_rule.rb +28 -0
  35. data/lib/rules/use_weak_crypto_algorithms_rule.rb +28 -0
  36. data/lib/servers/language_server.rb +100 -0
  37. data/lib/servers/linter_server.rb +50 -0
  38. data/lib/{sin.rb → sin/sin.rb} +6 -1
  39. data/lib/sin/sin_type.rb +44 -0
  40. data/lib/test.txt +15 -0
  41. data/lib/test2.rb +16 -0
  42. data/lib/test3.rb +32 -0
  43. data/lib/test_new.rb +19 -0
  44. data/lol2.pp +83 -0
  45. metadata +30 -5
  46. data/lib/language_server.rb +0 -78
  47. data/lib/sin_type.rb +0 -12
data/docs/_config.yml ADDED
@@ -0,0 +1,41 @@
1
+ # Welcome to Jekyll!
2
+ #
3
+ # This config file is meant for settings that affect your whole blog, values
4
+ # which you are expected to set up once and rarely edit after that. If you find
5
+ # yourself editing this file very often, consider using Jekyll's data files
6
+ # feature for the data you need to update frequently.
7
+ #
8
+ # For technical reasons, this file is *NOT* reloaded automatically when you use
9
+ # 'bundle exec jekyll serve'. If you change this file, please restart the server process.
10
+
11
+ # Site settings
12
+ # These are used to personalize your new site. If you look in the HTML files,
13
+ # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
14
+ # You can create any custom variable you would like, and they will be accessible
15
+ # in the templates via {{ site.myvariable }}.
16
+ title: Puppet Securtiy Linter
17
+ email: tiago7b27@gmail.com
18
+ description: >- # this means to ignore newlines until "baseurl:"
19
+ Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts
20
+ baseurl: "" # the subpath of your site, e.g. /blog
21
+ url: "" # the base hostname & protocol for your site, e.g. http://example.com
22
+ twitter_username: jekyllrb
23
+ github_username: jekyll
24
+
25
+ # Build settings
26
+ markdown: kramdown
27
+ theme: jekyll-theme-hacker
28
+ plugins:
29
+ - jekyll-feed
30
+
31
+ # Exclude from processing.
32
+ # The following items will not be processed, by default. Create a custom list
33
+ # to override the default setting.
34
+ # exclude:
35
+ # - Gemfile
36
+ # - Gemfile.lock
37
+ # - node_modules
38
+ # - vendor/bundle/
39
+ # - vendor/cache/
40
+ # - vendor/gems/
41
+ # - vendor/ruby/
@@ -0,0 +1,25 @@
1
+ ---
2
+ layout: post
3
+ title: "Welcome to Jekyll!"
4
+ date: 2021-05-03 21:09:12 +0100
5
+ categories: jekyll update
6
+ ---
7
+ You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
8
+
9
+ To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
10
+
11
+ Jekyll also offers powerful support for code snippets:
12
+
13
+ {% highlight ruby %}
14
+ def print_hi(name)
15
+ puts "Hi, #{name}"
16
+ end
17
+ print_hi('Tom')
18
+ #=> prints 'Hi, Tom' to STDOUT.
19
+ {% endhighlight %}
20
+
21
+ Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
22
+
23
+ [jekyll-docs]: https://jekyllrb.com/docs/home
24
+ [jekyll-gh]: https://github.com/jekyll/jekyll
25
+ [jekyll-talk]: https://talk.jekyllrb.com/
@@ -0,0 +1,71 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <link rel="stylesheet" href="/assets/css/style.css?v=451ab93a01ea7ba9ec933d2a6c0ad3f1555b70e0">
8
+
9
+ <!-- Begin Jekyll SEO tag v2.7.1 -->
10
+ <title>Puppet Securtiy Linter | Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts</title>
11
+ <meta name="generator" content="Jekyll v3.9.0" />
12
+ <meta property="og:title" content="Puppet Securtiy Linter" />
13
+ <meta property="og:locale" content="en_US" />
14
+ <meta name="description" content="Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts" />
15
+ <meta property="og:description" content="Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts" />
16
+ <link rel="canonical" href="http://localhost:4000/404.html" />
17
+ <meta property="og:url" content="http://localhost:4000/404.html" />
18
+ <meta property="og:site_name" content="Puppet Securtiy Linter" />
19
+ <meta name="twitter:card" content="summary" />
20
+ <meta property="twitter:title" content="Puppet Securtiy Linter" />
21
+ <script type="application/ld+json">
22
+ {"@type":"WebPage","headline":"Puppet Securtiy Linter","description":"Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts","url":"http://localhost:4000/404.html","@context":"https://schema.org"}</script>
23
+ <!-- End Jekyll SEO tag -->
24
+
25
+ </head>
26
+
27
+ <body>
28
+
29
+ <header>
30
+ <div class="container">
31
+ <a id="a-title" href="/">
32
+ <h1>Puppet Securtiy Linter</h1>
33
+ </a>
34
+ <h2>Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts</h2>
35
+
36
+ <section id="downloads">
37
+
38
+ <a href="https://github.com/TiagoR98/puppet-sec-lint" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
39
+ </section>
40
+ </div>
41
+ </header>
42
+
43
+ <div class="container">
44
+ <section id="main_content">
45
+ <style type="text/css" media="screen">
46
+ .container {
47
+ margin: 10px auto;
48
+ max-width: 600px;
49
+ text-align: center;
50
+ }
51
+ h1 {
52
+ margin: 30px 0;
53
+ font-size: 4em;
54
+ line-height: 1;
55
+ letter-spacing: -1px;
56
+ }
57
+ </style>
58
+
59
+ <div class="container">
60
+ <h1>404</h1>
61
+
62
+ <p><strong>Page not found :(</strong></p>
63
+ <p>The requested page could not be found.</p>
64
+ </div>
65
+
66
+ </section>
67
+ </div>
68
+
69
+
70
+ </body>
71
+ </html>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2021-05-03T22:26:18+01:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">Puppet Securtiy Linter</title><subtitle>Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts</subtitle><entry><title type="html">Welcome to Jekyll!</title><link href="http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll.html" rel="alternate" type="text/html" title="Welcome to Jekyll!" /><published>2021-05-03T21:09:12+01:00</published><updated>2021-05-03T21:09:12+01:00</updated><id>http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll</id><content type="html" xml:base="http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll.html">&lt;p&gt;You’ll find this post in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;, which launches a web server and auto-regenerates your site when a file is updated.&lt;/p&gt;
2
+
3
+ &lt;p&gt;To add new posts, simply add a file in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory that follows the convention &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YYYY-MM-DD-name-of-post.ext&lt;/code&gt; and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.&lt;/p&gt;
4
+
5
+ &lt;p&gt;Jekyll also offers powerful support for code snippets:&lt;/p&gt;
6
+
7
+ &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
8
+ &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hi, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
9
+ &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
10
+ &lt;span class=&quot;n&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Tom'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
11
+ &lt;span class=&quot;c1&quot;&gt;#=&amp;gt; prints 'Hi, Tom' to STDOUT.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
12
+
13
+ &lt;p&gt;Check out the &lt;a href=&quot;https://jekyllrb.com/docs/home&quot;&gt;Jekyll docs&lt;/a&gt; for more info on how to get the most out of Jekyll. File all bugs/feature requests at &lt;a href=&quot;https://github.com/jekyll/jekyll&quot;&gt;Jekyll’s GitHub repo&lt;/a&gt;. If you have questions, you can ask them on &lt;a href=&quot;https://talk.jekyllrb.com/&quot;&gt;Jekyll Talk&lt;/a&gt;.&lt;/p&gt;</content><author><name></name></author><category term="jekyll" /><category term="update" /><summary type="html">You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.</summary></entry></feed>
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,77 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <link rel="stylesheet" href="/assets/css/style.css?v=451ab93a01ea7ba9ec933d2a6c0ad3f1555b70e0">
8
+
9
+ <!-- Begin Jekyll SEO tag v2.7.1 -->
10
+ <title>Welcome to Jekyll! | Puppet Securtiy Linter</title>
11
+ <meta name="generator" content="Jekyll v3.9.0" />
12
+ <meta property="og:title" content="Welcome to Jekyll!" />
13
+ <meta property="og:locale" content="en_US" />
14
+ <meta name="description" content="You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated." />
15
+ <meta property="og:description" content="You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated." />
16
+ <link rel="canonical" href="http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll.html" />
17
+ <meta property="og:url" content="http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll.html" />
18
+ <meta property="og:site_name" content="Puppet Securtiy Linter" />
19
+ <meta property="og:type" content="article" />
20
+ <meta property="article:published_time" content="2021-05-03T21:09:12+01:00" />
21
+ <meta name="twitter:card" content="summary" />
22
+ <meta property="twitter:title" content="Welcome to Jekyll!" />
23
+ <script type="application/ld+json">
24
+ {"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll.html"},"headline":"Welcome to Jekyll!","dateModified":"2021-05-03T21:09:12+01:00","datePublished":"2021-05-03T21:09:12+01:00","description":"You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.","url":"http://localhost:4000/jekyll/update/2021/05/03/welcome-to-jekyll.html","@context":"https://schema.org"}</script>
25
+ <!-- End Jekyll SEO tag -->
26
+
27
+ </head>
28
+
29
+ <body>
30
+
31
+ <header>
32
+ <div class="container">
33
+ <a id="a-title" href="/">
34
+ <h1>Puppet Securtiy Linter</h1>
35
+ </a>
36
+ <h2>Scurity focused linter to detect and help solve vulnearbilities found on Puppet Infrastructure-as-code scripts</h2>
37
+
38
+ <section id="downloads">
39
+
40
+ <a href="https://github.com/TiagoR98/puppet-sec-lint" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
41
+ </section>
42
+ </div>
43
+ </header>
44
+
45
+ <div class="container">
46
+ <section id="main_content">
47
+ <small>3 May 2021</small>
48
+ <h1>Welcome to Jekyll!</h1>
49
+
50
+ <p class="view">by </p>
51
+
52
+ <p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
53
+
54
+ <p>To add new posts, simply add a file in the <code class="language-plaintext highlighter-rouge">_posts</code> directory that follows the convention <code class="language-plaintext highlighter-rouge">YYYY-MM-DD-name-of-post.ext</code> and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
55
+
56
+ <p>Jekyll also offers powerful support for code snippets:</p>
57
+
58
+ <figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
59
+ <span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
60
+ <span class="k">end</span>
61
+ <span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
62
+ <span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
63
+
64
+ <p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>
65
+
66
+
67
+
68
+
69
+ <small>tags: <em></em></small>
70
+
71
+
72
+ </section>
73
+ </div>
74
+
75
+
76
+ </body>
77
+ </html>
@@ -0,0 +1,17 @@
1
+ ---
2
+ title: Hard Coded Credentials
3
+ permalink: /hard-coded-credentials/
4
+ ---
5
+
6
+ # Hard Coded Credentials
7
+
8
+ Writing sensitive credentials on puppet scripts can expose them to malicious actors who can obtain access to these files.
9
+
10
+ ## Example
11
+
12
+ ```puppet
13
+ class example::service (
14
+ $username = "user1",
15
+ $passsword = "amind1234"
16
+ )
17
+ ```
data/docs/index.md ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ # Feel free to add content and custom Front Matter to this file.
3
+ # To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
4
+
5
+ layout: home
6
+ ---
data/exe/puppet-sec-lint CHANGED
@@ -2,34 +2,88 @@
2
2
 
3
3
  require_relative '../lib/rule_engine'
4
4
  require 'json'
5
+ require 'launchy'
5
6
  require 'optparse'
6
7
  require 'optparse/uri'
8
+ require_relative '../lib/puppet-sec-lint/version'
7
9
  require_relative '../lib/visitors/configuration_visitor'
8
10
  require_relative '../lib/facades/configuration_file_facade'
9
11
 
12
+ conf_page_url = "http://localhost:9292/configuration"
13
+
10
14
  options = {}
15
+ @success = true
16
+
17
+ def analyze_file(file_path)
18
+ File.open(file_path, 'rb:UTF-8') do |f|
19
+ puts "Analyzing the file #{File.basename(file_path)}...\n\n"
20
+
21
+ code = f.read
22
+ result = RuleEngine.analyzeDocument(code)
23
+
24
+ result.each do |sin|
25
+ puts sin.ToString
26
+ @success = false
27
+ end
28
+
29
+ puts "\nFound #{result.length} vulnerabilities in the puppet code.\n"
30
+ end
31
+ end
32
+
11
33
  OptionParser.new do |opts|
12
- opts.banner = "Usage: puppet-sec-lint [options]"
34
+ opts.banner = "Usage: puppet-sec-lint [file or directory] [options]"
13
35
 
14
- opts.on("-f", "--file FILE",URI, "Path of puppet file to be analyzed") do |file|
15
- options[:file] = file
36
+ opts.on("-c", "--configurations", "Open the linter rules configurations page on a browser") do |v|
37
+ options[:configurations] = v
16
38
  end
17
39
  end.parse!
18
40
 
19
- if options[:file].nil?
20
- require_relative '../lib/language_server'
21
- exit
22
- end
41
+ puts '___ _ _ ___ ___ ____ ___ ____ ____ ____ _ _ ____ _ ___ _ _ _ _ _ _ ___ ____ ____ '
42
+ puts '|__] | | |__] |__] |___ | [__ |___ | | | |__/ | | \_/ | | |\ | | |___ |__/ '
43
+ puts '| |__| | | |___ | ___] |___ |___ |__| | \ | | | |___ | | \| | |___ | \ '
44
+
45
+ puts "\n"
23
46
 
24
- ConfigurationVisitor.GenerateIDs
25
- ConfigurationFileFacade.LoadConfigurations
47
+ puts "Release v#{PuppetSecLint::VERSION} #{PuppetSecLint::AUTHOR} #{PuppetSecLint::YEAR}"
26
48
 
27
- File.open(options[:file].to_s, 'rb:UTF-8') do |f|
28
- code = f.read
49
+ puts "\n"
29
50
 
30
- result = RuleEngine.analyzeDocument(code)
51
+ if not ARGV[0].nil?
52
+ if File.file?(ARGV[0].to_s) && File.extname(ARGV[0].to_s) == '.pp'
53
+ analyze_file(ARGV[0].to_s)
54
+ elsif File.directory?(ARGV[0].to_s)
55
+ Dir.chdir(ARGV[0].to_s)
56
+ files = Dir.glob("**/*.pp").map {|f| File.join(Dir.pwd,f) }
31
57
 
32
- result.each do |sin|
33
- puts sin.ToString
58
+ files.each do |file_path|
59
+ analyze_file(file_path)
60
+ puts "\n"
61
+ end
62
+ else
63
+ raise "#{ARGV[0].to_s} is neither a valid directory or puppet file"
34
64
  end
35
- end
65
+ end
66
+
67
+ if ARGV[0].nil? || options[:configurations]
68
+ linter_server = Thread.new {
69
+ require_relative '../lib/servers/linter_server'
70
+ }
71
+ language_server = Thread.new {
72
+ require_relative '../lib/servers/language_server'
73
+ LanguageServer.start
74
+ }
75
+
76
+ if options[:configurations]
77
+ puts "\nLaunching configurations page at #{conf_page_url}...\n\n"
78
+ Launchy.open(conf_page_url)
79
+ else
80
+ puts "\nLinter configurations page available at #{conf_page_url}\n\n"
81
+ end
82
+
83
+ linter_server.join
84
+ language_server.exit
85
+ end
86
+
87
+ exit(@success)
88
+
89
+
@@ -15,5 +15,6 @@ DisplayField = {
15
15
  TextBox: "textbox",
16
16
  CheckBox: "checkbox",
17
17
  NumericBox: "numericbox",
18
- SelectBox: "selectbox"
18
+ SelectBox: "selectbox",
19
+ RegexBox: "regexbox"
19
20
  }
@@ -0,0 +1,9 @@
1
+ require_relative 'configuration'
2
+
3
+ class RegexConfiguration < Configuration
4
+
5
+ def initialize(name, value, description)
6
+ super
7
+ @displayfield=DisplayField[:RegexBox]
8
+ end
9
+ end
@@ -13,7 +13,7 @@ class ConfigurationFileFacade
13
13
  when DisplayField[:SelectBox]
14
14
  ini[rule][configuration.id] = configuration.value.join(',')
15
15
  else
16
- ini[rule][configuration.id] = configuration.value
16
+ ini[rule][configuration.id] = configuration.value.to_s
17
17
  end
18
18
  end
19
19
  end
@@ -32,6 +32,8 @@ class ConfigurationFileFacade
32
32
  case configuration.displayfield
33
33
  when DisplayField[:SelectBox]
34
34
  configuration.value = ini[rule][configuration.id].split(',')
35
+ when DisplayField[:RegexBox]
36
+ configuration.value = Regexp.new ini[rule][configuration.id]
35
37
  else
36
38
  configuration.value = ini[rule][configuration.id]
37
39
  end
@@ -50,6 +50,8 @@ class ConfigurationPageFacade
50
50
  return_value+="#{option}\n"
51
51
  end
52
52
  return_value += "</textarea>"
53
+ when DisplayField[:TextBox], DisplayField[:RegexBox]
54
+ return_value += "<input type=\"text\" id=\"#{configuration.id}\" name=\"#{configuration.id}\" value=\"#{configuration.value.to_s}\" size=\"#{configuration.value.to_s.length()}\"><br>\n"
53
55
  end
54
56
 
55
57
  return_value += "<p style=\"color:gray\">#{configuration.description}</p>\n<br>\n"
@@ -71,6 +73,10 @@ class ConfigurationPageFacade
71
73
 
72
74
  when DisplayField[:SelectBox]
73
75
  configuration.value = new_conf[configuration.id].split(/\r?\n/).delete_if(&:empty?)
76
+
77
+ when DisplayField[:RegexBox]
78
+ configuration.value = Regexp.new new_conf[configuration.id]
79
+
74
80
  else
75
81
  configuration.value = new_conf[configuration.id]
76
82
  end
data/lib/lol.pp CHANGED
@@ -8,17 +8,17 @@
8
8
  # the following code addresses the bug: https://bugs.launchpad.net/keystone/+bug/1472285 .
9
9
 
10
10
  class consul_template::service (
11
- $rpc_password = '{6ad470ec62b0511b63340dca2950d750181598efnHKvN1ge',
12
- $admin_username = 'admin',
13
- $password = 'ceilometer',
14
- $admin_password = 'admin',
11
+ $pass = lols(3),
12
+ $aijoijooiumihhn_password = 'pe-puppet'
13
+ $admin = 'ceisssesrelometer',
14
+ $aijoijooiumihhn_password = '(adiyu(guygmin',
15
15
  ) {
16
16
  exec { 'network-restart':
17
17
  command => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDM release-runner key',
18
18
  path => '/usr/bin:/usr/sbin:/bin:/sbin',
19
19
  refreshonly => true,
20
20
  vmware_md5 => 'LOL',
21
- autho => 'MD5',
21
+ autho => 'MDi09i09i5',
22
22
  cmd => 'virsh secret-define --file ${secret_xml} && virsh secret-set-value --secret ${rbd_secret_uuid} --base64 $(ceph auth get-key client.${user})',
23
23
  $auth_uri => 'http://127.0.0.1:5000',
24
24
  'bind_address' => '0.0.0.0',
@@ -80,4 +80,4 @@ UcXHbA==
80
80
  replace => true,
81
81
  require => File['/var/lib/gerrit/.ssh']
82
82
  }
83
- }
83
+ }