Converting an angular project to a maven web application











up vote
-1
down vote

favorite












As part of addressing click hijacking vulnerability, we added CSP's frame-ancestors header as a meta tag in angular's index.html page. But this did not work. Upon researching we came to know that frame-ancestors cannot be added as meta tag and should be returned as a http header from the server.



We have two options.




  1. Write a Http Filter and add CSP header to the response.


  2. Configure the webserver to add the CSP header to every response.



Our architects and the server team decided to go with the first option.



As part of the solution, we have manually built the angular application, copied the resources under dist directory to a maven web application, added the CSP filter in the web application and served the application. Thus fixing the click hijacking vulnerability.



Now we need a solution to automate this manual process.



Can anyone please suggest an approach?



My idea is to create a shell script which builds the angular application, copies the contents in dist directory to a maven project and then run maven build.



ng build
cp dist/* /webapp/
cd
mvn install



This is just an idea. Not sure what problems we still have to address.










share|improve this question






















  • Any thoughts on this??
    – Krishna Chaitanya
    Nov 14 at 0:42















up vote
-1
down vote

favorite












As part of addressing click hijacking vulnerability, we added CSP's frame-ancestors header as a meta tag in angular's index.html page. But this did not work. Upon researching we came to know that frame-ancestors cannot be added as meta tag and should be returned as a http header from the server.



We have two options.




  1. Write a Http Filter and add CSP header to the response.


  2. Configure the webserver to add the CSP header to every response.



Our architects and the server team decided to go with the first option.



As part of the solution, we have manually built the angular application, copied the resources under dist directory to a maven web application, added the CSP filter in the web application and served the application. Thus fixing the click hijacking vulnerability.



Now we need a solution to automate this manual process.



Can anyone please suggest an approach?



My idea is to create a shell script which builds the angular application, copies the contents in dist directory to a maven project and then run maven build.



ng build
cp dist/* /webapp/
cd
mvn install



This is just an idea. Not sure what problems we still have to address.










share|improve this question






















  • Any thoughts on this??
    – Krishna Chaitanya
    Nov 14 at 0:42













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











As part of addressing click hijacking vulnerability, we added CSP's frame-ancestors header as a meta tag in angular's index.html page. But this did not work. Upon researching we came to know that frame-ancestors cannot be added as meta tag and should be returned as a http header from the server.



We have two options.




  1. Write a Http Filter and add CSP header to the response.


  2. Configure the webserver to add the CSP header to every response.



Our architects and the server team decided to go with the first option.



As part of the solution, we have manually built the angular application, copied the resources under dist directory to a maven web application, added the CSP filter in the web application and served the application. Thus fixing the click hijacking vulnerability.



Now we need a solution to automate this manual process.



Can anyone please suggest an approach?



My idea is to create a shell script which builds the angular application, copies the contents in dist directory to a maven project and then run maven build.



ng build
cp dist/* /webapp/
cd
mvn install



This is just an idea. Not sure what problems we still have to address.










share|improve this question













As part of addressing click hijacking vulnerability, we added CSP's frame-ancestors header as a meta tag in angular's index.html page. But this did not work. Upon researching we came to know that frame-ancestors cannot be added as meta tag and should be returned as a http header from the server.



We have two options.




  1. Write a Http Filter and add CSP header to the response.


  2. Configure the webserver to add the CSP header to every response.



Our architects and the server team decided to go with the first option.



As part of the solution, we have manually built the angular application, copied the resources under dist directory to a maven web application, added the CSP filter in the web application and served the application. Thus fixing the click hijacking vulnerability.



Now we need a solution to automate this manual process.



Can anyone please suggest an approach?



My idea is to create a shell script which builds the angular application, copies the contents in dist directory to a maven project and then run maven build.



ng build
cp dist/* /webapp/
cd
mvn install



This is just an idea. Not sure what problems we still have to address.







angular deployment web-deployment






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 at 3:00









Krishna Chaitanya

86611444




86611444












  • Any thoughts on this??
    – Krishna Chaitanya
    Nov 14 at 0:42


















  • Any thoughts on this??
    – Krishna Chaitanya
    Nov 14 at 0:42
















Any thoughts on this??
– Krishna Chaitanya
Nov 14 at 0:42




Any thoughts on this??
– Krishna Chaitanya
Nov 14 at 0:42

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53273157%2fconverting-an-angular-project-to-a-maven-web-application%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53273157%2fconverting-an-angular-project-to-a-maven-web-application%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?