Skip to content

Commit

Permalink
Removed Index from Public RootOptions as to not allow Directory Index (
Browse files Browse the repository at this point in the history
…#1622)

* Removed Index from Public RootOptions as to not allow Directory Index… (#1618)

* Removed Index from Public RootOptions as to not allow Directory Indexing - Issues #1617

* Cleaned up ood-portal.conf.erb and updated fixtures to not contain Indexes

* Updated CheckSum for ood-portal.conf.default

* Add checksum helper script

* Updated default's checksum

Co-authored-by: Gerald Byrket <[email protected]>
  • Loading branch information
treydock and gerald-byrket authored Nov 29, 2021
1 parent e121440 commit 0554b0a
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 16 deletions.
16 changes: 16 additions & 0 deletions ood-portal-generator/checksum.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby

# use this file when you need to generate a new checksum for testing against.
# ./checksum.rb spec/fixture/the-file-i-changed

require "digest"

def read_file_omitting_comments(input)
File.readlines(input).reject { |line| line =~ /^\s*#/ }.join('')
end

def checksum(input)
Digest::SHA256.hexdigest(read_file_omitting_comments(input))
end

puts checksum(ARGV[0])
6 changes: 3 additions & 3 deletions ood-portal-generator/spec/fixtures/ood-portal.conf.all
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Listen 8080
#
Alias "/assets" "/var/www/configured/public"
<Directory "/var/www/configured/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down Expand Up @@ -240,7 +240,7 @@ Listen 8080
#
Alias "/discover" "/var/www/ood/discover"
<Directory "/var/www/ood/discover">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand All @@ -254,7 +254,7 @@ Listen 8080
#
Alias "/register" "/var/www/ood/register"
<Directory "/var/www/ood/register">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None

AuthType openid-connect
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/spec/fixtures/ood-portal.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/spec/fixtures/ood-portal.conf.dex
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/spec/fixtures/ood-portal.conf.nomaint
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/spec/fixtures/ood-portal.conf.oidc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#
Alias "/public" "/var/www/ood/public"
<Directory "/var/www/ood/public">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/spec/fixtures/sum.default
Original file line number Diff line number Diff line change
@@ -1 +1 @@
051c639f68c21bf54d6dfe1ee3df3da0726dae906322a03137b51d34a5064a79 /opt/rh/httpd24/root/etc/httpd/conf.d/ood-portal.conf
e5891fae1abde47d878ecbda0edbed7a132afa7ea166ecdaecb2214547fe102d /opt/rh/httpd24/root/etc/httpd/conf.d/ood-portal.conf
6 changes: 3 additions & 3 deletions ood-portal-generator/templates/ood-portal.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Listen <%= addr_port %>
#
Alias "<%= @public_uri %>" "<%= @public_root %>"
<Directory "<%= @public_root %>">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand Down Expand Up @@ -322,7 +322,7 @@ Listen <%= addr_port %>
#
Alias "<%= @oidc_discover_uri %>" "<%= @oidc_discover_root %>"
<Directory "<%= @oidc_discover_root %>">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Expand All @@ -337,7 +337,7 @@ Listen <%= addr_port %>
#
Alias "<%= @register_uri %>" "<%= @register_root %>"
<Directory "<%= @register_root %>">
Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None

<%- @auth.each do |line| -%>
Expand Down

0 comments on commit 0554b0a

Please sign in to comment.